Skip to content

perf: resolve each stored review once per publication gate run - #342

Open
vinceblock99 wants to merge 1 commit into
devfrom
fix/review-gate-validate-once
Open

vinceblock99 wants to merge 1 commit into
devfrom
fix/review-gate-validate-once

Conversation

@vinceblock99

Copy link
Copy Markdown
Contributor

Problem

For every managed change without an attestation, the publication gate asks whether a stored review covers it. Each of those questions re-read the whole review inventory and then verified and validated the review again, although none of that depends on which change is asking.

Validation rebuilds the review's retained source view, so a batch of M changes covered by one review cost M full validations.

Fix

One gate evaluation now reads the inventory once and resolves each review once: its signature and supersession chain, and its SHACL outcome. Later changes reuse the result.

The decision for each change and the limitation text it reports are unchanged. A review that fails still blocks every change it covers, and each of them says why.

Tests

  • New publication_review::tests::gate:
    • Three changes covered by one review cost the gate the same number of key lookups as one change. Before the fix it was 36 against 12.
    • A stored review that stopped conforming blocks all three changes, each with its own limitation.
    • An unreadable inventory blocks all three changes, each with the inventory error.
  • cargo test -p atomic-repository --features review-shacl --lib -- publication_review provenance_gate: 64 passed, 0 failed. Without the feature: 22 passed, 0 failed.
  • cargo clippy -p atomic-repository --all-targets -- -D warnings, with and without review-shacl: clean.

For every managed change without an attestation, the publication gate
asks whether a stored review covers it. Each of those questions re-read
the whole review inventory and then verified and validated the review
again, although none of that depends on which change is asking.
Validation rebuilds the review's retained source view, so a batch of M
changes covered by one review cost M full validations.

One gate evaluation now reads the inventory once and resolves each
review once: its signature and supersession chain, and its SHACL
outcome. Later changes reuse the result. The decision for each change
and the limitation text it reports are unchanged: a review that fails
still blocks, and explains, every change it covers.
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