Skip to content

ci: check PR titles under the gate - #373

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

uniqueg merged 2 commits into
devfrom
ci/pr-title-check

Conversation

@uniqueg

@uniqueg uniqueg commented Nov 1, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds 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 CI passed, following cloud-components' ci.yml: pull_request also on edited, 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's allow-skipped always allows title (and push publish as before where PUBLISH is "false"). tests/test_workflows.py follows (gate expectation, new test_title_job). The contributing page mentions the check in one line.

Light lane: CI change without secrets, permissions or the release workflow; I reviewed the diff myself.

Closes #371

Part of elixir-cloud-aai/.github#49.

Verification

  • uv run --no-project --with pytest --with pyyaml --with packaging python -m pytest tests/test_workflows.py --noconftest: 23 passed.
  • actionlint and the pre-commit hooks could not run locally (actionlint not installed; pre-commit cannot fetch hook repos in the sandbox); CI runs them.
  • End-to-end: this PR's own CI run PR title and CI passed passed in the run for the final commit (run 41276649904); the first run failed in mypy on the new test, fixed in the second commit..

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 recheck them whenever pull requests are edited.

New Features:

  • Add a pull request title validation job enforcing the repository’s title conventions.

Enhancements:

  • Run CI when pull requests are edited and include title validation in the required CI gate.
  • Handle intentionally skipped title checks for pushes and Dependabot pull requests while preserving gate behavior.

CI:

  • Pin the shared pull request title and gate actions to the released v1.0.0 commit.

Documentation:

  • Document pull request title validation and rechecks in the contributing guide.

Tests:

  • Add workflow tests covering the title job, edited pull request events, and gate skip expectations.

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 #371

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 PR adds a permissions-free, commit-pinned PR title validation job to CI, includes it in the required gate with explicit skip rules for pushes and Dependabot, and updates event/concurrency handling so title edits are rechecked without stale gate results. Workflow tests and contributor documentation are updated accordingly.

Sequence diagram for PR title validation and CI gate

sequenceDiagram
    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: pull_request edited
    CI->>PRTitle: Check PR title
    PRTitle-->>CI: validation result
    CI->>Gate: needs includes title
    Gate->>Gate: gate action needs
    Gate-->>GitHub: required check result
Loading

Flow diagram for CI title job skip rules

flowchart TD
    Event[Pull request or push event] --> IsPR{pull_request event?}
    IsPR -->|No| SkipPush[Skip title job]
    IsPR -->|Yes| Dependabot{Dependabot PR?}
    Dependabot -->|No| Validate[Run PR title action]
    Dependabot -->|Yes| EditedByOther{Title edited by someone else?}
    EditedByOther -->|Yes| Validate
    EditedByOther -->|No| SkipBot[Skip title job]
    Validate --> Gate[CI passed gate]
    SkipPush --> Gate
    SkipBot --> Gate
Loading

File-Level Changes

Change Details Files
Adds a pinned pull-request title validation job and makes it part of the required CI gate.
  • Runs the shared PR-title action for pull requests using no permissions.
  • Validates Conventional Commit formatting and title length through the pinned v1.0.0 action.
  • Allows the title job to be intentionally skipped on pushes and Dependabot PRs, while retaining existing publish skip behavior.
.github/workflows/ci.yml
Ensures title edits trigger an appropriate, non-stale CI result.
  • Adds the pull request edited event.
  • Uses separate concurrency handling for edits that do not change the title, while title edits follow the commit run behavior.
  • Runs workflow tests to verify the edited trigger, title job configuration, and gate expectations.
.github/workflows/ci.yml
tests/test_workflows.py
Documents the new pull request title check for contributors.
  • Notes the PR title job and that it reruns when the title is edited.
docs/contributing/index.md

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

@read-the-docs-community

read-the-docs-community Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Documentation build overview

📚 proTES | 🛠️ Build #35554558 | 📁 Comparing 5f4329d against latest (fdf1e6d)

  🔍 Preview build  

1 file changed
± contributing/index.html

@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 (fdf1e6d) to head (5f4329d).

Additional details and impacted files
@@            Coverage Diff            @@
##               dev      #373   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           23        23           
  Lines         2234      2234           
=========================================
  Hits          2234      2234           

☔ 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.

mypy rejects the lookup of the key that PyYAML parses `on` to
(True). Look it up by its string form.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@uniqueg
uniqueg marked this pull request as ready for review November 1, 2026 05:27

@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 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="65-66" />
<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>
**Invalid Dependabot titles bypass the gate**

When a human changes a Dependabot PR title to an invalid value and Dependabot later synchronizes, reopens, or sends a non-title edit, `job.if` requires `github.event.changes.title` for the bot event, so the `title` job is skipped and the gate's unconditional `title` allowance lets `CI passed` succeed with the invalid current title.

Run the title check for later Dependabot events as well, so the gate cannot pass without checking the current title.

Also at `.github/workflows/ci.yml:605`.
</issue_to_address>

### Comment 2
<location path=".github/workflows/ci.yml" line_range="48-49" />
<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>
**Older edit runs report success**

When a title-free PR edit starts with a valid title, then the title changes to an invalid value while that run is still active and the title-check run fails, the title-free edit gets a separate concurrency group, so it is not canceled by the title edit; its run checks the earlier valid title and can report `CI passed` for the same commit after the current title check fails.

Put title-free edit runs and title-edit runs for the same PR in the same concurrency group so the title edit cancels the earlier run.
</issue_to_address>

### Comment 3
<location path=".github/workflows/ci.yml" line_range="45-50" />
<code_context>
+# the run for the pull request's commit
 concurrency:
-  group: ${{ github.workflow }}-${{ github.event_name == 'push' && github.sha || github.ref }}
+  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 title events pass the gate**

When two title edits arrive out of order, with an older event carrying a valid title starting after a newer event carrying an invalid title, the concurrency group cancels the currently running check when an older title-edit event starts later, and the title action can validate that event’s stale title. The gate can then pass for the unchanged commit even though the current PR title is invalid.

Before reporting success, validate the current PR title or otherwise ensure a run cannot pass using a superseded title.
</issue_to_address>

Linked issues

#371 ci: check PR titles under the gate · 7 of 7 met

# Requirement Status Notes
1 Add the title job using the shared pr-title action pinned to the latest release. ✅ Met The PR title job uses the shared action pinned to a commit labeled v1.0.0.
2 Add title to the CI passed gate's needs and allow it to be skipped. ✅ Met The gate needs title and includes it in allow-skipped.
3 Run the workflow when a pull request is edited. ✅ Met The pull_request event includes edited.
4 Use a separate concurrency group for edits that do not change the title. ✅ Met Title-unchanged edits use a group suffixed with -edited, separate from the pull request's commit run.
5 Skip the title job on pushes and for Dependabot, unless someone else edits the title. ✅ Met The job condition restricts it to pull requests and skips Dependabot unless the title changed and the sender is not Dependabot.
6 Set permissions: {} for the title job. ✅ Met
7 Mention the title check in the contributing or development docs. ✅ Met The contributing page says CI checks the PR title and rechecks it after edits.

Sourcery assessment

Approval pending. 3 findings to address first.

Blocking findings: .github/workflows/ci.yml:66, .github/workflows/ci.yml:49, .github/workflows/ci.yml:50


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

Comment thread .github/workflows/ci.yml Resolved
Comment thread .github/workflows/ci.yml Resolved
Comment thread .github/workflows/ci.yml Resolved
@uniqueg
uniqueg merged commit 6b970ac into dev Nov 1, 2026
51 of 56 checks passed
@uniqueg
uniqueg deleted the ci/pr-title-check branch November 1, 2026 05:36
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