Repository navigation
ci: check PR titles under the gate - #583
Conversation
Add the title job (PR title, shared pr-title action pinned to the v1.0.0 commit) to ci.yml and to the needs of the gate, which allows it to be skipped. Run on edited pull requests, with a concurrency group that keeps title-unchanged edits from cancelling the commit's run, as in cloud-components. Mention the check in the contributing guide. Closes #580 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Reviewer's GuideThe PR adds a least-privilege, pinned PR-title validation job to CI, triggers it again when titles are edited, integrates it into the CI-passed gate with explicit skip handling, and updates concurrency and contributor documentation to support the new behavior. Flow diagram for PR title validation in CIflowchart TD
PR[Pull request event] --> Trigger{opened, synchronize, reopened, or edited}
Trigger --> Title[PR title job]
Title --> Check[pr-title action]
Check --> Gate[CI passed gate]
Gate --> Result[Workflow result]
Push[Push event] --> Skip[title skipped]
Dependabot[Dependabot PR] --> Skip
Skip --> Gate
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #583 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 56 56
Lines 7068 7068
=========================================
Hits 7068 7068
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Hey - I've found 3 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path=".github/workflows/ci.yml" line_range="67-68" />
<code_context>
+ if: >-
+ github.event_name == 'pull_request' && (
+ github.event.pull_request.user.login != 'dependabot[bot]' ||
+ github.event.changes.title &&
+ github.event.sender.login != 'dependabot[bot]')
+ runs-on: ubuntu-latest
+ timeout-minutes: 5
</code_context>
<issue_to_address>
**Dependabot title check gets bypassed**
When a human gives a Dependabot PR an invalid title and Dependabot pushes a new commit before the title-edit run completes, a later Dependabot synchronize run cancels the title-edit run, skips `title` because the event was not a title edit, and passes `CI passed` because skipped `title` is always allowed. That successful gate can replace the cancelled validation, allowing the invalid title to merge.
Ensure later runs cannot satisfy the gate by skipping title validation after a human has edited a Dependabot PR title.
Also at `.github/workflows/ci.yml:705`.
</issue_to_address>
### Comment 2
<location path=".github/workflows/ci.yml" line_range="52-53" />
<code_context>
+ ${{ github.workflow }}-${{
+ github.event_name == 'push' && github.sha ||
+ github.event.action == 'edited' && !github.event.changes.title &&
+ format('{0}-edited', github.ref) ||
+ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
</code_context>
<issue_to_address>
**Stale title check can pass**
When a description-edit run starts with a valid title, then the title is changed to an invalid value while that run is still in progress, that run stays in the `-edited` concurrency group and is not cancelled by the title-edit run; its title job validates the earlier event payload, and its later successful `CI passed` gate can leave the PR green after the new-title run fails.
Ensure an edit run cannot report a successful gate based on a title that has since changed, for example by serializing these runs or validating the current PR title at gate time.
Also at `.github/workflows/ci.yml:25`.
</issue_to_address>
### Comment 3
<location path=".github/workflows/ci.yml" line_range="25" />
<code_context>
push:
branches: [dev]
pull_request:
+ types: [opened, synchronize, reopened, edited]
branches: [dev]
</code_context>
<issue_to_address>
**Description edits rerun full CI**
When a pull request description is edited without changing its title, the unfiltered jobs rerun linting, test matrices, integration tests, chart installation, and image scans for a description-only edit, consuming runner capacity and delaying other CI runs.
Run the title check in a workflow that handles edits separately, or filter the other jobs to avoid rerunning them for description-only edits.
</issue_to_address>Linked issues
#580 ci: check PR titles under the gate · 5 of 5 met
| # | Requirement | Status | Notes |
|---|---|---|---|
| 1 | Add the PR title check and include it in the CI gate, allowing it to be skipped | ✅ Met | The title job uses the shared action and is in passed.needs; the gate allows title to be skipped. |
| 2 | Run on edited pull requests, with a concurrency group for edits that do not change the title | ✅ Met | The pull-request trigger includes edited, and title-unchanged edits use a separate concurrency group. |
| 3 | Skip on pushes and for Dependabot unless someone else edits the title | ✅ Met | The job condition runs only for pull requests and excludes Dependabot except when another sender edits the title. |
| 4 | Set permissions: {} on the title job |
✅ Met | |
| 5 | Mention the check in the contributing or development docs | ✅ Met | The contributing guide names the PR title job and says it rechecks edits. |
Sourcery assessment
Approval pending. 3 findings to address first.
Blocking findings: .github/workflows/ci.yml:68, .github/workflows/ci.yml:53, .github/workflows/ci.yml:25
# Conflicts: # docs/contributing/index.md
Summary
Adds the
titlejob ("PR title", sharedpr-titleaction pinned to the v1.0.0 commit) toci.ymland to theneedsof the gateCI passed, following cloud-components'ci.yml:pull_requestalso onedited, the concurrency group for edits that don't change the title, skipped on pushes and for Dependabot (unless someone else edits the title),permissions: {}. The gate'sallow-skippednow always allowstitle(andpush publishas before whenPUBLISHis "false"). The contributing guide mentions the check in one line.Light lane: CI change without secrets, permissions or the release workflow; I reviewed the diff myself.
Closes #580
Part of elixir-cloud-aai/.github#49.
Verification
yqparses the workflow;needsandonas intended.PR titleandCI passedpassed in the run for the commit (run 41271474186)..Declined review findings
None (light lane).
Open questions
None.
🤖 Generated with Claude Code
Summary by Sourcery
Require valid pull request titles as part of the CI gate and keep the check synchronized with title edits.
New Features:
Enhancements:
CI:
Documentation: