Skip to content

ci: check PR titles under the gate - #41

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

uniqueg merged 1 commit 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 here is inline: its jq check now also counts a skipped title as passed; everything else is unchanged (test may 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

  • yq parses the workflow; needs as intended.
  • The gate's jq program, run locally on sample needs objects: title skipped passes; title failed fails; test skipped with affected plugins fails; test and title skipped with no affected plugins passes.
  • 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 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:

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

Enhancements:

  • Update the CI gate to account for the title check and rerun title validation when pull requests are edited.
  • Refine workflow concurrency handling for pull request edits without title changes.

CI:

  • Run CI for pull request edit events while skipping title validation on pushes and eligible Dependabot events.

Documentation:

  • Document the pull request title check 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, 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]>
@sourcery-ai

sourcery-ai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

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

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

Flow diagram for CI gate skip handling

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

File-Level Changes

Change Details Files
Adds a pinned pull-request title validation job and includes its outcome in the required CI gate.
  • Runs the shared pr-title action at the v1.0.0 commit with no permissions.
  • Skips validation on pushes and Dependabot PRs, except when a non-Dependabot actor edits a Dependabot title.
  • Treats an intentionally skipped title check as passing while preserving existing test-skip rules.
.github/workflows/ci.yml
Updates pull-request event handling and concurrency so title edits trigger an appropriate CI run.
  • Adds the edited pull-request event.
  • Uses a separate concurrency group for edits that do not change the title, avoiding cancellation of commit-based runs.
.github/workflows/ci.yml
Documents automated title validation and reruns in the contribution guidelines.
  • Notes the PR title job and that CI rechecks titles after edits.
docs/contributing.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

@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 (038ccfd) to head (cda6099).
⚠️ Report is 1 commits behind head on dev.

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           
Flag Coverage Δ
foca-plugin-generic-example-noop 100.00% <ø> (ø)
foca-plugin-generic-routing-random 100.00% <ø> (ø)
foca-plugin-tes-routing-distance 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 05:41

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


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
@uniqueg
uniqueg merged commit 9eda532 into dev Nov 1, 2026
144 checks passed
@uniqueg
uniqueg deleted the ci/pr-title-check branch November 1, 2026 05: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