Skip to content

fix: publish audits that share a name as separate snapshot nodes - #1326

Merged
kvlonge merged 2 commits into
mainfrom
fix/audit-snapshot-node-keys
Nov 6, 2026
Merged

kvlonge merged 2 commits into
mainfrom
fix/audit-snapshot-node-keys

Conversation

@kvlonge

@kvlonge kvlonge commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Why

Publishing a project whose models attach the same inline audit, for example not_null on two models, failed with duplicate snapshot node identity. Inline audits compile to their definition name, so every attachment produced the same audit:<name> snapshot key. The default sqb playground project hits this, so it could not be published to a location.

Changes

  • Audits attached to a target are now keyed by their execution identity, audit:<name>:<kind>:<target>[:<column>]. This is the same identity build progress and results already use. Singular audits keep audit:<name>.
  • Identity change: an existing location's first republish shows each attached audit's old key as removed and its new key as added in that publication's change list. Nothing else stores audit node keys:
    • role grants and job selections resolve through the project graph, which has no audit nodes;
    • run history holds only graph nodes and check: keys;
    • audit results are keyed by audit name and binding key;
    • published snapshots are immutable and keep their keys.
  • A remaining duplicate now names its key in the error, for example one column attaching the same unnamed audit twice. That case already failed before this change.
  • A DuckShop orchestration edge case covers two models sharing inline and explicitly named audits.

Verification

  • New integration test, through the installed CLI and a real server. It publishes the default playground and the DuckShop case, checks one audit node per attachment, and checks that an unchanged republish reports no changes.
  • The test fails without the fix (duplicate snapshot node identity). The playground and the edge case also fail the same way with the 0.191.0 CLI.
  • The snapshot, native audit, publication, project role and worker integration tests pass (129).
  • make check-ci passes.

Inline audits compile to their definition name, so two models with the
same inline audit gave two snapshot nodes one key and publication
failed. Attached audits are now keyed by their execution identity:
audit name, target kind, target and column. Singular audits keep their
key.
@kvlonge
kvlonge enabled auto-merge (squash) November 6, 2026 12:04
@kvlonge
kvlonge merged commit 8f0728e into main Nov 6, 2026
47 checks passed
@kvlonge
kvlonge deleted the fix/audit-snapshot-node-keys branch November 6, 2026 19:32
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