Repository navigation
refactor(cli): entry.main sets a dry-run state that is set again - #4286
Merged
Merged
Conversation
Closes #3910 The entry point dispatcher called set_dry_run(True) when --dry-run was present in argv, which set _ACTIVATED_HERE = True. This caused dry_run_requested_by_environment() in main.py to evaluate to False and clear an exported DEVOPS_CLI_DRY_RUN when running a command with its own --dry-run flag. Removing set_dry_run(True) and its import from entry.py ensures the canonical dry-run state is managed solely by the root callback while preserving the dry-run invocation mark for exit telemetry. Change: openspec/changes/archive/2026-11-09-3910-entry-main-sets-a-dry-run/
Owner
Author
Check resultsHead commit:
Skipped check: Plan Check Implemented by Agent pair-programming session. |
dan-petty
marked this pull request as ready for review
November 9, 2026 23:20
dan-petty
pushed a commit
that referenced
this pull request
Nov 9, 2026
🤖 I have created a release *beep* *boop* --- ## [0.103.1](v0.103.0...v0.103.1) (2026-11-09) ### Bug Fixes * **roadmap:** keep the trace facts of a plan in its record ([#4285](#4285)) ([cb2287e](cb2287e)) ### Code Refactoring * **ai:** remove unreachable partial status of harness ([#4287](#4287)) ([a4ea0c2](a4ea0c2)) * **cli:** entry.main sets a dry-run state that is set again ([#4286](#4286)) ([f0d3eaa](f0d3eaa)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.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.
Issue #3910 fixes a defect found while migrating root module tests in #3901 (item 3 of #1333).
entry.maincallsset_dry_run(True)when the argument vector contains--dry-run. The root callbackmaininsrc/devops_cli/main.pysets the dry-run state again before a command runs. The call inentry.mainsets_ACTIVATED_HERE = True. This causesdry_run_requested_by_environment()to returnFalse. When an exportedDEVOPS_CLI_DRY_RUNvariable meets a command that has its own--dry-runflag, the root callback clears the exported variable. This drops the dry-run request that the caller exported. Runs that stop before the root callback do not readis_dry_run(). Telemetry export readsin_dry_run_invocation(), whichmark_dry_run_invocationalready sets.Closes #3910
Change:
openspec/changes/archive/2026-11-09-3910-entry-main-sets-a-dry-run/