Skip to content

fix(openspec): list the gate commands in a dry run of check - #4936

Merged
dan-petty merged 4 commits into
mainfrom
fix/4272-openspec-check-dry-run-plan
Nov 12, 2026
Merged

dan-petty merged 4 commits into
mainfrom
fix/4272-openspec-check-dry-run-plan

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

In a dry run, devops openspec check read the empty output of a planned process as the change list of the tool, printed not JSON and exited 1. The command now prints the plan of the gate commands, each with the variables that the run sets, says that it would run the gate, starts no process and exits 0. The real run and the plan take the arguments of each command from one place, so the plan cannot differ from the real run.

Closes #4272

Change: openspec/changes/archive/2026-11-12-4272-openspec-check-dry-run-plan/

In a dry run, devops openspec check read the empty output of a planned process as the change list of the tool and failed with not JSON. The command now prints the plan of the gate commands and starts no process. The real run and the plan take each command from one place.
@dan-petty dan-petty added type/bug Type bug: the code does not do what it must scope/openspec OpenSpec changes, specs and their checks labels Nov 12, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Test record

Local checks on the final code (rebased on origin/main at cbdce63f6):

  • uv run devops ci --check --only lint,format,docs,constructs,openspec,test-settings,test-tree,startup-imports,swallowed-failures: all rows pass.
  • uv run devops ci test tests/openspec tests/core/test_openspec_command.py tests/commands/test_openspec_scaffold.py tests/commands/test_config_workspace_docs_dry_run.py tests/roadmap/test_roadmap_plan_check.py: 135 passed.
  • uv run devops ci test tests/openspec/test_openspec_gate.py tests/core/test_openspec_command.py tests/invariants/test_dry_run_class_ratchet.py: 39 passed.
  • uv run mypy on the six changed source files: no issues.
  • uv run devops docs generate --check: all documents are up to date. No document changes.

Fail-to-pass

uv run devops ci fail-to-pass --base origin/main (exit 0, run before the archive commit and the last rebase; the source and tests of the change did not change after it):

  failed on base: tests.openspec.test_openspec_gate::test_the_plan_is_the_commands_the_gate_runs (AttributeError: module 'devops_cli.openspec.gate' has no attribute 'plan_check')
  failed on base: tests.openspec.test_openspec_gate::test_check_in_dry_run_lists_the_commands (assert 1 == 0)
2 failed on base (2 failed and 20 passed in tests/openspec/test_openspec_gate.py; 0 errored).

The other 20 tests of tests/openspec/test_openspec_gate.py pass on base and on the head.

Command proof

uv run devops --dry-run openspec check on the head exits 0, starts no process and prints 15 planned commands. First and last lines:

devops openspec check
  1. DO_NOT_TRACK=1 OPENSPEC_TELEMETRY=0 OPENSPEC_NO_UPDATE_CHECK=1 OPEN_SPEC_INTERACTIVE=0 XDG_CONFIG_HOME='<config-home>' openspec config set telemetry.enabled false
 15. DO_NOT_TRACK=1 OPENSPEC_TELEMETRY=0 OPENSPEC_NO_UPDATE_CHECK=1 OPEN_SPEC_INTERACTIVE=0 XDG_CONFIG_HOME='<config-home>' openspec show '<change>' --json --deltas-only  [repeated for each active change]
Would run the OpenSpec gate. The commands above are not run.

On main the same command prints openspec list --json failed with exit code 0: not JSON: and exits 1.

No live step is necessary.

@dan-petty
dan-petty marked this pull request as ready for review November 12, 2026 05:33
@dan-petty
dan-petty merged commit cc19a87 into main Nov 12, 2026
23 checks passed
@dan-petty
dan-petty deleted the fix/4272-openspec-check-dry-run-plan branch November 12, 2026 05:33
dan-petty pushed a commit that referenced this pull request Nov 12, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.116.2](v0.116.1...v0.116.2)
(2026-11-12)


### Bug Fixes

* **openspec:** list the gate commands in a dry run of check
([#4936](#4936))
([cc19a87](cc19a87))


### Performance Improvements

* **ci:** move the four path checks into filtered workflows
([#4935](#4935))
([ed84240](ed84240))

---
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/openspec OpenSpec changes, specs and their checks type/bug Type bug: the code does not do what it must

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(openspec): check fails in dry run with not JSON

1 participant