Compare commits

...

1 Commits

Author SHA1 Message Date
Molecule AI Dev Engineer A (Kimi) 3195d15046 style(scripts): resolve ruff I001, E501, F401, E741 in gitea scripts and tests
ci-arm64-advisory / fast-checks (pull_request) Waiting to run
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 3s
Lint shellcheck (arm64 pilot) / shellcheck-arm64 (pilot) (pull_request) Successful in 8s
CI / Python Lint & Test (pull_request) Successful in 8s
CI / Detect changes (pull_request) Successful in 9s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 8s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 11s
E2E Chat / detect-changes (pull_request) Successful in 12s
E2E API Smoke Test / detect-changes (pull_request) Successful in 12s
Lint forbidden tenant-env keys / Scan workspace_secrets writers for forbidden env keys (pull_request) Successful in 8s
Lint no tenant GITEA or GITHUB token write / Scan for repo-host token write into tenant workspace surface (pull_request) Successful in 5s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 17s
CI / all-required (pull_request) Successful in 32s
qa-review / approved (pull_request) Failing after 18s
security-review / approved (pull_request) Failing after 6s
CI / Platform (Go) (pull_request) Successful in 5s
CI / Canvas (Next.js) (pull_request) Successful in 4s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 3s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 2s
E2E Chat / E2E Chat (pull_request) Successful in 3s
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 3s
CI / Canvas Deploy Reminder (pull_request) Has been skipped
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 1m1s
Ops Scripts Tests / Ops scripts (unittest) (pull_request) Successful in 1m8s
lint-continue-on-error-tracking / lint-continue-on-error-tracking (pull_request) Successful in 1m27s
gate-check-v3 / gate-check (pull_request) Successful in 9s
sop-checklist / na-declarations (pull_request) N/A: (none)
sop-checklist / all-items-acked (pull_request) Successful in 3s
sop-checklist / review-refire (pull_request) Has been skipped
sop-tier-check / tier-check (pull_request) Successful in 4s
lint-mask-pr-atomicity / lint-mask-pr-atomicity (pull_request) Successful in 1m14s
CI / Shellcheck (E2E scripts) (pull_request) Has been cancelled
audit-force-merge / audit (pull_request) Has been skipped
Second batch of lint fixes across 9 files in .gitea/scripts/:
- sort imports (I001)
- wrap long lines to ≤88 chars (E501)
- remove unused timedelta import (F401)
- rename ambiguous variable `l` → `lbl` (E741)

All 148 tests pass.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-24 18:48:54 +00:00
9 changed files with 25 additions and 15 deletions
+1 -1
View File
@@ -13,8 +13,8 @@ Exits 1 on malformed input (caller should handle as "no files").
"""
from __future__ import annotations
import sys
import json
import sys
def main() -> None:
+10 -3
View File
@@ -335,7 +335,10 @@ def run() -> int:
)
return 0
print(f"::notice::Linting {len(contexts)} required context(s) for paths-filter regressions:")
print(
f"::notice::Linting {len(contexts)} required context(s) "
f"for paths-filter regressions:"
)
for c in contexts:
print(f" - {c}")
@@ -370,7 +373,10 @@ def run() -> int:
if offenders:
print("")
print(f"::error::Found {len(offenders)} required workflow(s) with paths/paths-ignore filters:")
print(
f"::error::Found {len(offenders)} required workflow(s) "
f"with paths/paths-ignore filters:"
)
for workflow_name, wf_path, findings in offenders:
for finding in findings:
# ::error file=... lets Gitea Actions surface a per-file
@@ -382,7 +388,8 @@ def run() -> int:
f"silent indefinite pending: {finding}. "
f"See feedback_path_filtered_workflow_cant_be_required. "
f"Fix: remove the filter and instead gate per-step "
f"inside the job with `if: contains(steps.changed.outputs.files, ...)` "
f"inside the job with "
f"`if: contains(steps.changed.outputs.files, ...)` "
f"or refactor to a single-job-with-per-step-if shape."
)
return 1
+3 -1
View File
@@ -283,7 +283,9 @@ def _ensure_labels(repo: str, names: list[str]) -> list[int]:
if status != "ok" or not isinstance(labels, list):
return []
out: list[int] = []
by_name = {l["name"]: l["id"] for l in labels if isinstance(l, dict)}
by_name = {
lbl["name"]: lbl["id"] for lbl in labels if isinstance(lbl, dict)
}
for n in names:
if n in by_name:
out.append(by_name[n])
@@ -82,7 +82,7 @@ import sys
import urllib.error
import urllib.parse
import urllib.request
from datetime import datetime, timedelta, timezone
from datetime import datetime, timezone
from pathlib import Path
from typing import Any
+1 -1
View File
@@ -11,8 +11,8 @@ Exits 0 always (caller handles empty output as "no files").
"""
from __future__ import annotations
import sys
import json
import sys
def main() -> None:
-1
View File
@@ -25,7 +25,6 @@ import re
import sys
import urllib.parse
STATE_DIR = os.environ["FIXTURE_STATE_DIR"]
@@ -2,7 +2,6 @@ from pathlib import Path
import yaml
ROOT = Path(__file__).resolve().parents[2]
@@ -2,7 +2,6 @@ import importlib.util
import sys
from pathlib import Path
SCRIPT = Path(__file__).resolve().parents[1] / "prod-auto-deploy.py"
spec = importlib.util.spec_from_file_location("prod_auto_deploy", SCRIPT)
prod = importlib.util.module_from_spec(spec)
@@ -137,7 +136,9 @@ def test_ci_context_state_handles_missing_and_gitea_status_key():
def test_context_is_satisfied_accepts_only_success():
assert prod.context_is_satisfied("success") is True
for state in ("failure", "error", "cancelled", "canceled", "skipped", "pending", "missing"):
for state in (
"failure", "error", "cancelled", "canceled", "skipped", "pending", "missing"
):
assert prod.context_is_satisfied(state) is False
@@ -3,7 +3,6 @@ import json
import pathlib
import urllib.error
ROOT = pathlib.Path(__file__).resolve().parents[1]
SCRIPT = ROOT / "status-reaper.py"
@@ -125,7 +124,10 @@ def test_reap_compensates_failed_pr_context_when_push_equivalent_passed(monkeypa
),
(
"db3b7a93e31adc0cb072a6d177d92dd73275a191",
"Handlers Postgres Integration / Handlers Postgres Integration (pull_request)",
(
"Handlers Postgres Integration / "
"Handlers Postgres Integration (pull_request)"
),
"https://git.example.test/handlers-pr",
mod.PR_SHADOW_COMPENSATION_DESCRIPTION,
False,
@@ -139,8 +141,8 @@ def test_reap_preserves_failed_pr_context_without_push_success(monkeypatch):
monkeypatch.setattr(
mod,
"post_compensating_status",
lambda sha, context, target_url, *, description="", dry_run=False: posted.append(
context
lambda sha, context, target_url, *, description="", dry_run=False: (
posted.append(context)
),
)