Skip to content

Conversation

@jlogeart
Copy link
Contributor

@jlogeart jlogeart commented Nov 13, 2025

Resolves FDN-4209

This PR adds the pr-validator workflow to ensure PRs have associated JIRA tickets.

Summary by CodeRabbit

  • Chores
    • Updated PR validation workflow with refined title format requirements and simplified validation logic.

Copilot AI review requested due to automatic review settings November 13, 2025 17:17
@coderabbitai
Copy link

coderabbitai bot commented Nov 13, 2025

📝 Walkthrough

Walkthrough

Updated PR validator workflow to remove label guards, replace Jira pattern validation with stricter title-only format requirements (3+ uppercase letters, hyphen, 3–6 digits, no all-zero trailing numbers), and simplify error handling to emit single descriptive messages.

Changes

Cohort / File(s) Change Summary
Workflow Configuration
\.github/workflows/pr-validator\.yml
Removed PR label guard condition; replaced Jira title/description pattern with new title-focused pattern enforcing uppercase-letters-hyphen-digits format; removed description validation; simplified validation flow to title-only checks; adjusted error handling from array-based to single descriptive message

Sequence Diagram(s)

sequenceDiagram
    participant GH as GitHub
    participant WF as Workflow
    participant VAL as Validator
    
    rect rgb(220, 240, 255)
    Note over WF: Previous Flow (Removed)
    GH->>WF: PR opened/edited
    WF->>VAL: Check PR labels
    VAL-->>WF: Label validation
    WF->>VAL: Check title & description
    VAL-->>WF: Pattern match result
    WF-->>GH: Success or array of errors
    end
    
    rect rgb(240, 255, 240)
    Note over WF: New Flow (Simplified)
    GH->>WF: PR opened/edited
    WF->>VAL: Check PR title only
    VAL->>VAL: Match: 3+ uppercase + hyphen + 3-6 digits<br/>(no all-zeros)
    alt Pattern matches
        VAL-->>WF: Valid
        WF-->>GH: ✓ Pass
    else Pattern fails
        VAL-->>WF: Single error message
        WF-->>GH: ✗ Fail with message
    end
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify new Jira pattern regex correctly enforces 3+ uppercase letters, hyphen, and 3–6 digits without all-zero trailing numbers
  • Confirm removal of label guard condition and description validation are intentional design decisions
  • Check error message clarity and single-message error handling implementation

Pre-merge checks

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'FDN-4209 Update pr-validator workflow' accurately reflects the main change: updating the pr-validator workflow file with new validation patterns and simplified logic.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 01a2f2e and 9985d23.

📒 Files selected for processing (1)
  • .github/workflows/pr-validator.yml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Jenkins
🔇 Additional comments (2)
.github/workflows/pr-validator.yml (2)

19-23: Regex pattern correctly implements all JIRA ticket validation requirements.

The pattern /^[A-Z]{3,}-(?!0+\b)\d{3,6}\b/ properly enforces:

  • 3+ uppercase letters at the start
  • 3–6 digits after the hyphen
  • Exclusion of all-zero tickets via the negative lookahead (?!0+\b) (rejects "ABC-000" but accepts "ABC-0001")
  • Word boundary check to prevent partial matches

The pattern correctly matches valid JIRA tickets like "FDN-4209" while rejecting malformed ones, and allows trailing text in the title (e.g., "FDN-4209 Update workflow").


29-35: Error message is clear and error handling is appropriate.

The single consolidated error message (line 32) effectively explains all validation constraints and provides helpful examples. Using core.setFailed() correctly fails the workflow when validation fails.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

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

This PR updates the pr-validator GitHub Actions workflow to enforce stricter JIRA ticket requirements in pull request titles, removing the previous option to include tickets in descriptions instead.

Key changes:

  • Removes the scala-steward label exception that previously bypassed validation
  • Enforces JIRA ticket format exclusively in PR titles (no longer accepts tickets in descriptions)
  • Implements a stricter regex pattern requiring 3+ uppercase letters, 3-6 digit numbers, and rejecting all-zero ticket numbers

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

@flow-tech
Copy link
Contributor

Copy link
Contributor

@mikeclimbrock mikeclimbrock left a comment

Choose a reason for hiding this comment

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

lgtm

@jlogeart jlogeart merged commit 66dba2f into main Nov 13, 2025
14 checks passed
@jlogeart jlogeart deleted the FDN-4209-add-pr-validator-workflow branch November 13, 2025 20:31
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