Skip to content

[TTAHUB-5247] Enforce approved Jira issue link on PRs via CI check#3662

Merged
kryswisnaskas merged 18 commits into
mainfrom
kw/ttahub-5247
Jun 4, 2026
Merged

[TTAHUB-5247] Enforce approved Jira issue link on PRs via CI check#3662
kryswisnaskas merged 18 commits into
mainfrom
kw/ttahub-5247

Conversation

@kryswisnaskas

@kryswisnaskas kryswisnaskas commented May 29, 2026

Copy link
Copy Markdown
Collaborator

Description of change

Adds a CI workflow and validation script that fails PRs to main missing a valid TTAHUB-NNNN key in the Issue(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-0 is left in or the section is missing, and passes when a real TTAHUB-NNNN key is present.

Issue(s)

Checklists

Every PR

  • Linked approved Jira issue
  • JIRA issue status updated
  • Code is meaningfully tested
  • [n/a] Meets accessibility standards (WCAG 2.1 Levels A, AA)
  • API Documentation updated
  • [n/a] Boundary diagram updated
  • [n/a] Logical Data Model updated
  • [n/a] Architectural Decision Records written for major infrastructure decisions
  • [n/a] UI review complete
  • QA review complete

Before merge to main

  • [n/a] OHS demo complete
  • Ready to create production PR

Copilot AI review requested due to automatic review settings May 29, 2026 20:28
@kryswisnaskas kryswisnaskas marked this pull request as draft May 29, 2026 20:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 Link workflow 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.

Comment thread tools/pr-jira-issue-link.js Outdated
Comment thread tools/pr-jira-issue-link.js
Comment thread .github/workflows/pr-jira-issue-link.yml
Comment thread tools/pr-jira-issue-link.test.js
@tommaroh

Copy link
Copy Markdown
Collaborator

Might be better to parse this out of the title rather than the body, that is how the Jira integration works

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown

⚠️ Review count advisory: 1 of 2 required human approvals. 1 more needed. Current approvers: thewatermethod.

@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown

Diff size: 292 lines — within the 500-line guideline.

@kryswisnaskas

Copy link
Copy Markdown
Collaborator Author

Might be better to parse this out of the title rather than the body, that is how the Jira integration works

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Comment thread .github/workflows/pr-jira-issue-link.yml
@kryswisnaskas kryswisnaskas marked this pull request as ready for review June 1, 2026 22:04
@kryswisnaskas kryswisnaskas changed the title Enforce approved Jira issue link on PRs via CI check [TTAHUB-5247] Enforce approved Jira issue link on PRs via CI check Jun 1, 2026

@thewatermethod thewatermethod left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

@kryswisnaskas

Copy link
Copy Markdown
Collaborator Author

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, TTAHUB-1234 happens to be a different ticket in Done status. I’ll update the wording so it matches what the check really does. If we want real Jira validation, that could be separate follow-up work.

@kryswisnaskas kryswisnaskas added this pull request to the merge queue Jun 4, 2026
Merged via the queue into main with commit 22b98cb Jun 4, 2026
13 checks passed
@kryswisnaskas kryswisnaskas deleted the kw/ttahub-5247 branch June 4, 2026 15:12
@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown

📊 Review Metrics

Auto-generated by the PR Review Metrics workflow. Observe-only — no action required.

Metric Value
PR Status ✅ Merged
Reviewer Count 1
Reviewers @thewatermethod
First-Review Turnaround 19.5 hr
Total Review Events 1

Review Timeline

State Reviewer Submitted At
✅ APPROVED @thewatermethod 2026-06-02 17:35 UTC

hardwarehuman pushed a commit that referenced this pull request Jun 4, 2026
…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>
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.

4 participants