Repository navigation
Fix the 3 CodeQL alerts: slow failing-test regex, workflow permissions - #198
Merged
Merged
Conversation
…rmissions - recent.py FAILED_TEST: the pytest branch had \S+::(?:\S+::)*, where \S+ can itself eat "::", so a line like "FAILED " + "::"*40 backtracked exponentially and could hang caught_by(). \S+:: alone matches the same lines and still keeps the name after the last "::". New test runs it in a subprocess with a time limit (fails without the fix, passes with it). - tests.yml, publish.yml: top-level permissions: contents: read. The publish job keeps its own id-token: write for PyPI. Assisted-by: Claude Code Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0175Q8iFhpNWWUnXp8kZTidZ
Contributor
|
connabyss
pushed a commit
that referenced
this pull request
Nov 5, 2026
Assisted-by: Claude Code Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0175Q8iEKr191VmKAJN4JZd5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by CH · project thread
What was wrong, what you changed, how you checked:
The first CodeQL scan (#196) found 3 alerts on main. All three are real; this fixes them.
FAILED_TEST): the pytest part was\S+::(?:\S+::)*, and\S+can itself swallow::, so a line likeFAILEDfollowed by many::backtracked exponentially. Measured: 22 pairs took 0.6 s, each 2 more about 4x longer, 3000 never finished. One odd line in a project's test output could hang Bite.\S+::alone matches exactly the same lines and still keeps the name after the last::.permissions: contents: read. The publish job keeps its ownid-token: writefor PyPI, as before.Test:
tests/test_failed_test_names_fast.pyruns the slow line in a separate process with a 10 s limit. It fails without the fix (timed out) and passes with it in 0.3 s, plus checks pytest names still read right (TestA::test_onegivestest_one,test_two[a-b], nested classes). Full suite: 368 passed, 1 skipped.python -m pytestpasses, and CI is green.Assisted-by: Claude Code
Generated by Claude Code