Add --mode, --track-state flags to aspect delivery#1023
Merged
gregmagolan merged 1 commit intomainfrom Apr 27, 2026
Merged
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: da09e721de
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
thesayyn
approved these changes
Apr 27, 2026
gregmagolan
added a commit
that referenced
this pull request
Apr 27, 2026
When `--mode=force-all --track-state=false` (non-dry-run), `phase_1_2_runs` is False so the existing build_end dispatch at lines 448-449 is skipped. Phase 3 still does a real Bazel build, but no path invokes `bazel_trait.build_end` afterwards. Features registered to that hook — notably `ArtifactUpload` ([feature/artifacts.axl:476](feature/artifacts.axl#L476)) which finalizes testlogs flushing and uploads profile/execlog/BEP — never fire in this mode. Fix: when phase 1/2 was skipped, dispatch build_end with phase 3's status right after `build.wait()`. The phase-1/2-having-run cases already dispatched build_end with their own build_code and are unaffected. Reported by Codex during PR #1023 review. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
746ea40 to
72ed637
Compare
aspect deliveryaspect delivery
36de390 to
eb40724
Compare
eb40724 to
e585aa5
Compare
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
Reshape
aspect deliveryaround three orthogonal flags so it can run in environments without persistent state (local development, non-Aspect-Workflows CI) and supports always-deliver semantics:--mode={selective,always}(defaultselective) —selectiveuses change detection (only runs candidates that haven't already been delivered for the--task-key[:--salt]prefix).alwaysskips change detection and runs every resolved target — closest analogue to the legacyonly_on_change: falserule attribute. Useful for use cases where you want to deliver every target on every commit.--track-state={true,false}(defaulttrue) — opt out of recording/querying delivery state across runs. Requiredfalsefor environments where the state backend isn't available.--dry-run(existing) is now strictly orthogonal to--mode— composes with both.The current state backend is
deliveryd. The flag is named--track-staterather than--deliverydso the public API doesn't leak the service name;deliverydcontinues to be referenced internally where it's an accurate implementation detail.Rejected combination
--mode=selective --track-state=falseis rejected at startup: change detection cannot decide what to deliver without persisted state. The error message points users to--mode=always.Best-effort preview
--mode=always --dry-run --track-state=falseis the only combination tolerant of a missing remote cache:NOTE:and falls back to listing candidates without digests; everything else still works.Every other mode still hard-errors on missing remote cache because they need digests for correctness (recording or change-detection decisions).
Combination matrix
--mode=selective(default)--mode=selective --dry-run--mode=selective --track-state=false--mode=always--mode=always --dry-run--mode=always --track-state=false--mode=always --dry-run --track-state=falsePhase 3 is the same code path across all modes (same
bazel buildcall, same flags). What differs is what's already in any configured remote cache going in — when phase 1/2 ran first, phase 3 typically downloads its outputs; when phase 1/2 was skipped, phase 3 may build more from source / local cache, or hit cache from prior unrelated jobs.Why
--mode=alwaysrecords by defaultWhen state tracking is enabled,
--mode=alwaysrecords the digests and deliveries it produces. A subsequent--mode=selectiverun sees those digests in its change-detection check and skips them — usually what you want from a backfill. Pass--track-state=falseif you specifically want--mode=alwaysto skip recording.Hook dispatch
bazel_trait.build_endhooks fire once per invocation, with the relevant build's exit code: phase 1/2 status when phase 1/2 ran, phase 3 status when only phase 3 ran (--mode=always --track-state=false). Features registered to that hook (e.g.,ArtifactUpload's testlogs flush + profile/execlog/BEP upload) work in all modes.Documentation
delivery.axlis rewritten as the public-facing reference: pipeline phases, flag set, combination matrix, failure modes, and design rationale. User-facing prose uses "change detection" to describe the what; implementation comments retainaction_digest/deduplication prefixterminology where they describe the how.docs.aspect.build/cli/migration/delivery(in the docs repo).