Skip to content

Preserve policy mirror identity across MySQL JSON storage and retries - #3826

Closed
MaxGhenis wants to merge 2 commits into
masterfrom
max/api-phase10-dedup-20260909
Closed

Preserve policy mirror identity across MySQL JSON storage and retries#3826
MaxGhenis wants to merge 2 commits into
masterfrom
max/api-phase10-dedup-20260909

Conversation

@MaxGhenis

@MaxGhenis MaxGhenis commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Superseded by the merged Stage11 implementation and canonical SPM integration PR3827. Stage11 already refreshes persisted JSON for both new and existing source rows; PR3827 preserves all missing numeric-identity/retry regressions and the real MySQL/PostgreSQL CI path. Independent comparison found all43 prior test functions/classes preserved, and46 focused tests passed. Closing this duplicate leaves its review and evidence available; no branch is deleted.

A new policy and an equivalent retry could receive different v2 identities because the first mirror used the request JSON while the retry used JSON read back from MySQL. MySQL can change a floating-point value by one representable step during JSON storage; this reproduces the failure in the existing Phase 10 staging deployment exercise.

Refresh newly inserted policies inside the v1 transaction before taking the mirror snapshot. Both paths then use the same persisted values. Exact content hashing, label independence, country/version separation, and the post-commit failure/retry contract remain intact. Existing divergent mappings are not rewritten.

Validation: 349 policy/mirroring/compatibility tests, a 54-file type check, formatting and migration guards pass. New regressions fail against the original service and pass with the fix. Real disposable MySQL 8.4 and PostgreSQL 17 verification passed all 6 migration-lifecycle and 22 persistence/mirroring tests. These exercise the actual stored-number conversion, first write/retry/relabel identity, PostgreSQL rollback, distinct native values, and rejection of historical divergent mappings without repair. The PR adds the real MySQL regression suite to CI. Staging deployment verification remains required; no production database was changed.

@codecov

codecov Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.32%. Comparing base (37e168a) to head (6d8ab72).
⚠️ Report is 10 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master    #3826       +/-   ##
===========================================
+ Coverage   46.26%   87.32%   +41.05%     
===========================================
  Files         135      150       +15     
  Lines        7963     8937      +974     
  Branches     1326     1543      +217     
===========================================
+ Hits         3684     7804     +4120     
+ Misses       3990      692     -3298     
- Partials      289      441      +152     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant