[TTAHUB-5247] Enforce approved Jira issue link on PRs via CI check#3662
Conversation
Bumps [fast-xml-builder](https://github.com/NaturalIntelligence/fast-xml-builder) from 1.1.5 to 1.2.0. - [Changelog](https://github.com/NaturalIntelligence/fast-xml-builder/blob/main/CHANGELOG.md) - [Commits](NaturalIntelligence/fast-xml-builder@v1.1.5...v1.2.0) --- updated-dependencies: - dependency-name: fast-xml-builder dependency-version: 1.2.0 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com>
There was a problem hiding this comment.
Pull request overview
This PR adds a GitHub Actions CI check (plus a small Node validator + unit tests) to enforce that every non-production pull request includes at least one approved Jira issue link (https://jira.acf.gov/browse/TTAHUB-####) in the PR body’s Jira Issue(s) section, and updates the PR template + engineering docs to reflect the new requirement.
Changes:
- Add a new
PR Jira Issue Linkworkflow that validates the PR body on key PR events (opened/edited/synchronize/etc.). - Introduce a validator module + CLI wrapper to extract and validate the Jira Issue(s) section and provide actionable failure messages.
- Update the PR template, Slack notification workflow parsing, and engineering process documentation to use/recognize the
Jira Issue(s)heading.
Impact assessment:
- Benefits: Medium (improves traceability and process compliance with clear contributor feedback).
- Risks: Medium (new enforcement gate can block PRs; current implementation has a confirmed false-fail scenario that will affect normal template usage).
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
tools/validate-pr-jira-issue-link.js |
CLI entrypoint to validate PR body from PR_BODY env var. |
tools/pr-jira-issue-link.js |
Core parsing/validation logic for Jira Issue(s) section and URLs. |
tools/pr-jira-issue-link.test.js |
Unit tests covering pass/fail cases and backward-compatible headings. |
docs/guides/engineering-process.md |
Updates process guidance to require a dedicated Jira issue for every PR. |
.github/workflows/pr-notifications.yml |
Adjusts “Issue” section extraction to also match “Jira Issue”. |
.github/workflows/pr-jira-issue-link.yml |
New CI workflow enforcing the Jira link requirement. |
.github/pull_request_template.md |
Renames Issue(s) section to Jira Issue(s) and updates checklist language. |
|
Might be better to parse this out of the title rather than the body, that is how the Jira integration works |
|
|
|
✅ Diff size: 292 lines — within the 500-line guideline. |
I considered parsing from the title, but kept it in the PR body to stay consistent with the current template and existing automation, which already read Jira links from the PR body. It also supports linking multiple Jira issues in a more explicit way. |
thewatermethod
left a comment
There was a problem hiding this comment.
I confirmed that this functions as intended
Worth noting that any link will pass, I used TTAHUB-1234. So there is no "validity" check happening.
I think that’s right. This check only makes sure the PR has a Jira style link in the right section. It does not check whether the Jira issue actually exists or is the right one. In this case, |
📊 Review Metrics
Review Timeline
|
…3662) * Bump fast-xml-builder from 1.1.5 to 1.2.0 Bumps [fast-xml-builder](https://github.com/NaturalIntelligence/fast-xml-builder) from 1.1.5 to 1.2.0. - [Changelog](https://github.com/NaturalIntelligence/fast-xml-builder/blob/main/CHANGELOG.md) - [Commits](NaturalIntelligence/fast-xml-builder@v1.1.5...v1.2.0) --- updated-dependencies: - dependency-name: fast-xml-builder dependency-version: 1.2.0 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * [TTAHUB-5247] Enforce a Jira issue link on PRs via CI check * [TTAHUB-5247] Address PR feedback on Jira issue link validation * [TTAHUB-5247] Soften Jira issue link wording --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Description of change
Adds a CI workflow and validation script that fails PRs to
mainmissing a validTTAHUB-NNNNkey in theIssue(s)section of the PR body.How to test
Open a draft PR and check the "PR Jira Task Link" workflow in the Actions tab. Verify it fails with a clear message when the placeholder
TTAHUB-0is left in or the section is missing, and passes when a realTTAHUB-NNNNkey is present.Issue(s)
Checklists
Every PR
Before merge to main