Skip to content

ci: check PR titles under the gate - #583

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 now always allows title (and push publish as before when PUBLISH is "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

  • yq parses the workflow; needs and on as intended.
  • actionlint and pre-commit hooks could not run (actionlint not installed; pre-commit cannot fetch hook repos in the sandbox). CI runs the repo's checks.
  • End-to-end: this PR's own CI run PR title and CI passed passed 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:

  • Add pull request title validation to CI using the shared Conventional Commits title check.

Enhancements:

  • Include the PR title check in the CI gate and rerun CI when pull requests are edited.
  • Handle concurrency and intentional skips for pushes and Dependabot pull requests while preserving the required CI gate.

CI:

  • Run the title check with minimal permissions and pin the shared action to its v1.0.0 release.

Documentation:

  • Document the pull request title check and its behavior in the contributing guide.

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

sourcery-ai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

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

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

File-Level Changes

Change Details Files
Add a pull-request title validation job and make it part of the required CI gate.
  • Trigger CI on pull-request edits as well as opens, updates, and reopens.
  • Run the pinned shared PR-title action with no permissions, excluding pushes and Dependabot PRs except title edits by another actor.
  • Add the title job to the gate dependencies and allow its intentional skips while preserving existing publish skip behavior.
  • Document the title check and edit-time revalidation for contributors.
.github/workflows/ci.yml
docs/contributing.md
Adjust workflow concurrency to handle pull-request edits without canceling relevant commit runs.
  • Use distinct concurrency groups for pushes, title-changing edits, and edits that leave the title unchanged.
  • Continue canceling superseded pull-request runs while keeping push runs independent.
.github/workflows/ci.yml

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 (966cde3) to head (547bf79).

Additional details and impacted files
@@            Coverage Diff            @@
##               dev      #583   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           56        56           
  Lines         7068      7068           
=========================================
  Hits          7068      7068           
Flag Coverage Δ
test_unit 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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 04:09

@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="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


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
# Conflicts:
#	docs/contributing/index.md
@uniqueg
uniqueg merged commit 9055e87 into dev Nov 1, 2026
56 checks passed
@uniqueg
uniqueg deleted the ci/pr-title-check branch November 1, 2026 04:45
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