Skip to content

Format the superseded-runs guard the way the hook does - #11348

Merged
danielhanchen merged 1 commit into
mainfrom
ci/format-superseded-runs-test
Sep 20, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
ci/format-superseded-runs-test

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

main is not a fixed point of its own formatter, so two checks are red on every pull request that merges with it.

#11345 landed tests/studio/test_pull_requests_cancel_superseded_runs.py with one assert that the ruff-format-with-kwargs hook rewrites:

-    assert "runner-pool-probe.yml" in scanned, "the workflow that motivated this guard left the scan"
+    assert (
+        "runner-pool-probe.yml" in scanned
+    ), "the workflow that motivated this guard left the scan"

That shows up twice, neither time on the PR that caused it:

  • tests/test_formatter_fixed_point.py::test_every_tracked_python_file_is_already_formatted fails in the Repo tests (CPU, rest) shard, naming the file and the command to fix it. The guard did its job.
  • pre-commit.ci - pr fails on every pull request, because pre-commit.ci runs the hook over all files and reports "files were modified by this hook". There is nothing to autofix onto the contributor's branch, so the check stays red with no way for them to clear it.

I ran the hook over the file with the ruff the hook pins itself (0.6.9, from its additional_dependencies) and committed exactly what it produced.

Checks

  • tests/test_formatter_fixed_point.py: 1 failed / 10 passed before, 11 passed after. Restoring the file from main fails it again, naming the same file.
  • tests/studio/test_pull_requests_cancel_superseded_runs.py: 8 passed, so the reformatted assert still tests what it did.
  • pre-commit run --all-files with the pinned environment: all three hooks pass.

#11345 landed tests/studio/test_pull_requests_cancel_superseded_runs.py with one
assert the ruff-format-with-kwargs hook rewrites, so main is not a fixed point
of its own formatter. That fails tests/test_formatter_fixed_point.py, which is
in the "Repo tests (CPU, rest)" shard, and it fails pre-commit.ci on every pull
request, since pre-commit.ci runs the hook over all files and reports that it
modified one. Neither failure has anything to do with the pull request that
sees it.

Ran the hook over the file with the pinned ruff (0.6.9, from the hook's own
additional_dependencies) and committed what it produced. The file's own eight
tests still pass, tests/test_formatter_fixed_point.py goes from 1 failed / 10
passed to 11 passed, and pre-commit run --all-files passes all three hooks.
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 20, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-20T02:08:07.966410Z 3458ef8 Manual request
🔒 Security Review ✅ Completed 2026-09-20T02:09:10.519583Z 3458ef8 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 3458ef85f7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen
danielhanchen merged commit 353e38d into main Sep 20, 2026
30 checks passed
@danielhanchen
danielhanchen deleted the ci/format-superseded-runs-test branch September 20, 2026 02:27
shaojun pushed a commit to shaojun/unsloth that referenced this pull request Sep 29, 2026
unslothai#11345 landed tests/studio/test_pull_requests_cancel_superseded_runs.py with one
assert the ruff-format-with-kwargs hook rewrites, so main is not a fixed point
of its own formatter. That fails tests/test_formatter_fixed_point.py, which is
in the "Repo tests (CPU, rest)" shard, and it fails pre-commit.ci on every pull
request, since pre-commit.ci runs the hook over all files and reports that it
modified one. Neither failure has anything to do with the pull request that
sees it.

Ran the hook over the file with the pinned ruff (0.6.9, from the hook's own
additional_dependencies) and committed what it produced. The file's own eight
tests still pass, tests/test_formatter_fixed_point.py goes from 1 failed / 10
passed to 11 passed, and pre-commit run --all-files passes all three hooks.
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.

1 participant