fix: refuse headless session activate that would silently drop project lifecycle hooks - #1219
Draft
gominimal-aw-bot[bot] wants to merge 1 commit into
Conversation
A project directory that is not a VCS root has its tree upload skipped on the headless path (--no-prompt, --no-input, or a non-TTY). That upload is the only way the project's minimal.toml reaches the daemon, so the lifecycle hooks it declares were silently discarded while activation still exited 0. Inspect the project's minimal.toml at the resolved upload root before taking the SkipHeadless skip: if it declares lifecycle hooks, bail with a non-zero exit naming how many would be dropped and pointing to --sync tarball or --sync none, rather than proceeding silently. A hook-less project keeps the existing skip-and-warn behaviour.
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
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.
Routing-Key: inbox-route/I_kwDOSUhdos8AAAABMzEkjQ
Run headlessly (
--no-prompt/--no-input/non-TTY) against a project directory that is not a VCS root,min session activateskips the workspace tree upload. That upload is the only path the project'sminimal.tomltakes to the daemon, so the lifecycle hooks it declares were silently dropped and never ran while activation still exited 0 — the sole signal being a generic "skipping file upload" warning that never mentions hooks. This inspectsminimal.tomlat the resolved upload root before that skip and, if it declares lifecycle hooks, fails with a non-zero exit naming how many would be dropped and pointing to--sync tarball(upload them) or--sync none(opt out on purpose). A hook-less project keeps the existing skip-and-warn behaviour.Verification
cargo fmt --all --check --manifest-path target/Cargo.toml — clean
cargo clippy --workspace --locked --manifest-path target/Cargo.toml -- -D warnings — 0 warnings
cargo build --workspace --locked --manifest-path target/Cargo.toml — Finished, ok
cargo test --workspace --locked --manifest-path target/Cargo.toml — all pass (added project_lifecycle_hook_count_detects_declared_hooks)