fix: add workflow-timeouts guard and test coverage for issue #420#655
Open
mvillmow wants to merge 6 commits into
Open
fix: add workflow-timeouts guard and test coverage for issue #420#655mvillmow wants to merge 6 commits into
mvillmow wants to merge 6 commits into
Conversation
mvillmow
commented
Jun 19, 2026
mvillmow
left a comment
Contributor
Author
There was a problem hiding this comment.
Guard script + tests + workflow fixes are correct and address prior bool review; but a generated coverage.xml (851 lines, leaks absolute path) was accidentally committed and must be removed.
mvillmow
commented
Jun 20, 2026
mvillmow
left a comment
Contributor
Author
There was a problem hiding this comment.
Guard script + tests + workflow timeout fixes are correct and address prior bool review; but a generated coverage.xml (851 lines, leaks absolute path) was committed by accident and must be removed.
Both jobs were missing explicit timeout-minutes declarations, which is a prerequisite for the new workflow-timeouts guard in issue #420. This commit adds reasonable timeout values: - sync-labels: 5 minutes (simple label synchronization) - discover: 10 minutes (repo-wide tech-debt scan) Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> Signed-off-by: mvillmow <4211002+mvillmow@users.noreply.github.com>
…420) Adds a custom CI check (scripts/check-workflow-timeouts.sh) that verifies every job in .github/workflows/*.yml declares an explicit timeout-minutes value. The JSON-Schema validator cannot enforce this semantic rule, so this guard fills the gap by parsing YAML and asserting each job has a positive integer timeout. Key features: - Parses all .github/workflows/*.yml files with pyyaml - Emits ::error:: annotations for missing or invalid timeouts - Skips reusable-workflow callers (which cannot have timeout-minutes) - Includes three regression tests (positive and negative cases) - Added pyyaml to pixi.toml dev dependencies Regression tests: - test_every_job_has_timeout_minutes: sanity check on all shipped workflows - test_script_flags_missing_timeout: script correctly rejects bad workflow - test_script_accepts_clean_workflow: script accepts valid workflows Closes #420 Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> Signed-off-by: mvillmow <4211002+mvillmow@users.noreply.github.com>
Adds the new workflow-timeouts job to the required CI checks in _required.yml. This job runs scripts/check-workflow-timeouts.sh to enforce the semantic rule that every job in .github/workflows/*.yml must declare an explicit timeout-minutes value. The job: - Runs after lint (needs: lint) to follow the established pattern - Has a 3-minute timeout (ample for YAML parsing) - Uses standard GitHub Actions annotations for CI feedback - Skips reusable-workflow callers automatically Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> Signed-off-by: mvillmow <4211002+mvillmow@users.noreply.github.com>
Python's bool is a subclass of int, so `timeout-minutes: true` would pass the isinstance check silently as 1. Add explicit bool rejection to catch malformed YAML values with a clear error message. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> Signed-off-by: mvillmow <4211002+mvillmow@users.noreply.github.com>
Unit test coverage missing for _required.yml workflow changes Closes #420 Implemented-By: claude-sonnet-4-6 Co-Authored-By: Claude Code <noreply@anthropic.com> Signed-off-by: mvillmow <4211002+mvillmow@users.noreply.github.com>
Signed-off-by: mvillmow <4211002+mvillmow@users.noreply.github.com>
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.
Summary
Implements issue #420: adds a custom CI guard (
scripts/check-workflow-timeouts.sh) that verifies every job in.github/workflows/*.ymldeclares an explicittimeout-minutesvalue. The JSON-Schema validator cannot enforce this semantic rule, so this guard fills the gap.Changes:
Prerequisite fixes for existing workflows that were missing timeouts
label-sync.yml→sync-labelsjob:timeout-minutes: 5tech-debt-discovery.yml→discoverjob:timeout-minutes: 10New guard script (
scripts/check-workflow-timeouts.sh)::error::annotations for violationsgit ls-filesto find workflows (respects.gitignore)Regression tests (
tests/test_workflow_timeouts.py)test_every_job_has_timeout_minutes— sanity check on shipped workflowstest_script_flags_missing_timeout— negative case, script rejects bad workflowstest_script_accepts_clean_workflow— happy path, script passes valid workflowsCI integration (added job to
_required.yml)workflow-timeoutsjob wired afterlint(follows established pattern)Dev dependency — Added
pyyaml = ">=6.0,<7"to pixi dev environmentTest plan
pytest tests/test_workflow_timeouts.py)pytest -m "not integration"→ 481 passed)scripts/check-workflow-timeouts.sh→ exit 0)Closes #420
Co-Authored-By: Claude Haiku 4.5 noreply@anthropic.com