Repository navigation
ci: check PR titles under the gate - #308
Conversation
Add the job PR title with the shared action of elixir-cloud-aai/.github, run CI also when a pull request is edited (edits that keep the title get their own concurrency group), and let the gate need the job and allow it to be skipped. Closes #303 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Reviewer's GuideThe CI workflow now validates pull request titles with the pinned shared Conventional Commits action, runs on edited pull requests with concurrency handling that preserves commit runs, and includes the conditionally skipped title job in the CI gate; workflow tests cover the new trigger, job, and gate behavior. Sequence diagram for edited pull request CI concurrencysequenceDiagram
participant GitHub
participant CI
participant TitleJob as PR title job
participant Gate
GitHub->>CI: pull_request edited
alt title changed
CI->>TitleJob: Check PR title
TitleJob->>Gate: Report validation result
else title unchanged
CI->>CI: Use edited concurrency group
CI->>Gate: Allow skipped title job
end
Gate->>GitHub: Report CI passed or failed
Flow diagram for pull request title validation in CIflowchart TD
Event[Pull request opened, synchronized, reopened, or edited] --> TitleCondition{Title job should run?}
TitleCondition -->|Eligible pull request| Title[title: PR title]
TitleCondition -->|Push or excluded Dependabot event| Skipped[title skipped]
Title --> Check[pr-title shared action]
Check --> Gate[passed gate]
Skipped --> Gate
Gate --> Result[CI result]
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 #308 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 22 22
Lines 2356 2356
=========================================
Hits 2356 2356 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path=".github/workflows/ci.yml" line_range="57-58" />
<code_context>
+ 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
+ permissions: {}
</code_context>
<issue_to_address>
**Dependabot title check can be bypassed**
When a human changes a Dependabot PR title to an invalid value and Dependabot later pushes a commit, the `title` job is skipped because the sender is Dependabot, and `passed` accepts that skip, so the PR gets a passing required check with an invalid title.
Ensure a human-edited Dependabot title remains subject to validation on subsequent PR events, rather than allowing the title job to be skipped on those events.
Also at `.github/workflows/ci.yml:687`.
</issue_to_address>Linked issues
#303 ci: check PR titles under the gate · 4 of 6 met · 1 to check by hand
| # | Requirement | Status | Notes |
|---|---|---|---|
| 1 | Add a PR title job using the shared pr-title action and include it in the CI gate. | ✅ Met | The title job uses the shared action and is listed in the gate’s needs. |
| 2 | Pin the shared action to the latest release. | 👀 Check by hand (external system) | Verify that v1.0.0 was the latest release of the shared pr-title action when this change was made. |
| 3 | Run the workflow on pull request edits and give edits that do not change the title their own concurrency group. | ✅ Met | The workflow includes the edited event, and title-unchanged edits use a separate group. |
| 4 | Skip the title job on pushes and for Dependabot, unless someone else edits the title. | ✅ Met | The job condition limits it to pull requests and skips Dependabot except when a non-Dependabot sender changes the title. |
| 5 | Set permissions: {} for the title job. |
✅ Met | |
| 6 | Mention the title check in the contributing or development docs. | ❌ Not addressed | The contributing guide describes the title format and length, but it does not mention the CI title check, and no documentation change is included. |
Sourcery assessment
Needs a human reviewer. 1 finding to address first, and if the check accepts a title it should reject, that title can become a squash-merge commit message; reverting the workflow would not change commits already made, though the history is bounded and can be corrected. A check that rejects valid titles would instead visibly block merges and can be fixed by reverting or adjusting the workflow.
Blocking findings: .github/workflows/ci.yml:58
There was a problem hiding this comment.
Linked issues
#303 ci: check PR titles under the gate · 6 of 7 met
| # | Requirement | Status | Notes |
|---|---|---|---|
| 1 | Check PR titles against Conventional Commits and the 50-character limit using the pinned shared action. | ✅ Met | The title job invokes the shared pr-title action pinned to v1.0.0. |
| 2 | Add the title job to the CI passed gate and allow it to be skipped. |
✅ Met | The job is in needs, and allow-skipped includes title for all events. |
| 3 | Run the workflow for pull request edited events. |
✅ Met | |
| 4 | Give edits that do not change the title their own concurrency group. | ✅ Met | |
| 5 | Skip the title job on pushes and for Dependabot unless someone else edits the title. | ✅ Met | The job condition limits it to pull requests and skips Dependabot except when a non-Dependabot sender changes the title. |
| 6 | Set permissions: {} on the title job. |
✅ Met | |
| 7 | Mention the check in the contributing or development docs. | ❌ Not addressed | The PR leaves the docs unchanged; the contributing page discusses title rules but does not mention this CI check. |
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Summary
Adds the
titlejob ("PR title", shared actionelixir-cloud-aai/.github/actions/pr-titlev1.0.0) toci.yml, as in cloud-components, protes (#373) and trs-filer (#195):pull_requestalso onedited; edits that leave the title unchanged get their own concurrency group, so they don't cancel the run for the commit.permissions: {}.titleis in the gate'sneedsand may be skipped on every event (allow-skipped).tests/test_workflows.pyare updated (newtest_title_job).No docs change: the contributing page is trimmed in #301, and the org guide covers the check.
Closes #303
Part of elixir-cloud-aai/.github#49.
How verified
pytest tests(locked dev dependencies): 1586 passed, 262 skipped.tests/test_workflows.pypassed.PR titleandCI passed; Sourcery check passed (after mergingdev).Lane
Light lane: CI change that touches neither secrets, permissions nor the release workflow (
permissions: {}for the new job); no reviewer subagents, self-reviewed diff, copied from the reference implementation.Declined review findings
🤖 Generated with Claude Code
Summary by Sourcery
Enforce valid pull request titles as part of the CI gate while ensuring title checks remain reliable across pull request edits.
New Features:
Enhancements:
CI:
Documentation: