Skip to content

TPT-4298: Added PR title checking to lint workflow and clean up release notes workflow#138

Merged
ezilber-akamai merged 2 commits intolinode:mainfrom
ezilber-akamai:TPT-4298-jira-id-in-prs
Apr 1, 2026
Merged

TPT-4298: Added PR title checking to lint workflow and clean up release notes workflow#138
ezilber-akamai merged 2 commits intolinode:mainfrom
ezilber-akamai:TPT-4298-jira-id-in-prs

Conversation

@ezilber-akamai
Copy link
Copy Markdown
Contributor

📝 Description

Added a new step in the lint workflow to fail if the PR title does not begin with "TPT-1234:" (works with and without a space between the colon and description).

Also added a new workflow to run upon release publish to edit the release notes to remove the Jira ticket ID prefixes from patch notes.

✔️ How to Test

To test the PR title enforcement, edit the title of this PR to remove the Jira ticket ID and rerun the lint job. It should fail immediately. Then, add the Jira ticket ID back to the PR title and it should pass.

To test the release note cleanup job, check out this PR locally and merge it into your fork. Then, cut a test release to your fork. Upon generating the release notes, the TPT-**** prefix will still be there. Publish the release and verify that the new workflow is triggered. After it finishes, confirm that the release notes were correctly updated.

@ezilber-akamai ezilber-akamai requested a review from a team as a code owner March 31, 2026 14:26
@ezilber-akamai ezilber-akamai added the repo-ci-improvement for improvements in the repository or CI workflow in the changelog. label Mar 31, 2026
@ezilber-akamai ezilber-akamai requested review from mgwoj and yec-akamai and removed request for a team March 31, 2026 14:26
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds automation to enforce Jira-style PR titles and to clean Jira ticket prefixes out of published release notes.

Changes:

  • Add a CI step to validate PR titles follow a TPT-1234:-style prefix (with label-based exemptions).
  • Add a new workflow triggered on release publish to strip TPT-####: prefixes from release notes.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
.github/workflows/ci.yml Introduces PR title validation step and scopes job permissions.
.github/workflows/clean-release-notes.yml Adds a release-published workflow that edits release notes to remove TPT-####: prefixes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/ci.yml
Comment on lines +28 to +31
# Override the default header pattern to allow hyphens and digits in the type
# (e.g. "TPT-4298: Description"). The default pattern only matches word
# characters (\w) which excludes hyphens.
headerPattern: '^([\w-]+):\s?(.*)$'
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

headerPattern currently allows any type segment (any [\w-]+) and does not itself enforce the intended TPT-<digits> prefix. This makes the title validation logic harder to reason about and more brittle (it relies on the separate types setting to fully constrain the pattern). Consider encoding the full requirement directly in headerPattern (e.g., only match TPT-\d+ and require a non-empty subject), so a single regex defines the contract.

Suggested change
# Override the default header pattern to allow hyphens and digits in the type
# (e.g. "TPT-4298: Description"). The default pattern only matches word
# characters (\w) which excludes hyphens.
headerPattern: '^([\w-]+):\s?(.*)$'
# Override the default header pattern to enforce the "TPT-<digits>: Description"
# format (e.g. "TPT-4298: Description") and require a non-empty subject.
headerPattern: '^TPT-(\d+):\s+(.+)$'

Copilot uses AI. Check for mistakes.
Comment on lines +20 to +35
let body = release.body;

if (!body) {
console.log("Release body empty, nothing to clean.");
return;
}

// Remove ticket prefixes like "TPT-1234: " or "TPT-1234:"
body = body.replace(/TPT-\d+:\s*/g, '');

await github.rest.repos.updateRelease({
owner: context.repo.owner,
repo: context.repo.repo,
release_id: release.id,
body: body
});
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

This workflow always calls repos.updateRelease even when the regex replacement doesn't change the body. Consider comparing the cleaned body to the original and returning early if there are no changes to avoid an unnecessary write to the Releases API (and reduce noise/permission usage).

Copilot uses AI. Check for mistakes.
@ezilber-akamai ezilber-akamai merged commit 5448108 into linode:main Apr 1, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

repo-ci-improvement for improvements in the repository or CI workflow in the changelog.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants