You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@struts.apache.org by "lukaszlenart (via GitHub)" <gi...@apache.org> on 2026/10/14 08:39:28 UTC
[PR] build(ci): detect changes in-job and cancel superseded PR runs [struts]
lukaszlenart opened a new pull request, #2010:
URL: https://github.com/apache/struts/pull/2010
## Why
GitHub Actions jobs on this repo spend far longer queued than running. Over the last ~40 completed runs:
| Job | Avg queue | Max queue | Avg run |
|---|---|---|---|
| `changes` (2 s job) | 37 min | 97 min | 0.1 min |
| Build and Test (each of 6) | ~27 min | 80 min | ~4 min |
| CodeQL Analyze | 30 min | 79 min | 7 min |
| Sonar Scan | 31 min | 82 min | 6 min |
| OWASP | 34 min | 99 min | 1.7 min |
The queue is the shared ASF runner pool, which we cannot change. But we were doubling our own wait: every build job `needs: changes`, a separate job, so each build queued once for the two-second detection job and then again for its own runner.
Smaller runners such as `ubuntu-slim` do not help: GitHub documents them as sharing the concurrency model of the standard runners, and the table shows a 2 s job queues as long as a 7 min one.
## What changes
- **One queue wait per job.** `.github/workflows/changes.yml` becomes the local composite action `.github/actions/detect-changes`. The path logic and skip pattern are unchanged. Each job (Maven matrix, CodeQL, OWASP, Sonar) now runs checkout → detect → the real steps gated on `steps.changes.outputs.code == 'true'`.
- OWASP and CodeQL lose their job-level `if:` and gate their steps instead, so a docs-only change reports success rather than skipped. `maven.yml` already did this.
- Sonar keeps its fork/Dependabot job condition.
- CodeQL's job permissions gain `pull-requests: read`, which the removed `changes` job already had.
- **Cancel superseded PR runs.** Each workflow gets a `concurrency` group keyed by PR number with `cancel-in-progress: true`. Pushes are keyed by `run_id`, so GitHub's rule that a newer pending run replaces an older one cannot drop a stacked build on `main`.
## Trade-off
A docs-only change now briefly takes a runner in each of the four jobs (detection, then every step skipped), instead of one `changes` runner per workflow. The runner cost is about the same, and code changes lose the whole first wait.
## Verification
- `actionlint` 1.7.12 is clean apart from two pre-existing shellcheck infos in the unchanged "SonarCloud Scan -- SKIPPED" step.
- The real check is this PR's own runs: every check should show a single queue wait and no `changes / Detect changes …` job.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@struts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] build(ci): detect changes in-job and cancel superseded PR runs [struts]
Posted by "lukaszlenart (via GitHub)" <gi...@apache.org>.
lukaszlenart merged PR #2010:
URL: https://github.com/apache/struts/pull/2010
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@struts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] build(ci): detect changes in-job and cancel superseded PR runs [struts]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #2010:
URL: https://github.com/apache/struts/pull/2010#issuecomment-6167531221
## [](https://sonarcloud.io/dashboard?id=apache_struts&pullRequest=2010) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=apache_struts&pullRequest=2010&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_struts&pullRequest=2010&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_struts&pullRequest=2010&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_struts&pullRequest=2010&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_struts&pullRequest=2010&metric=new_duplicated_lines_density&view=list)
<!-- sqra-placement-anchor -->
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_struts&pullRequest=2010)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@struts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org