From 16c0e53ae0979f7acea07a234169d45e34a6a624 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 Jul 2026 04:11:15 +0000 Subject: [PATCH 1/2] deps(pip): update uvicorn requirement in the python-dependencies group Updates the requirements on [uvicorn](https://github.com/Kludex/uvicorn) to permit the latest version. Updates `uvicorn` to 0.50.2 - [Release notes](https://github.com/Kludex/uvicorn/releases) - [Changelog](https://github.com/Kludex/uvicorn/blob/main/docs/release-notes.md) - [Commits](https://github.com/Kludex/uvicorn/compare/0.50.0...0.50.2) --- updated-dependencies: - dependency-name: uvicorn dependency-version: 0.50.2 dependency-type: direct:production dependency-group: python-dependencies ... Signed-off-by: dependabot[bot] --- mount/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mount/requirements.txt b/mount/requirements.txt index 7fd1602f3..857877731 100644 --- a/mount/requirements.txt +++ b/mount/requirements.txt @@ -2,7 +2,7 @@ # Web Framework fastapi>=0.139.0 -uvicorn[standard]>=0.50.0 +uvicorn[standard]>=0.50.2 pydantic>=2.13.4 pydantic-settings>=2.14.2 From 7fa7e796c4a53e46d8d9a9b553596ec01bddd4a8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 7 Jul 2026 04:22:29 +0000 Subject: [PATCH 2/2] style: apply automated autofixes (ruff / prettier / clang-format) [CodeQL Advanced] --- .github/DEFAULT_GITHUB_AUTOMATION.md | 8 +- .../check-auto-merge-eligibility/action.yml | 196 +++++++++--------- aria-bot/aria_bot/analyzer.py | 6 +- aria-bot/aria_bot/from collections.py | 3 +- tests/test_auto_fix_workflow.py | 4 +- tests/test_auto_merge_workflow.py | 125 +++-------- 6 files changed, 138 insertions(+), 204 deletions(-) diff --git a/.github/DEFAULT_GITHUB_AUTOMATION.md b/.github/DEFAULT_GITHUB_AUTOMATION.md index fb300a878..058a6fb84 100644 --- a/.github/DEFAULT_GITHUB_AUTOMATION.md +++ b/.github/DEFAULT_GITHUB_AUTOMATION.md @@ -37,10 +37,10 @@ This repository uses a default GitHub automation baseline for quality, safety, a - Bot-authored PRs can be automatically approved when `AUTO_MERGE_BOT_APPROVE=true` (repository variable) and `AUTO_MERGE_APPROVE_TOKEN` (PAT secret) are configured. - Required labels (create manually or via the CLI): - ```bash - gh label create auto-merge --color 0075ca --description "Squash-merge when all CI gates pass" - gh label create autofix --color e4e669 --description "Auto-merge for automated fix PRs" - ``` + ```bash + gh label create auto-merge --color 0075ca --description "Squash-merge when all CI gates pass" + gh label create autofix --color e4e669 --description "Auto-merge for automated fix PRs" + ``` - Human-authored PRs always require at least one human approval regardless of labels. 9. **Dependabot auto-merge** diff --git a/.github/actions/check-auto-merge-eligibility/action.yml b/.github/actions/check-auto-merge-eligibility/action.yml index 32e66ede8..cff1717ef 100644 --- a/.github/actions/check-auto-merge-eligibility/action.yml +++ b/.github/actions/check-auto-merge-eligibility/action.yml @@ -1,118 +1,118 @@ name: Check Auto-Merge Eligibility description: > - Validates all eligibility criteria for automatic PR merging and outputs - whether the PR is eligible together with a human-readable reason. - Checks: not draft, targets main, not a fork, has auto-merge/autofix label, - not blocked/conflicted, no CHANGES_REQUESTED reviews, has an APPROVED review. + Validates all eligibility criteria for automatic PR merging and outputs + whether the PR is eligible together with a human-readable reason. + Checks: not draft, targets main, not a fork, has auto-merge/autofix label, + not blocked/conflicted, no CHANGES_REQUESTED reviews, has an APPROVED review. inputs: - pr-number: - description: Pull request number to evaluate - required: true - github-token: - description: > - GitHub token with pull-requests:read and checks:read scope. - Defaults to the built-in GITHUB_TOKEN. - required: false - default: ${{ github.token }} + pr-number: + description: Pull request number to evaluate + required: true + github-token: + description: > + GitHub token with pull-requests:read and checks:read scope. + Defaults to the built-in GITHUB_TOKEN. + required: false + default: ${{ github.token }} outputs: - eligible: - description: "'true' if the PR meets all auto-merge criteria, 'false' otherwise" - value: ${{ steps.check.outputs.eligible }} - reason: - description: > - Human-readable explanation of the eligibility decision. - When eligible=true this is a success message; otherwise it lists failures. - value: ${{ steps.check.outputs.reason }} + eligible: + description: "'true' if the PR meets all auto-merge criteria, 'false' otherwise" + value: ${{ steps.check.outputs.eligible }} + reason: + description: > + Human-readable explanation of the eligibility decision. + When eligible=true this is a success message; otherwise it lists failures. + value: ${{ steps.check.outputs.reason }} runs: - using: composite - steps: - - name: Evaluate PR eligibility - id: check - shell: bash - env: - GH_TOKEN: ${{ inputs.github-token }} - PR_NUMBER: ${{ inputs.pr-number }} - run: | - set -euo pipefail + using: composite + steps: + - name: Evaluate PR eligibility + id: check + shell: bash + env: + GH_TOKEN: ${{ inputs.github-token }} + PR_NUMBER: ${{ inputs.pr-number }} + run: | + set -euo pipefail - # --------------------------------------------------------------------------- - # Fetch PR metadata via the GitHub CLI. - # --------------------------------------------------------------------------- - pr_json="$(gh pr view "$PR_NUMBER" \ - --json number,isDraft,baseRefName,headRepository,labels,mergeStateStatus,reviewDecision,state \ - 2>&1)" || { - # Sanitize raw gh output: strip ANSI escape codes, keep first line, - # truncate using bash substring (character-aware, avoids splitting - # multi-byte UTF-8 sequences that cut -c can mishandle on some systems). - first_line="$(printf '%s' "${pr_json}" | head -n1 | sed 's/\x1b\[[0-9;]*m//g')" - sanitized="${first_line:0:120}" - echo "eligible=false" >> "$GITHUB_OUTPUT" - printf 'reason=Failed to fetch PR data: %s\n' "${sanitized}" >> "$GITHUB_OUTPUT" - exit 0 - } + # --------------------------------------------------------------------------- + # Fetch PR metadata via the GitHub CLI. + # --------------------------------------------------------------------------- + pr_json="$(gh pr view "$PR_NUMBER" \ + --json number,isDraft,baseRefName,headRepository,labels,mergeStateStatus,reviewDecision,state \ + 2>&1)" || { + # Sanitize raw gh output: strip ANSI escape codes, keep first line, + # truncate using bash substring (character-aware, avoids splitting + # multi-byte UTF-8 sequences that cut -c can mishandle on some systems). + first_line="$(printf '%s' "${pr_json}" | head -n1 | sed 's/\x1b\[[0-9;]*m//g')" + sanitized="${first_line:0:120}" + echo "eligible=false" >> "$GITHUB_OUTPUT" + printf 'reason=Failed to fetch PR data: %s\n' "${sanitized}" >> "$GITHUB_OUTPUT" + exit 0 + } - # --------------------------------------------------------------------------- - # Extract fields via jq. - # --------------------------------------------------------------------------- - is_draft="$(jq -r '.isDraft' <<< "$pr_json")" - base_ref="$(jq -r '.baseRefName' <<< "$pr_json")" - head_repo="$(jq -r '.headRepository.nameWithOwner // empty' <<< "$pr_json")" - pr_state="$(jq -r '.state' <<< "$pr_json")" - merge_state="$(jq -r '.mergeStateStatus // empty' <<< "$pr_json")" - review_decision="$(jq -r '.reviewDecision // empty' <<< "$pr_json")" - has_label="$(jq -r ' - [.labels[].name] | any(. == "auto-merge" or . == "autofix") - ' <<< "$pr_json")" + # --------------------------------------------------------------------------- + # Extract fields via jq. + # --------------------------------------------------------------------------- + is_draft="$(jq -r '.isDraft' <<< "$pr_json")" + base_ref="$(jq -r '.baseRefName' <<< "$pr_json")" + head_repo="$(jq -r '.headRepository.nameWithOwner // empty' <<< "$pr_json")" + pr_state="$(jq -r '.state' <<< "$pr_json")" + merge_state="$(jq -r '.mergeStateStatus // empty' <<< "$pr_json")" + review_decision="$(jq -r '.reviewDecision // empty' <<< "$pr_json")" + has_label="$(jq -r ' + [.labels[].name] | any(. == "auto-merge" or . == "autofix") + ' <<< "$pr_json")" - current_repo="${GITHUB_REPOSITORY:-}" + current_repo="${GITHUB_REPOSITORY:-}" - # --------------------------------------------------------------------------- - # Accumulate failures. - # --------------------------------------------------------------------------- - FAILURES=() + # --------------------------------------------------------------------------- + # Accumulate failures. + # --------------------------------------------------------------------------- + FAILURES=() - [[ "$pr_state" != "OPEN" ]] && \ - FAILURES+=("PR state is '${pr_state}' (requires OPEN)") + [[ "$pr_state" != "OPEN" ]] && \ + FAILURES+=("PR state is '${pr_state}' (requires OPEN)") - [[ "$is_draft" == "true" ]] && \ - FAILURES+=("PR is a draft") + [[ "$is_draft" == "true" ]] && \ + FAILURES+=("PR is a draft") - [[ "$base_ref" != "main" ]] && \ - FAILURES+=("base branch is '${base_ref}' (requires 'main')") + [[ "$base_ref" != "main" ]] && \ + FAILURES+=("base branch is '${base_ref}' (requires 'main')") - if [[ -n "$current_repo" && -n "$head_repo" && "$head_repo" != "$current_repo" ]]; then - FAILURES+=("PR is from a fork (${head_repo}); fork PRs are not eligible") - fi + if [[ -n "$current_repo" && -n "$head_repo" && "$head_repo" != "$current_repo" ]]; then + FAILURES+=("PR is from a fork (${head_repo}); fork PRs are not eligible") + fi - [[ "$has_label" != "true" ]] && \ - FAILURES+=("missing 'auto-merge' or 'autofix' label") + [[ "$has_label" != "true" ]] && \ + FAILURES+=("missing 'auto-merge' or 'autofix' label") - case "$merge_state" in - DIRTY) FAILURES+=("merge conflicts detected (mergeStateStatus=DIRTY)") ;; - BEHIND) FAILURES+=("branch is behind base branch (mergeStateStatus=BEHIND)") ;; - BLOCKED) FAILURES+=("merge is blocked by required status checks (mergeStateStatus=BLOCKED)") ;; - esac + case "$merge_state" in + DIRTY) FAILURES+=("merge conflicts detected (mergeStateStatus=DIRTY)") ;; + BEHIND) FAILURES+=("branch is behind base branch (mergeStateStatus=BEHIND)") ;; + BLOCKED) FAILURES+=("merge is blocked by required status checks (mergeStateStatus=BLOCKED)") ;; + esac - if [[ "$review_decision" == "CHANGES_REQUESTED" ]]; then - FAILURES+=("has CHANGES_REQUESTED review") - elif [[ "$review_decision" != "APPROVED" ]]; then - FAILURES+=("awaiting required approval (reviewDecision='${review_decision}')") - fi + if [[ "$review_decision" == "CHANGES_REQUESTED" ]]; then + FAILURES+=("has CHANGES_REQUESTED review") + elif [[ "$review_decision" != "APPROVED" ]]; then + FAILURES+=("awaiting required approval (reviewDecision='${review_decision}')") + fi - # --------------------------------------------------------------------------- - # Emit outputs. - # --------------------------------------------------------------------------- - if (( ${#FAILURES[@]} == 0 )); then - echo "eligible=true" >> "$GITHUB_OUTPUT" - echo "reason=All eligibility checks passed." >> "$GITHUB_OUTPUT" - echo "✅ PR #${PR_NUMBER} is eligible for auto-merge." - else - echo "eligible=false" >> "$GITHUB_OUTPUT" - joined="$(printf '%s; ' "${FAILURES[@]}")" - joined="${joined%; }" # trim trailing '; ' - printf 'reason=%s\n' "${joined}" >> "$GITHUB_OUTPUT" - echo "❌ PR #${PR_NUMBER} is NOT eligible: ${joined}" - fi + # --------------------------------------------------------------------------- + # Emit outputs. + # --------------------------------------------------------------------------- + if (( ${#FAILURES[@]} == 0 )); then + echo "eligible=true" >> "$GITHUB_OUTPUT" + echo "reason=All eligibility checks passed." >> "$GITHUB_OUTPUT" + echo "✅ PR #${PR_NUMBER} is eligible for auto-merge." + else + echo "eligible=false" >> "$GITHUB_OUTPUT" + joined="$(printf '%s; ' "${FAILURES[@]}")" + joined="${joined%; }" # trim trailing '; ' + printf 'reason=%s\n' "${joined}" >> "$GITHUB_OUTPUT" + echo "❌ PR #${PR_NUMBER} is NOT eligible: ${joined}" + fi diff --git a/aria-bot/aria_bot/analyzer.py b/aria-bot/aria_bot/analyzer.py index 106b12816..d5b2cee75 100644 --- a/aria-bot/aria_bot/analyzer.py +++ b/aria-bot/aria_bot/analyzer.py @@ -207,11 +207,7 @@ def _inspect_trailing_whitespace( results: list[Finding], ) -> str: lines = cursor.split("\n") - offending_lines = [ - index + 1 - for index, line in enumerate(lines) - if line != line.rstrip(" \t") - ] + offending_lines = [index + 1 for index, line in enumerate(lines) if line != line.rstrip(" \t")] if not offending_lines: return cursor diff --git a/aria-bot/aria_bot/from collections.py b/aria-bot/aria_bot/from collections.py index fdfa021d9..3654065a2 100644 --- a/aria-bot/aria_bot/from collections.py +++ b/aria-bot/aria_bot/from collections.py @@ -1,6 +1,7 @@ -from collections.abc import Iterable, Mapping, Sequence +from collections.abc import Sequence from typing import Any + def _as_dict(value: Any) -> dict[str, Any]: return value if isinstance(value, dict) else {} diff --git a/tests/test_auto_fix_workflow.py b/tests/test_auto_fix_workflow.py index 39ea1fbb2..4339dffff 100644 --- a/tests/test_auto_fix_workflow.py +++ b/tests/test_auto_fix_workflow.py @@ -71,9 +71,7 @@ def test_auto_fix_has_cleanup_step() -> None: "are accidentally included in the autofix branch" ) - cleanup_step = next( - step for step in steps if step["name"] == "Revert workflow file changes and remove stray files" - ) + cleanup_step = next(step for step in steps if step["name"] == "Revert workflow file changes and remove stray files") assert "detect_output.txt" in cleanup_step["run"], "Must remove stray detect_output.txt" assert ".github/workflows" in cleanup_step["run"], "Must revert workflow file changes" assert "git restore" in cleanup_step["run"], "Must use git restore to revert workflow changes" diff --git a/tests/test_auto_merge_workflow.py b/tests/test_auto_merge_workflow.py index 089681afa..7fabd8dcf 100644 --- a/tests/test_auto_merge_workflow.py +++ b/tests/test_auto_merge_workflow.py @@ -71,17 +71,14 @@ def test_auto_merge_has_pull_request_trigger() -> None: def test_auto_merge_has_check_run_trigger() -> None: wf = _load_auto_merge() assert "check_run" in _get_triggers(wf), ( - "auto-merge.yml must trigger on check_run events so it fires when " - "'All Gates Passed' completes" + "auto-merge.yml must trigger on check_run events so it fires when 'All Gates Passed' completes" ) def test_auto_merge_check_run_trigger_on_completed() -> None: wf = _load_auto_merge() check_run = _get_triggers(wf)["check_run"] - assert "completed" in check_run.get("types", []), ( - "check_run trigger must include the 'completed' type" - ) + assert "completed" in check_run.get("types", []), "check_run trigger must include the 'completed' type" def test_auto_merge_pull_request_trigger_includes_labeled_unlabeled() -> None: @@ -108,9 +105,7 @@ def test_auto_merge_has_disable_job() -> None: def test_auto_merge_has_merge_on_gate_pass_job() -> None: wf = _load_auto_merge() - assert "merge-on-gate-pass" in wf["jobs"], ( - "auto-merge.yml must have a 'merge-on-gate-pass' job" - ) + assert "merge-on-gate-pass" in wf["jobs"], "auto-merge.yml must have a 'merge-on-gate-pass' job" def test_auto_merge_has_bot_approve_job() -> None: @@ -142,20 +137,14 @@ def test_merge_on_gate_pass_filters_all_gates_passed_name() -> None: def test_merge_on_gate_pass_filters_success_conclusion() -> None: wf = _load_auto_merge() job_if = wf["jobs"]["merge-on-gate-pass"].get("if", "") - assert "success" in job_if, ( - "merge-on-gate-pass must only fire when the check_run conclusion is 'success'" - ) + assert "success" in job_if, "merge-on-gate-pass must only fire when the check_run conclusion is 'success'" def test_merge_on_gate_pass_has_write_permissions() -> None: wf = _load_auto_merge() perms = wf["jobs"]["merge-on-gate-pass"].get("permissions", {}) - assert perms.get("contents") == "write", ( - "merge-on-gate-pass needs contents:write to perform merges" - ) - assert perms.get("pull-requests") == "write", ( - "merge-on-gate-pass needs pull-requests:write to post comments" - ) + assert perms.get("contents") == "write", "merge-on-gate-pass needs contents:write to perform merges" + assert perms.get("pull-requests") == "write", "merge-on-gate-pass needs pull-requests:write to post comments" # --------------------------------------------------------------------------- @@ -167,25 +156,21 @@ def test_enable_job_guards_against_forks() -> None: wf = _load_auto_merge() job_if = wf["jobs"]["enable"].get("if", "") assert "head.repo.full_name == github.repository" in job_if, ( - "enable job must guard against fork PRs by checking " - "head.repo.full_name == github.repository" + "enable job must guard against fork PRs by checking head.repo.full_name == github.repository" ) def test_enable_job_guards_against_drafts() -> None: wf = _load_auto_merge() job_if = wf["jobs"]["enable"].get("if", "") - assert "draft" in job_if, ( - "enable job must guard against draft PRs" - ) + assert "draft" in job_if, "enable job must guard against draft PRs" def test_enable_job_fires_on_pull_request_event() -> None: wf = _load_auto_merge() job_if = wf["jobs"]["enable"].get("if", "") assert "github.event_name == 'pull_request'" in job_if, ( - "enable job must check github.event_name == 'pull_request' to avoid " - "running on check_run events" + "enable job must check github.event_name == 'pull_request' to avoid running on check_run events" ) @@ -197,29 +182,21 @@ def test_enable_job_fires_on_pull_request_event() -> None: def test_disable_job_guards_against_forks() -> None: wf = _load_auto_merge() job_if = wf["jobs"]["disable"].get("if", "") - assert "head.repo.full_name == github.repository" in job_if, ( - "disable job must guard against fork PRs" - ) + assert "head.repo.full_name == github.repository" in job_if, "disable job must guard against fork PRs" def test_disable_job_requires_unlabeled_action() -> None: wf = _load_auto_merge() job_if = wf["jobs"]["disable"].get("if", "") - assert "unlabeled" in job_if, ( - "disable job must check for the 'unlabeled' action" - ) + assert "unlabeled" in job_if, "disable job must check for the 'unlabeled' action" def test_disable_job_checks_no_remaining_label() -> None: wf = _load_auto_merge() job_if = wf["jobs"]["disable"].get("if", "") # Must verify both labels are absent before disabling - assert "auto-merge" in job_if, ( - "disable job must check that 'auto-merge' label is no longer present" - ) - assert "autofix" in job_if, ( - "disable job must check that 'autofix' label is no longer present" - ) + assert "auto-merge" in job_if, "disable job must check that 'auto-merge' label is no longer present" + assert "autofix" in job_if, "disable job must check that 'autofix' label is no longer present" # --------------------------------------------------------------------------- @@ -230,40 +207,28 @@ def test_disable_job_checks_no_remaining_label() -> None: def test_bot_approve_gated_by_variable() -> None: wf = _load_auto_merge() job_if = wf["jobs"]["bot-approve"].get("if", "") - assert "AUTO_MERGE_BOT_APPROVE" in job_if, ( - "bot-approve job must be gated by the AUTO_MERGE_BOT_APPROVE variable" - ) + assert "AUTO_MERGE_BOT_APPROVE" in job_if, "bot-approve job must be gated by the AUTO_MERGE_BOT_APPROVE variable" def test_bot_approve_guards_against_forks() -> None: wf = _load_auto_merge() job_if = wf["jobs"]["bot-approve"].get("if", "") - assert "head.repo.full_name == github.repository" in job_if, ( - "bot-approve must guard against fork PRs" - ) + assert "head.repo.full_name == github.repository" in job_if, "bot-approve must guard against fork PRs" def test_bot_approve_skips_drafts() -> None: wf = _load_auto_merge() job_if = wf["jobs"]["bot-approve"].get("if", "") - assert "draft" in job_if, ( - "bot-approve must skip draft PRs" - ) + assert "draft" in job_if, "bot-approve must skip draft PRs" def test_bot_approve_allowlist_defined_in_env() -> None: wf = _load_auto_merge() env = wf.get("env", {}) - assert "BOT_APPROVE_ALLOWLIST" in env, ( - "BOT_APPROVE_ALLOWLIST must be declared in the workflow-level env block" - ) + assert "BOT_APPROVE_ALLOWLIST" in env, "BOT_APPROVE_ALLOWLIST must be declared in the workflow-level env block" allowlist = env["BOT_APPROVE_ALLOWLIST"] - assert "github-actions[bot]" in allowlist, ( - "github-actions[bot] must be in BOT_APPROVE_ALLOWLIST" - ) - assert "copilot-swe-agent[bot]" in allowlist, ( - "copilot-swe-agent[bot] must be in BOT_APPROVE_ALLOWLIST" - ) + assert "github-actions[bot]" in allowlist, "github-actions[bot] must be in BOT_APPROVE_ALLOWLIST" + assert "copilot-swe-agent[bot]" in allowlist, "copilot-swe-agent[bot] must be in BOT_APPROVE_ALLOWLIST" # --------------------------------------------------------------------------- @@ -303,91 +268,65 @@ def test_auto_merge_on_ci_stub_has_no_automatic_trigger() -> None: def test_eligibility_action_exists() -> None: action_path = ACTIONS_DIR / "check-auto-merge-eligibility" / "action.yml" - assert action_path.exists(), ( - "check-auto-merge-eligibility/action.yml must exist" - ) + assert action_path.exists(), "check-auto-merge-eligibility/action.yml must exist" def test_eligibility_action_has_pr_number_input() -> None: action = _load_eligibility_action() inputs = action.get("inputs", {}) - assert "pr-number" in inputs, ( - "eligibility action must define a 'pr-number' input" - ) - assert inputs["pr-number"].get("required") is True, ( - "'pr-number' input must be required" - ) + assert "pr-number" in inputs, "eligibility action must define a 'pr-number' input" + assert inputs["pr-number"].get("required") is True, "'pr-number' input must be required" def test_eligibility_action_has_github_token_input() -> None: action = _load_eligibility_action() inputs = action.get("inputs", {}) - assert "github-token" in inputs, ( - "eligibility action must define a 'github-token' input" - ) + assert "github-token" in inputs, "eligibility action must define a 'github-token' input" def test_eligibility_action_outputs_eligible() -> None: action = _load_eligibility_action() outputs = action.get("outputs", {}) - assert "eligible" in outputs, ( - "eligibility action must output 'eligible'" - ) + assert "eligible" in outputs, "eligibility action must output 'eligible'" def test_eligibility_action_outputs_reason() -> None: action = _load_eligibility_action() outputs = action.get("outputs", {}) - assert "reason" in outputs, ( - "eligibility action must output 'reason'" - ) + assert "reason" in outputs, "eligibility action must output 'reason'" def test_eligibility_action_is_composite() -> None: action = _load_eligibility_action() - assert action.get("runs", {}).get("using") == "composite", ( - "eligibility action must use 'composite' runner" - ) + assert action.get("runs", {}).get("using") == "composite", "eligibility action must use 'composite' runner" def test_eligibility_action_checks_draft() -> None: action_path = ACTIONS_DIR / "check-auto-merge-eligibility" / "action.yml" content = action_path.read_text(encoding="utf-8") - assert "draft" in content.lower(), ( - "eligibility action script must check for draft status" - ) + assert "draft" in content.lower(), "eligibility action script must check for draft status" def test_eligibility_action_checks_base_branch() -> None: action_path = ACTIONS_DIR / "check-auto-merge-eligibility" / "action.yml" content = action_path.read_text(encoding="utf-8") - assert "main" in content, ( - "eligibility action must verify the PR targets 'main'" - ) + assert "main" in content, "eligibility action must verify the PR targets 'main'" def test_eligibility_action_checks_fork() -> None: action_path = ACTIONS_DIR / "check-auto-merge-eligibility" / "action.yml" content = action_path.read_text(encoding="utf-8") - assert "fork" in content.lower(), ( - "eligibility action must guard against fork PRs" - ) + assert "fork" in content.lower(), "eligibility action must guard against fork PRs" def test_eligibility_action_checks_label() -> None: action_path = ACTIONS_DIR / "check-auto-merge-eligibility" / "action.yml" content = action_path.read_text(encoding="utf-8") - assert "auto-merge" in content, ( - "eligibility action must verify the 'auto-merge' label" - ) - assert "autofix" in content, ( - "eligibility action must verify the 'autofix' label" - ) + assert "auto-merge" in content, "eligibility action must verify the 'auto-merge' label" + assert "autofix" in content, "eligibility action must verify the 'autofix' label" def test_eligibility_action_checks_changes_requested() -> None: action_path = ACTIONS_DIR / "check-auto-merge-eligibility" / "action.yml" content = action_path.read_text(encoding="utf-8") - assert "CHANGES_REQUESTED" in content, ( - "eligibility action must block on CHANGES_REQUESTED reviews" - ) + assert "CHANGES_REQUESTED" in content, "eligibility action must block on CHANGES_REQUESTED reviews"