You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refactor(aws): consolidate 5 near-identical RI term parsers (drift already started) #34
Duplication audit (owner-requested) found LeanerCloud/cloud-commitments-cli#1207 added 5 near-identical term-parsing helpers across the service clients, and DRIFT HAS ALREADY BEGUN: requiredMonthsForTerm (opensearch + redshift, identical bar the service name in the error), getDurationString (elasticache + rds, identical), getDurationStringForAPI (memorydb, a variant that ALSO accepts "12"/"36"). All validate the same 1yr/1/3yr/3 domain on a MONEY path (RI term -> offering purchase), so divergence risks mispriced/mistermed purchases.
Consolidate into a shared ParseTermMonths(term, service string) (int, error) + duration-string formatter in providers/aws/internal/purchasecfg (alongside LeanerCloud/cloud-commitments-cli#1390's ResolveTag) or a sibling terms pkg. Keep each caller's fail-loud behavior (LeanerCloud/cloud-commitments-cli#1207); reconcile the memorydb "12"/"36" variant deliberately (decide if numeric forms are valid everywhere). All existing term tests must pass unchanged.
Claimed by worker 4 (shard rank 24). Starting consolidation of the five RI term parsers into a shared helper in providers/aws, per the issue's fix direction.
Resolved by PR #273, merged normally as 5599b24 from independently reviewed head 60868b6. All nine owned source/test files match the verified head byte-for-byte. Shared term parsing, six service consumers, MemoryDB legacy aliases and complete diagnostic, and exported duration constants are preserved. Local Go 1.26.6 builds and the full AWS race suite passed; pre-merge CI is green. Actual merge-commit CI is being watched. Fixture and mock evidence was used; no live cloud purchase was exercised.
Activity
cristim commentedon Oct 7, 2026
Claimed by worker 4 (shard rank 24). Starting consolidation of the five RI term parsers into a shared helper in providers/aws, per the issue's fix direction.
refactor(aws): consolidate the five RI term parsers into purchasecfg
cristim commentedon Oct 7, 2026
Resolved by PR #273, merged normally as 5599b24 from independently reviewed head 60868b6. All nine owned source/test files match the verified head byte-for-byte. Shared term parsing, six service consumers, MemoryDB legacy aliases and complete diagnostic, and exported duration constants are preserved. Local Go 1.26.6 builds and the full AWS race suite passed; pre-merge CI is green. Actual merge-commit CI is being watched. Fixture and mock evidence was used; no live cloud purchase was exercised.