Skip to content

fix: make check optional on doctor group actions - #354

Merged
rubberduck203 merged 1 commit into
mainfrom
fix/153-optional-check-field
Jul 28, 2026
Merged

fix: make check optional on doctor group actions#354
rubberduck203 merged 1 commit into
mainfrom
fix/153-optional-check-field

Conversation

@rubberduck203

Copy link
Copy Markdown
Contributor

Summary

  • check on a ScopeDoctorGroup action is now Option<DoctorCheckSpec> instead of required, so omitting it entirely gives the same "always run the fix" behavior as the existing check: {} workaround — matching what the docs already claimed.
  • Both maintainers agreed on this exact direction in the issue thread; this just implements it.
  • Regenerated the JSON schemas (check dropped from required); docs/static/schema is a symlink to schema/ so the docs site picks this up automatically.

Backward compatibility

check: {} continues to behave identically — it still deserializes to the same DoctorCheckSpec { paths: None, commands: None } internally, and parse_action's unwrap_or_default() produces the same value whether check was omitted or explicitly empty. Pinned by a new unit test (omitted_check_and_empty_check_parse_identically) and confirmed by the existing run-always-required fixture/integration test, which still uses check: {} and passes unmodified.

Test plan

  • cargo build
  • cargo fmt --check
  • cargo clippy --all-targets
  • cargo test (249 tests, including a new unit test pinning check: {} vs omitted-check equivalence, and an integration-test fixture now exercising the omitted-check path end-to-end)
  • Manual smoke test of the exact MVCE from Correct way to create a fix that always runs? #153 (action with no check key) against the built binary
  • Independent QA pass (tests/lints/coverage/mutation testing via gusto-rust:rust-review) plus a workflow-backed adversarial code review — no unresolved findings

Closes #153

`check` is now `Option<DoctorCheckSpec>` instead of required, so
omitting it entirely produces the same "always run the fix" behavior
as the existing `check: {}` workaround, matching what the docs already
claimed. Both maintainers agreed on this direction in #153 but it was
never implemented.

- DoctorCheckSpec now derives Default so parse_action can treat a
  missing check the same as an empty one.
- Regenerated schema/*.json (check dropped from required).
- Added regression coverage: a unit test pinning that check: {} and an
  omitted check parse identically, an integration-test fixture update
  exercising the omitted-check path end-to-end, and example YAML
  updates.

Closes #153
@rubberduck203
rubberduck203 marked this pull request as ready for review July 28, 2026 16:37
@rubberduck203
rubberduck203 requested a review from kejadlen July 28, 2026 17:00
@rubberduck203
rubberduck203 merged commit 08ba5f5 into main Jul 28, 2026
14 checks passed
@rubberduck203
rubberduck203 deleted the fix/153-optional-check-field branch July 28, 2026 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Correct way to create a fix that always runs?

2 participants