Skip to content

ci: Format checks log is mostly noise (1018 fetched refs, 781 ResourceWarning lines) #2235

Closed

Description

@zackees

Location

The Format 🔍 / checks job (example run) writes 2,769 log lines. Two sources make up about 1,800 of them, and they bury the real error (here, test_no_bare_python_invocations at line 2,710).

  1. 1,018 lines of * [new tag] / * [new branch]. .github/workflows/check-format.yaml checks out with fetch-depth: 0 (lines 17 and 68). actions/checkout then fetches every branch and tag and prints one line per ref inside "Fetching the repository".
  2. 781 lines of ResourceWarning during ci/ Self-Tests 🧪:
    • ci/test_tool_guard.py:181: first = path.open("rb").readline() never closes the file. That is 259 warnings × 3 lines, one per scanned file.
    • One tempfile.py:484: ResourceWarning: Implicitly cleaning up <HTTPError 403: ''>. A self-test's HTTPError response is never closed.

Class

CI log noise. No functional effect, but failures are hard to find.

Proposed fix

  • ci/test_tool_guard.py: with path.open("rb") as f: first = f.readline(). Close the HTTPError in the test that triggers the 403 (with, or err.close()).
  • Make ResourceWarning fail the ci/ self-tests (-W error::ResourceWarning) so a new leak can't come back silently.
  • check-format.yaml: use a shallow checkout, plus a fetch of only the base commit the change checks need, instead of fetch-depth: 0. If full history really is needed, keep it but suppress the per-ref output (for example fetch-tags: false and filter: blob:none, or a quiet git fetch step).

Failing test

RED: run the ci/ self-tests with -W error::ResourceWarning; they fail at ci/test_tool_guard.py:181. GREEN: they pass. For the checkout, the job's log has no [new tag] lines.

Activity

  1. zackees commented on Oct 24, 2026

    @zackees
    MemberAuthor

    Claiming: #2235, using the proposed fix: close the leaks, make ResourceWarning an error in the ci/ self-tests, and stop the per-ref fetch output in check-format.

  2. added
    claimed
    on Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    claimed

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions