Skip to content

[COST-7249] Widen rates_to_usage.label_hash to VARCHAR(64)#6048

Merged
myersCody merged 1 commit into
project-koku:mainfrom
jordigilh:COST-7249/widen-label-hash
May 11, 2026
Merged

[COST-7249] Widen rates_to_usage.label_hash to VARCHAR(64)#6048
myersCody merged 1 commit into
project-koku:mainfrom
jordigilh:COST-7249/widen-label-hash

Conversation

@jordigilh
Copy link
Copy Markdown
Contributor

Summary

  • Extends rates_to_usage.label_hash from VARCHAR(32) to VARCHAR(64) in preparation for Phase 3's SHA-256 hash upgrade
  • Updates the RatesToUsage model and adds migration 0350
  • Backwards-compatible: existing 32-char MD5 hashes are unaffected

Context

Split out from Phase 3 PR #6043 per TL request. Merging the schema change independently keeps Phase 3 as a pure SQL/Python change with a clean git-revert rollback path (no migration entanglement).

The AlterField reverse naturally narrows back to VARCHAR(32). If 64-char SHA-256 data exists (from Phase 3), PostgreSQL will reject the reverse — which is the correct behavior since Phase 3 must be reverted first.

Test plan

  • Migration applies cleanly on a fresh database
  • Migration applies cleanly on a database with existing rates_to_usage rows (Phase 2 MD5 hashes)
  • Existing Phase 2 cost model processing is unaffected
  • CI passes

Made with Cursor

@jordigilh jordigilh requested review from a team as code owners May 6, 2026 19:27
@github-actions github-actions Bot added the smokes-required Label to show that smokes tests should be run against these changes. label May 6, 2026
jordigilh added a commit to jordigilh/koku that referenced this pull request May 6, 2026
…6048)

Migration 0350 (widen label_hash to VARCHAR(64)) has been extracted
into standalone PR project-koku#6048 per TL request, so Phase 3 can be cleanly
reverted via git revert without migration entanglement.

The model change (max_length=64) is retained here since Phase 3's
SHA-256 hashes require the wider column. After PR project-koku#6048 merges,
a final rebase will deduplicate the model change.

Co-authored-by: Cursor <cursoragent@cursor.com>
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request increases the maximum length of the label_hash field from 32 to 64 characters in the RatesToUsage model and includes the corresponding database migration. I have no feedback to provide as there were no review comments.

@myersCody myersCody added the smoke-tests pr_check will run minimal required smokes. Used when changes hit multiple providers. label May 6, 2026
@myersCody
Copy link
Copy Markdown
Contributor

/retest

@myersCody myersCody enabled auto-merge (squash) May 6, 2026 19:54
@codecov
Copy link
Copy Markdown

codecov Bot commented May 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.4%. Comparing base (29b7704) to head (2f43f87).

Additional details and impacted files
@@          Coverage Diff          @@
##            main   #6048   +/-   ##
=====================================
  Coverage   94.3%   94.4%           
=====================================
  Files        362     362           
  Lines      31988   31988           
  Branches    3513    3513           
=====================================
+ Hits       30179   30181    +2     
+ Misses      1172    1171    -1     
+ Partials     637     636    -1     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jordigilh jordigilh added the flightpath-pr Issues being worked on by the flight path team label May 6, 2026
@jordigilh
Copy link
Copy Markdown
Contributor Author

/retest

@jordigilh
Copy link
Copy Markdown
Contributor Author

@myersCody koku-ci is green on retest — PR is ready to merge (approved, all checks passing).

jordigilh added a commit to jordigilh/koku that referenced this pull request May 11, 2026
…6048)

Migration 0350 (widen label_hash to VARCHAR(64)) has been extracted
into standalone PR project-koku#6048 per TL request, so Phase 3 can be cleanly
reverted via git revert without migration entanglement.

The model change (max_length=64) is retained here since Phase 3's
SHA-256 hashes require the wider column. After PR project-koku#6048 merges,
a final rebase will deduplicate the model change.

Co-authored-by: Cursor <cursoragent@cursor.com>
Extend label_hash from VARCHAR(32) (MD5) to VARCHAR(64) in
preparation for Phase 3's SHA-256 upgrade. This is a backwards-
compatible schema change with zero runtime impact on existing
MD5 hashes.

Split out from Phase 3 PR project-koku#6043 per TL request so that Phase 3
remains a clean git-revert without migration entanglement.

Co-authored-by: Cursor <cursoragent@cursor.com>
@jordigilh jordigilh force-pushed the COST-7249/widen-label-hash branch from 2eaa783 to 2f43f87 Compare May 11, 2026 00:53
@myersCody myersCody merged commit 47db450 into project-koku:main May 11, 2026
13 checks passed
jordigilh added a commit to jordigilh/koku that referenced this pull request May 11, 2026
…6048)

Migration 0350 (widen label_hash to VARCHAR(64)) has been extracted
into standalone PR project-koku#6048 per TL request, so Phase 3 can be cleanly
reverted via git revert without migration entanglement.

The model change (max_length=64) is retained here since Phase 3's
SHA-256 hashes require the wider column. After PR project-koku#6048 merges,
a final rebase will deduplicate the model change.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

flightpath-pr Issues being worked on by the flight path team smoke-tests pr_check will run minimal required smokes. Used when changes hit multiple providers. smokes-required Label to show that smokes tests should be run against these changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants