Skip to content

chore(server): drop the unused SupersedePolicyEvaluations from DatabbaseAPI - #2433

Merged
tkircsi merged 1 commit into
mainfrom
chore/drop-unused-supersede-api
Oct 30, 2026
Merged

tkircsi merged 1 commit into
mainfrom
chore/drop-unused-supersede-api

Conversation

@tkircsi

@tkircsi tkircsi commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Description

Follow-up to #2432. SupersedePolicyEvaluations was on types.DatabaseAPI and on DB with no production caller: all six metadata writers call the unexported supersedePolicyEvaluations inside their own transaction, and only tests went through the exported one.

It is not merely unused but unusable for the purpose. A caller reaching it through the interface has no transaction to share, so the metadata write and its invalidation would commit separately — the failure #2343 rules out under "atomic with the write". Being on DatabaseAPI also meant every fake had to stub it.

A reader of DatabaseAPI would otherwise have no indication that invalidation happens at all, so the explanation moves to where the behaviour is rather than disappearing: the scan, signature and identity writer interfaces each say that a write changing what a policy can read supersedes that group's verdicts in the same transaction.

Changes

  • Remove SupersedePolicyEvaluations from types.DatabaseAPI and from gorm.DB, and the fakeSignatureDB stub it required.
  • Record on supersedePolicyEvaluations why it takes a transaction and is not on the interface.
  • Note the invalidation on the three writer interfaces and on SetRecordSigned.
  • Point the six test call sites at the unexported function.

Closes #2343

@tkircsi tkircsi self-assigned this Oct 29, 2026
@tkircsi tkircsi added area/dir/server kind/refactor Categorizes issue or PR as related to cleaning up code, process, or technical debt. labels Oct 29, 2026
@tkircsi
tkircsi requested a review from a team as a code owner October 29, 2026 14:47
@github-actions github-actions Bot added the size/S Denotes a PR that changes 50-199 lines label Oct 29, 2026
@codecov

codecov Bot commented Oct 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@tkircsi
tkircsi added this pull request to the merge queue Oct 30, 2026
Merged via the queue into main with commit ddd4679 Oct 30, 2026
35 checks passed
@tkircsi
tkircsi deleted the chore/drop-unused-supersede-api branch October 30, 2026 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/dir/server kind/refactor Categorizes issue or PR as related to cleaning up code, process, or technical debt. size/S Denotes a PR that changes 50-199 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Invalidate cached verdicts when the metadata underneath them changes

2 participants