Conversation
Cancel superseded runs on the same ref and cap both jobs so a hung step fails fast instead of holding a runner for hours. Signed-off-by: Mrityunjay Raj <mr.raj.earth@gmail.com>
teknium1
left a comment
There was a problem hiding this comment.
Thanks for tightening the Typecheck workflow. The missing timeout/concurrency settings still exist on current main, but there is one CI-semantics issue.
Problems
.github/workflows/typecheck.yml:9sets unconditional cancellation. The caller intentionally limits cancellation to pull requests in.github/workflows/ci.yml:25-27; it also runs on pushes tomain(.github/workflows/ci.yml:13-16) and invokes this reusable workflow at:73-77. The proposed value would cancel post-merge Typecheck validation for successive main pushes.
Suggested changes
- Set
cancel-in-progressto${{ github.event_name == 'pull_request' }}to preserve the caller's PR-only policy, while keeping the group and the two job timeouts.
Automated hermes-sweeper review.
|
|
||
| concurrency: | ||
| group: typecheck-${{ github.ref }} | ||
| cancel-in-progress: true |
There was a problem hiding this comment.
Blocking: this unconditionally cancels Typecheck runs, including runs invoked by ci.yml on pushes to main. The caller deliberately limits cancellation to pull requests at .github/workflows/ci.yml:25-27; use ${{ github.event_name == 'pull_request' }} here to preserve post-merge validation.
There was a problem hiding this comment.
Good catch, fixed in 7cb3bc5.
cancel-in-progress is now ${{ github.event_name == 'pull_request' }}, matching the caller's policy in ci.yml (ci-${{ github.ref }} / PR-only cancellation). Since ci.yml triggers this reusable workflow on both pull_request and push to main, successive main pushes now keep their post-merge Typecheck runs instead of being cancelled. The concurrency group and the two job timeouts are unchanged.
The caller (ci.yml) runs this reusable workflow on both pull_request and push to main, and limits cancellation to PRs. Mirror that policy so a successive push to main does not cancel post-merge Typecheck validation. Signed-off-by: Mrityunjay Raj <mr.raj.earth@gmail.com>
What does this PR do?
typecheck.ymlis the only reusable (workflow_call) workflow in the repo with neither aconcurrency:group nor atimeout-minuteson its jobs. Every other reusable workflow (contributor-check.yml,docker-lint.yml,docs-site-checks.yml,history-check.yml,lint.yml,osv-scanner.yml,supply-chain-audit.yml,tests.yml,uv-lockfile-check.yml) already sets both.This brings it in line:
concurrency:group so superseded typecheck runs on the same ref are cancelled instead of piling up.timeout-minutesto both jobs so a hung step fails fast rather than inheriting the GitHub Actions 6 hour default and holding a runner for hours.The
concurrency:block uses the same<name>-${{ github.ref }}/cancel-in-progress: trueshape aslint.yml.Related Issue
Fixes #62256
This is separate from #45722 / #45731, which cover only the read-only
permissions:block on the same file. This PR does not touchpermissions:.Type of Change
Changes Made
.github/workflows/typecheck.yml:concurrency:block (group: typecheck-${{ github.ref }},cancel-in-progress: true).timeout-minutes: 10to thetypecheckjob.timeout-minutes: 15to thedesktop-buildjob.How to Test
python3 -c "import yaml; yaml.safe_load(open('.github/workflows/typecheck.yml'))"parses cleanly.Check TypeScriptandBuild desktop appnow show their configured timeout in the job settings.Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests pass — N/A: CI workflow YAML only, no Python code paths touched. Validated withyaml.safe_loadand cross-checked against the sibling workflows.Documentation & Housekeeping
docs/, docstrings) — N/Acli-config.yaml.exampleif I added/changed config keys — N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — N/Aubuntu-latest