Skip to content

chore(deps): sync ruff 0.16.0 pins - #2812

Closed
stranske wants to merge 5 commits into
mainfrom
codex/sync-ruff-v0-16
Closed

chore(deps): sync ruff 0.16.0 pins#2812
stranske wants to merge 5 commits into
mainfrom
codex/sync-ruff-v0-16

Conversation

@stranske

@stranske stranske commented Jul 23, 2026

Copy link
Copy Markdown
Owner

Updates the canonical Ruff pin together with Workflows development metadata, lockfile, and consumer/integration template environments. This replaces partial consumer-only Ruff updates.\n\nValidation:\n- python scripts/sync_tool_versions.py --check\n- python scripts/validate_version_pins.py\n- pytest -q tests/scripts/test_sync_tool_versions.py tests/scripts/test_validate_version_pins.py

Summary by CodeRabbit

  • Chores
    • Updated the Ruff development tool pin to 0.16.0 across tooling and templates.
  • CI
    • Adjusted the Python CI Ruff lint step to run only the legacy rule families (E4, E7, E9, F) to avoid unintended lint expansion.
  • Documentation
    • Added a note clarifying the shared Ruff default rule-family pin (E4,E7,E9,F) for downstream validation.
  • Tests
    • Strengthened workflow coverage to ensure the legacy Ruff rule-family selector is consistently applied during CI and autofix pipeline runs.

@cursor

cursor Bot commented Jul 23, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@stranske
stranske temporarily deployed to agent-high-privilege July 23, 2026 22:34 — with GitHub Actions Inactive
@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: e80d8ad5-cc37-4fba-ae46-6251086d262a

📥 Commits

Reviewing files that changed from the base of the PR and between 56a988e and 076834d.

📒 Files selected for processing (1)
  • langsmith-fleet-worker-attempt.json

📝 Walkthrough

Walkthrough

Ruff is upgraded from 0.15.22 to 0.16.0 across development and workflow pins. Reusable CI explicitly selects E4, E7, E9, and F, with documentation and workflow tests updated accordingly.

Changes

Ruff maintenance

Layer / File(s) Summary
Update Ruff version pins
.github/workflows/autofix-versions.env, pyproject.toml, templates/*/.github/workflows/autofix-versions.env
Development dependencies and workflow environment files now pin Ruff to 0.16.0.
Pin CI lint rule selection
.github/workflows/reusable-10-ci-python.yml, docs/ci/TOOL_VERSION_MANAGEMENT.md
The reusable Ruff lint step selects E4, E7, E9, and F, and the documentation records this rule-family default.
Align workflow tests
tests/workflows/test_autofix_*.py, tests/workflows/test_reusable_ci_workflow.py
Autofix tests configure the selected Ruff rules, re-run Black after type-hygiene changes, and verify the reusable workflow command.
Update attempt metadata
langsmith-fleet-worker-attempt.json
The attempt record updates its emission timestamp and pull request number.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested labels: dependencies, maintenance, github:actions

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: syncing Ruff pins to version 0.16.0.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/sync-ruff-v0-16

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@templates/consumer-repo/.github/workflows/autofix-versions.env`:
- Line 8: Revert the RUFF_VERSION change in the repo-specific
autofix-versions.env template to the shared Ruff pin. Only retain 0.16.0 if this
consumer repository uniquely requires it and the exception is documented
according to the path instructions.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 7d22e803-660d-455e-94e0-12bec8e43b20

📥 Commits

Reviewing files that changed from the base of the PR and between 5b0a40b and d293cf1.

⛔ Files ignored due to path filters (1)
  • requirements.lock is excluded by !**/*.lock, !**/*.lock
📒 Files selected for processing (4)
  • .github/workflows/autofix-versions.env
  • pyproject.toml
  • templates/consumer-repo/.github/workflows/autofix-versions.env
  • templates/integration-repo/.github/workflows/autofix-versions.env

# in each consumer repo's pyproject.toml directly, NOT synced from this file.
BLACK_VERSION=26.5.1
RUFF_VERSION=0.15.22
RUFF_VERSION=0.16.0

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Do not update this repo-specific template for the shared Ruff pin.

Revert this line unless 0.16.0 is uniquely required by the consumer repository and that exception is documented. As per path instructions, “Keep autofix-versions.env as repo-specific; edit locally only for dependency pins unique to this repository.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@templates/consumer-repo/.github/workflows/autofix-versions.env` at line 8,
Revert the RUFF_VERSION change in the repo-specific autofix-versions.env
template to the shared Ruff pin. Only retain 0.16.0 if this consumer repository
uniquely requires it and the exception is documented according to the path
instructions.

Source: Path instructions

@stranske-keepalive

stranske-keepalive Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Automated Status Summary

Head SHA: 00c6734
Latest Runs: ⏳ pending — Gate
Required contexts: Gate / gate, Health 45 Agents Guard / guard
Required: core tests (3.12): ⏳ pending, core tests (3.13): ⏳ pending, docker smoke: ⏳ pending, gate: ⏳ pending

Workflow / Job Result Logs
(no jobs reported) ⏳ pending

Coverage Overview

  • Coverage history entries: 1

Coverage Trend

Metric Value
Current 75.90%
Baseline 85.00%
Delta -9.10%
Minimum 70.00%
Status ✅ Pass

Top Coverage Hotspots (lowest coverage)

File Coverage Missing
scripts/issue_dedup_smoke.py 0.0% 4
scripts/runner_lib/__main__.py 0.0% 3
scripts/validate_template_sync.py 0.0% 81
scripts/langchain/topic_splitter.py 19.1% 57
tools/codex_log_analyzer.py 19.6% 140
scripts/repo_review_round2_runner.py 25.1% 344
scripts/prune_agent_stubs.py 39.7% 26
scripts/repo_review_round1_runner.py 40.7% 133
tools/ensure_workflow_timeout_variables.py 42.1% 74
scripts/sync_label_docs.py 42.9% 64
tools/discover_model_catalog.py 44.8% 55
scripts/repo_review_backlog_scan.py 45.3% 116
scripts/repo_review_body_writer.py 46.5% 86
tools/codex_session_analyzer.py 47.9% 59
scripts/create_verifier_labels.py 48.3% 58

Low Coverage Files (<50.0%)

File Coverage Missing
scripts/issue_dedup_smoke.py 0.0% 4
scripts/runner_lib/__main__.py 0.0% 3
scripts/validate_template_sync.py 0.0% 81
scripts/langchain/topic_splitter.py 19.1% 57
tools/codex_log_analyzer.py 19.6% 140
scripts/repo_review_round2_runner.py 25.1% 344
scripts/prune_agent_stubs.py 39.7% 26
scripts/repo_review_round1_runner.py 40.7% 133
tools/ensure_workflow_timeout_variables.py 42.1% 74
scripts/sync_label_docs.py 42.9% 64
tools/discover_model_catalog.py 44.8% 55
scripts/repo_review_backlog_scan.py 45.3% 116
scripts/repo_review_body_writer.py 46.5% 86
tools/codex_session_analyzer.py 47.9% 59
scripts/create_verifier_labels.py 48.3% 58

Updated automatically; will refresh on subsequent CI/Docker completions.


Keepalive checklist

Scope

No scope information available

Tasks

  • No tasks defined

Acceptance criteria

  • No acceptance criteria defined

@stranske
stranske temporarily deployed to agent-high-privilege July 26, 2026 22:29 — with GitHub Actions Inactive
@stranske
stranske temporarily deployed to agent-high-privilege July 27, 2026 00:30 — with GitHub Actions Inactive

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/reusable-10-ci-python.yml:
- Around line 1091-1094: Update the Ruff invocation in the CI workflow so the
legacy E4,E7,E9,F rule family is applied only when the consumer has not declared
a custom tool.ruff.lint.select configuration; otherwise preserve the consumer’s
selection. Keep the existing .workflows-lib exclusion and GitHub output behavior
unchanged.

In `@tests/workflows/test_reusable_ci_workflow.py`:
- Line 135: Update the Ruff command assertion in the relevant workflow test to
compare the complete non-comment command line exactly, including output-format
and exclusion options, rather than checking whether a partial string appears in
ruff_step["run"].
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 5920fb2f-5f3c-4451-bbed-d5a31683a803

📥 Commits

Reviewing files that changed from the base of the PR and between d293cf1 and 1679a3f.

📒 Files selected for processing (5)
  • .github/workflows/reusable-10-ci-python.yml
  • docs/ci/TOOL_VERSION_MANAGEMENT.md
  • tests/workflows/test_autofix_full_pipeline.py
  • tests/workflows/test_autofix_pipeline_diverse.py
  • tests/workflows/test_reusable_ci_workflow.py

Comment on lines +1091 to +1094
# Keep the pre-0.16 default rule family stable for consumers that do
# not declare their own Ruff selection. Exclude .workflows-lib since
# it is synced from the source repo with different Ruff configuration.
ruff check --select E4,E7,E9,F --output-format github --extend-exclude .workflows-lib .

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Locate the workflow and nearby tests/fixtures that mention Ruff selection.
git ls-files '.github/workflows/reusable-10-ci-python.yml' 'templates/consumer-repo/.github/workflows/reusable-10-ci-python.yml' | cat
printf '\n---\n'
rg -n --hidden --glob '!**/.git/**' --glob '!**/node_modules/**' 'ruff check|--select E4,E7,E9,F|tool\.ruff\.lint\.select|ruff selection|pre-0\.16' .github templates test tests . | sed -n '1,220p'

Repository: stranske/Workflows

Length of output: 9656


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect the relevant workflow section and any companion test file around Ruff handling.
python3 - <<'PY'
from pathlib import Path

paths = [
    Path('.github/workflows/reusable-10-ci-python.yml'),
    Path('templates/consumer-repo/.github/workflows/reusable-10-ci-python.yml'),
]
for p in paths:
    if p.exists():
        print(f"\n### {p}\n")
        text = p.read_text().splitlines()
        for i, line in enumerate(text, 1):
            if 'ruff check' in line or '--select E4,E7,E9,F' in line or 'workflows-lib' in line:
                start = max(1, i-8)
                end = min(len(text), i+8)
                for j in range(start, end+1):
                    print(f"{j:4d}: {text[j-1]}")
                print()
PY

Repository: stranske/Workflows

Length of output: 13280


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Search for workflow tests that assert Ruff behavior or consumer-specific selections.
fd -a -t f '.*(test|spec|fixture).*' .github templates test tests . | sed -n '1,200p'

Repository: stranske/Workflows

Length of output: 13687


🌐 Web query:

Ruff CLI --select precedence over pyproject.toml tool.ruff.lint.select configuration command line overrides config

💡 Result:

Yes, Ruff command-line interface (CLI) options take precedence over those defined in pyproject.toml [1][2][3]. When Ruff determines which rules to enforce, it follows a hierarchical resolution strategy: 1. CLI options are given the highest priority [1][2]. 2. The current pyproject.toml (or ruff.toml) file is given the next highest priority [1][2]. 3. Inherited pyproject.toml files have the lowest priority [1][2]. Specifically regarding rule selection, Ruff uses the highest-priority lint.select configuration as the foundation for the rule set [1][3]. Once this basis is established, it then applies any extend-select, ignore, and extend-ignore adjustments [1][2][3]. For example, if your pyproject.toml defines a set of rules via select, providing a different --select flag on the command line will effectively override and reset that selection based on the CLI input, rather than merging with the file-based configuration [2]. Similarly, the --config flag can be used to provide arbitrary TOML-based overrides, which take precedence over all configuration files [4][5][6].

Citations:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Print the surrounding workflow block to see whether the Ruff command is gated.
python3 - <<'PY'
from pathlib import Path
p = Path('.github/workflows/reusable-10-ci-python.yml')
text = p.read_text().splitlines()
for idx, line in enumerate(text, 1):
    if '--select E4,E7,E9,F' in line:
        start = max(1, idx-30)
        end = min(len(text), idx+30)
        for j in range(start, end+1):
            print(f"{j:4d}: {text[j-1]}")
        break
PY

Repository: stranske/Workflows

Length of output: 2951


🌐 Web query:

Ruff command-line options precedence configuration file select ignore extend-select docs

💡 Result:

In Ruff, configuration precedence follows a clear hierarchy. When settings conflict, the following order applies (from highest to lowest priority) [1]: 1. Dedicated command-line flags (e.g., --select, --line-length) [2][3][4] 2. TOML configuration overrides passed via --config (e.g., --config "lint.line-length=100") [2][1][4] 3. Configuration files explicitly specified via --config [2][1] 4. Hierarchically discovered configuration files (pyproject.toml, ruff.toml,.ruff.toml) [2][1] 5. Default settings [1] If multiple configuration files are detected in the same directory, the priority order is.ruff.toml > ruff.toml > pyproject.toml [2][5]. Regarding rule selection (select, ignore, extend-select, extend-ignore), Ruff resolves the final rule set by reconciling these options across all sources [6]. CLI flags, such as --select, take precedence over corresponding settings in configuration files [6][7]. For extending or modifying rule sets, extend-select and extend-ignore are used to add or remove rules relative to the base configuration [8][6]. Because Ruff processes these rules specifically to allow child configurations to override parent ones, extend-select can effectively re-enable rules that were previously ignored [9][10]. When both a dedicated flag (like --select) and a --config override are provided for the same setting, the dedicated flag takes priority [2][4]. The --isolated flag causes Ruff to ignore all configuration files, relying only on defaults and any explicit command-line overrides [2][1].

Citations:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect the reusable CI workflow test and search for any consumer Ruff-selection fixtures.
python3 - <<'PY'
from pathlib import Path

targets = [
    Path('tests/workflows/test_reusable_ci_workflow.py'),
    Path('templates/consumer-repo'),
    Path('.github/workflows/reusable-10-ci-python.yml'),
]
for p in targets:
    if p.is_file():
        print(f"\n### {p}\n")
        text = p.read_text().splitlines()
        for i, line in enumerate(text, 1):
            if 'ruff' in line.lower() or 'select E4,E7,E9,F' in line:
                start = max(1, i-12)
                end = min(len(text), i+20)
                for j in range(start, end+1):
                    print(f"{j:4d}: {text[j-1]}")
                print()
    elif p.is_dir():
        print(f"\n### search in {p}\n")
        import subprocess, shlex
        subprocess.run(["rg", "-n", "tool\\.ruff\\.lint\\.select|ruff\\.lint\\.select|\\bselect\\s*=\\s*\\[|\\bselect\\s*=\\s*\"", str(p)], check=False)
PY

Repository: stranske/Workflows

Length of output: 50374


Preserve consumer Ruff selections. ruff check --select E4,E7,E9,F overrides any tool.ruff.lint.select, so this is not a fallback for repos that define their own selection. Gate the legacy rule family on the absence of consumer config, or make the override explicit and add a fixture for a custom Ruff selection.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/reusable-10-ci-python.yml around lines 1091 - 1094, Update
the Ruff invocation in the CI workflow so the legacy E4,E7,E9,F rule family is
applied only when the consumer has not declared a custom tool.ruff.lint.select
configuration; otherwise preserve the consumer’s selection. Keep the existing
.workflows-lib exclusion and GitHub output behavior unchanged.

Source: Path instructions

steps = workflow["jobs"]["lint-ruff"]["steps"]
ruff_step = next(step for step in steps if step.get("name") == "Ruff (lint)")

assert "ruff check --select E4,E7,E9,F" in ruff_step["run"]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Assert the complete Ruff command, not a substring.

The current assertion could pass if the text appears in a comment or unrelated shell fragment, and it does not protect the output-format or exclusion options. Match the non-comment command line exactly.

Suggested test adjustment
-    assert "ruff check --select E4,E7,E9,F" in ruff_step["run"]
+    commands = [
+        line.strip()
+        for line in ruff_step["run"].splitlines()
+        if line.strip() and not line.lstrip().startswith("#")
+    ]
+    assert (
+        "ruff check --select E4,E7,E9,F --output-format github "
+        "--extend-exclude .workflows-lib ." in commands
+    )
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
assert "ruff check --select E4,E7,E9,F" in ruff_step["run"]
commands = [
line.strip()
for line in ruff_step["run"].splitlines()
if line.strip() and not line.lstrip().startswith("#")
]
assert (
"ruff check --select E4,E7,E9,F --output-format github "
"--extend-exclude .workflows-lib ." in commands
)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/workflows/test_reusable_ci_workflow.py` at line 135, Update the Ruff
command assertion in the relevant workflow test to compare the complete
non-comment command line exactly, including output-format and exclusion options,
rather than checking whether a partial string appears in ruff_step["run"].

@stranske

stranske commented Jul 27, 2026

Copy link
Copy Markdown
Owner Author

Runner dispatch state for autofix on PR #2812. Do not edit.

@agents-workflows-bot
agents-workflows-bot Bot temporarily deployed to agent-high-privilege July 27, 2026 00:38 Inactive
@stranske

Copy link
Copy Markdown
Owner Author

Superseded by #2840, which carries the full shared Ruff 0.16 pin surface and preserves consumer-defined Ruff selections.

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.

2 participants