Repository navigation
ci: check PR titles under the gate - #41
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, whose inline check lets a skipped title count as passed. 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 #40 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Reviewer's GuideThe PR adds a pinned shared action to validate pull-request titles, wires its result into the inline CI gate with deliberate skip handling, and updates pull-request event/concurrency behavior so title edits are checked without disrupting commit-based runs. The contributing guide now documents this behavior. Sequence diagram for pull request title validation and CI gatingsequenceDiagram
actor Contributor
participant GitHub
participant CI
participant PRTitle as pr-title action
participant Gate as CI passed
Contributor->>GitHub: Edit pull request title
GitHub->>CI: Trigger pull_request edited
CI->>PRTitle: Check PR title
PRTitle-->>CI: success or failure
CI->>Gate: Evaluate needs including title
Gate-->>GitHub: Report CI passed or failed
Flow diagram for CI gate skip handlingflowchart TD
Start[CI run] --> Title[title job]
Start --> Other[changes, lint, test, scripts, docs]
Title --> Results[Evaluate job results]
Other --> Results
Results -->|success| Pass[CI passed]
Results -->|title skipped| Pass
Results -->|test skipped and no plugin affected| Pass
Results -->|failure, cancelled, or unintended skip| Fail[CI failed]
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 #41 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 6 6
Lines 553 553
Branches 71 71
=========================================
Hits 553 553
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 2 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="38-39" />
<code_context>
+ group: >-
+ ${{ 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 edit checks leave the wrong gate**
When a body or description edit run overlaps a title edit, the `github.event.changes.title` branch puts non-title edits in a `-edited` concurrency group while title edits use `github.ref`, so the earlier run is not cancelled and its event snapshot can leave `CI passed` incorrectly green or red for the current title.
Use the same PR concurrency group for title and non-title edit runs so the newer edit cancels the stale run.
</issue_to_address>
### Comment 2
<location path=".github/workflows/ci.yml" line_range="53-55" />
<code_context>
+ name: PR title
+ 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>
**Bot updates bypass title validation**
When a maintainer edits a Dependabot PR to a nonconforming title, then Dependabot pushes another commit, `title` is skipped because the event sender is Dependabot, and `passed` treats that skip as success; the new commit therefore gets a green required gate while the PR still has a nonconforming title.
Preserve whether the title was manually edited and continue validating it on subsequent PR events, rather than accepting every skipped title job.
Also at `.github/workflows/ci.yml:314`.
</issue_to_address>Linked issues
#40 ci: check PR titles under the gate · 6 of 6 met
| # | Requirement | Status | Notes |
|---|---|---|---|
| 1 | Add the PR title job using the shared action pinned to the latest release | ✅ Met | The PR title job uses the shared action pinned to v1.0.0. |
| 2 | Include the title job in the CI passed gate and allow it to be skipped | ✅ Met | The gate includes title in needs and allows a skipped title job. |
| 3 | Run on edited pull requests and use a separate concurrency group for edits that do not change the title | ✅ Met | The workflow listens for edited; title-unchanged edits use a group separate from the commit run. |
| 4 | Skip the title job on pushes and for Dependabot unless someone else edits the title | ✅ Met | The job condition skips pushes and Dependabot events, except title edits sent by someone other than Dependabot. |
| 5 | Set the title job's permissions to empty | ✅ Met | The job declares permissions: {}. |
| 6 | Mention the title check in the contributing or development docs | ✅ Met | The contributing guide says CI checks the title and rechecks it when edited. |
Sourcery assessment
Approval pending. 2 findings to address first.
Blocking findings: .github/workflows/ci.yml:39, .github/workflows/ci.yml:55
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 here is inline: its jq check now also counts a skippedtitleas passed; everything else is unchanged (testmay still be skipped only if no plugin is affected). 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 #40
Part of elixir-cloud-aai/.github#49.
Verification
yqparses the workflow;needsas intended.needsobjects: title skipped passes; title failed fails; test skipped with affected plugins fails; test and title skipped with no affected plugins passes.PR titleandCI passedpassed in the run for the commit (run 41277817629)..Declined review findings
None (light lane).
Open questions
None.
🤖 Generated with Claude Code
Summary by Sourcery
Enforce pull request title conventions as part of the required CI gate.
New Features:
Enhancements:
CI:
Documentation: