Skip to content

ci: check PR titles under the gate - #308

Merged
uniqueg merged 3 commits into
devfrom
ci/pr-title
Nov 1, 2026
Merged

uniqueg merged 3 commits into
devfrom
ci/pr-title

Conversation

@uniqueg

@uniqueg uniqueg commented Nov 1, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds the title job ("PR title", shared action elixir-cloud-aai/.github/actions/pr-title v1.0.0) to ci.yml, as in cloud-components, protes (#373) and trs-filer (#195):

  • pull_request also on edited; edits that leave the title unchanged get their own concurrency group, so they don't cancel the run for the commit.
  • The job runs on pull requests only, skips Dependabot unless someone else edits the title, has permissions: {}.
  • title is in the gate's needs and may be skipped on every event (allow-skipped).
  • The workflow header comment and tests/test_workflows.py are updated (new test_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.
  • pre-commit on the changed files: all hooks passed (actionlint, ruff, semgrep, gitleaks, ast-grep); mypy on tests/test_workflows.py passed.
  • CI: all checks passed, including PR title and CI passed; Sourcery check passed (after merging dev).

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:

  • Add a gated PR title check using the shared Conventional Commit title action.

Enhancements:

  • Run CI when pull requests are edited and isolate title-unchanged edit runs from commit-triggered runs.
  • Allow intentionally skipped title checks and push-only jobs in the CI gate.

CI:

  • Update workflow coverage to verify the PR title job and edited pull request trigger.

Documentation:

  • Document that squash-merged pull request titles become commit messages and are checked by CI.

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]>
@sourcery-ai

sourcery-ai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

The 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 concurrency

sequenceDiagram
    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
Loading

Flow diagram for pull request title validation in CI

flowchart 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]
Loading

File-Level Changes

Change Details Files
Add pull request title validation to the CI workflow and integrate it into the required gate.
  • Run the pinned shared PR-title action for pull requests with no permissions.
  • Skip validation for pushes and Dependabot PRs unless another user edits the title.
  • Allow the title job to be skipped in the gate where it is intentionally not applicable.
.github/workflows/ci.yml
Trigger and isolate edited pull request workflow runs so title changes are checked without invalidating commit runs.
  • Add the pull request edited event.
  • Use a separate concurrency group for edits that do not change the title.
  • Update workflow documentation comments to describe the trigger and concurrency behavior.
.github/workflows/ci.yml
Extend workflow regression tests for the new title check and gate configuration.
  • Verify the edited pull request trigger and title job properties.
  • Verify the title job is included in gate skip allowances.
tests/test_workflows.py

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@codecov

codecov Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (b9a066e) to head (4e9c506).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@uniqueg
uniqueg marked this pull request as ready for review November 1, 2026 10:16

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread .github/workflows/ci.yml Resolved

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread .github/workflows/ci.yml Resolved
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@uniqueg
uniqueg merged commit a7961e6 into dev Nov 1, 2026
32 checks passed
@uniqueg
uniqueg deleted the ci/pr-title branch November 1, 2026 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci: check PR titles under the gate

1 participant