Skip to content

CI: shared-files test no longer depends on GITHUB_REPOSITORY - #173

Merged
bernardladenthin merged 1 commit into
mainfrom
claude/hopeful-pascal-9jlbqb
Oct 7, 2026
Merged

bernardladenthin merged 1 commit into
mainfrom
claude/hopeful-pascal-9jlbqb

Conversation

@bernardladenthin

Copy link
Copy Markdown
Owner

Summary

  • Fixes test_sibling_differences_are_warnings_not_failures in the shared .github/buildcheck/tests/test_sharedfiles.py. Since it was added on 2026-09-30, it has been red in BitcoinAddressFinder's CI only: Shared files + build checks, for example run 37680715063.
  • Cause: main() never fetches the repository being checked, and it takes that name from GITHUB_REPOSITORY. The test expects the sibling it leaves unreachable, BitcoinAddressFinder, to produce a could not read … warning. In BitcoinAddressFinder's own CI that sibling is the current repository and is skipped, so the warning never appeared. Locally (GITHUB_REPOSITORY unset) and in the other three repos the test passed.
  • Fix: the test pins current_repo to java-llama.cpp, the same way the other tests in the file already mock it, and additionally asserts that the pinned repository is not fetched.
  • It is a shared file: the copy is byte-identical in all four repos, and every manifest hash is refreshed.

Test plan

  • Reproduced: GITHUB_REPOSITORY=x/BitcoinAddressFinder python3 -m unittest discover -s .github/buildcheck/tests -t .github fails before the fix and passes after it.
  • In each repo the full buildcheck suite passes under its own repository name.
  • check-shared-files.py reports 0 files changed here alone, with the same hash in all four repos.
  • CI is green on this branch.

Related issues / PRs

The same change is made in java-llama.cpp, BitcoinAddressFinder, streambuffer and srcmorph.

Checklist

  • I have read CONTRIBUTING.md and CODE_OF_CONDUCT.md
  • My commits follow Conventional Commits. They use the repository's usual CI: prefix instead.
  • No security-sensitive changes

🤖 Generated with Claude Code

https://claude.ai/code/session_01AytmJF9faEiQEVt6eetQS2


Generated by Claude Code

test_sibling_differences_are_warnings_not_failures expected a
"could not read BitcoinAddressFinder" warning from the sibling it leaves
unreachable. main() never fetches the repository being checked, and takes
its name from GITHUB_REPOSITORY, so in BitcoinAddressFinder's own CI that
sibling was skipped and the test failed there alone (red since the test
was added; e.g. run 37680715063). The test now pins current_repo, as the
other tests in the file do, and asserts the pinned repository is not
fetched. Shared file: identical in all four repos, manifests refreshed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AytmJF9faEiQEVt6eetQS2
@sonarqubecloud

sonarqubecloud Bot commented Oct 7, 2026

Copy link
Copy Markdown

@claude

claude Bot commented Oct 7, 2026

Copy link
Copy Markdown

Review Summary

This PR is a well-executed fix for a flaky test that was environment-dependent. ✅

Key Strengths

  1. Root cause properly identified: The test was failing only in BitcoinAddressFinder's CI because current_repo() was implicitly using the GITHUB_REPOSITORY environment variable, making the test non-deterministic across different repository contexts.

  2. Implementation is sound:

    • Uses the established pattern (mock.patch.object(sharedfiles, "current_repo", return_value=...)) already present in the same test file (see RepoEntryTest at lines 155-157)
    • Proper scoping with a with statement prevents test pollution
    • Pinning to "java-llama.cpp" ensures a consistently unreachable sibling across all four repositories
  3. Test strengthened with validation: The new assertion self.assertNotIn("java-llama.cpp", err) at line 83 ensures the mocked repository name doesn't leak into output, adding confidence that the fix works as intended.

  4. Comprehensive test coverage: The PR documents validation across:

    • The problematic environment (BitcoinAddressFinder's CI with GITHUB_REPOSITORY set)
    • All four sibling repositories
    • Verification that hashes match identically across all repos (zero divergence)
  5. Documentation and maintenance: The comment clearly explains why the fix was needed, making it easier for future maintainers to understand the root cause.

No issues found

No code quality, bug, or security concerns identified. The hash update in .github/shared-files.sha256 is correct and properly synchronized.

Approve and ready to merge. 🚀

@codecov

codecov Bot commented Oct 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.99%. Comparing base (4d96491) to head (0f09648).

Additional details and impacted files
@@            Coverage Diff            @@
##               main     #173   +/-   ##
=========================================
  Coverage     96.99%   96.99%           
  Complexity      116      116           
=========================================
  Files             1        1           
  Lines           266      266           
  Branches         29       29           
=========================================
  Hits            258      258           
  Misses            2        2           
  Partials          6        6           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 99.248%. remained the same — claude/hopeful-pascal-9jlbqb into main

@bernardladenthin
bernardladenthin merged commit 2848d87 into main Oct 7, 2026
32 of 34 checks passed
@bernardladenthin
bernardladenthin deleted the claude/hopeful-pascal-9jlbqb branch October 7, 2026 21:34

This branch had an error being deployed

1 failed and 1 active deployments
startgate — 0f096486 Deployed Oct 7, 2026 by bernardladenthin via Start gate (abort window) #303
maven-central — 0f096486 Deployed Oct 7, 2026 by bernardladenthin via Verify GPG signing key (no secrets printed) #303
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.

3 participants