Skip to content

fix(roadmap): format changed Python files in the job - #2791

Merged
dan-petty merged 6 commits into
mainfrom
fix/2789-job-formats-changed-files
Oct 30, 2026
Merged

dan-petty merged 6 commits into
mainfrom
fix/2789-job-formats-changed-files

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

The implement step stops when ruff format --check fails, and the job then discards correct work. Job devops-cli-runner-20261030-165513-98d9 on #2656 stopped for one long raise line.

The job now runs uv run ruff format on the changed Python files, outside the shell of the agent. It stages the files that the formatter changed. It prints one line, Formatted: <paths>, to the error stream. A formatter that fails stops the step with its output. The ruff format --check row of the static checks is gone. ruff check still fixes nothing.

The format run writes files, so it has two guards:

  • The job gives the file names to ruff format, ruff check and mypy --strict after --. A name that starts with - is a path, not an option.
  • The step stops before the format run when a changed Python file is a symbolic link. ruff writes through a link, also to a file outside the checkout.

The prompt of the step says that the job formats the changed Python files. The change adds one requirement to roadmap-implement-step.

Closes #2789

@dan-petty dan-petty added type/bug Type bug: the code does not do what it must scope/roadmap The roadmap jobs: intake, refine, stage, implement and the Service that runs them labels Oct 30, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Test results and review notes.

Fail-to-pass run: uv run devops ci fail-to-pass --base origin/main. 14 tests failed on the base and pass on the branch (117 other tests passed on both). The new tests are in tests/test_roadmap_implement_step_format.py.

Full uv run devops ci: all checks pass. The test check took 226 s (3m 46s). The whole run took 3m 55s.

Review findings:

  • Major, symbolic link: fixed. The step stops before the format run when a changed Python file is a link. A test makes src/link.py a link to a file outside the checkout. It asserts that the target stays as it was and that no formatter runs. I used Path.is_symlink and not the git mode, because it is one call and it needs no parser.
  • Minor, no -- before file names: fixed. ruff format, ruff check and mypy --strict get -- before the names. A test uses the file name --config=exclude.py and checks the argv of all three tools. I checked that mypy --strict -- <file> and ruff check -- <file> run as before.

No finding was declined.

@dan-petty
dan-petty marked this pull request as ready for review October 30, 2026 18:03
@dan-petty
dan-petty merged commit 18a6e2b into main Oct 30, 2026
19 checks passed
@dan-petty
dan-petty deleted the fix/2789-job-formats-changed-files branch October 30, 2026 18:04
dan-petty pushed a commit that referenced this pull request Oct 30, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.22.6](v0.22.5...v0.22.6)
(2026-10-30)


### Bug Fixes

* **roadmap:** format changed Python files in the job
([#2791](#2791))
([18a6e2b](18a6e2b)),
closes [#2789](#2789)
* **roadmap:** the job owns tasks.md in an implement step
([#2792](#2792))
([2e9552f](2e9552f)),
closes [#2790](#2790)

---
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/roadmap The roadmap jobs: intake, refine, stage, implement and the Service that runs them 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(roadmap): an implement step stops on ruff format, which the job can apply itself

1 participant