feat(release): carry upload-rule ids on domain Release#101
Merged
Conversation
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The get-release service used unwrap_or_default() on the upload_rules expansion, silently caching an empty upload_rule_ids set when the backend omitted the expansion. Because get caches with Overwrite::Allow into the same release store that sync reads with write_if_absent, a single missing-expansion fetch poisoned the store permanently. Mirror the sync path: hard-error via the new ServiceErr::UploadRulesNotExpanded (keyed on release_id) so the contract violation is loud and never cached. An empty but present expansion still yields empty ids. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add a From<UploadRulesNotExpandedErr> for ServiceErr conversion test to restore the services module coverage gate (was 94.47%, requires 95.01%). Also apply cargo fmt to the release get fallback assertion. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Releasenow carriesupload_rule_ids: Vec<UploadRuleID>, populated from the server-sideupload_rulesexpansion.From<backend_client::Release>is replaced with aRelease::from_backend(release, upload_rule_ids)constructor, threaded through deserialize via#[serde(default)].api/specs/backend/v04.yamlfrom openapimainto pick up the newgetReleaseexpandparam (openapi #167) and regenerates models, adding aReleaseExpansionmodel.fetch_releasepasses&["upload_rules"]) and projects the expanded rule ids onto theRelease. If the backend fails to expand, it hard-errors (ServiceErr::UploadRulesNotExpanded) rather than silently caching an empty set that would poison the shared release store — mirroring the deployment-sync path.store_expanded_release) links the ids onto the storedRelease, while still writing full rule bodies into the separate append-onlyupload_rulesstore.Split out of the in-progress uploads branch (#93) so it can be reviewed and merged independently; this should merge before #93. The uploader-feeding work (active-rule traversal + syncer push) intentionally stays on #93.
Validation:
cargo check --workspaceclean; full test suite green (1349 passing); preflight clean; separate lint gate clean.Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.