fix(ci): Relax branch-name lint to allow prefixes #2907
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#2905 surfaced an issue where the branch name link was overly restrictive in allowing the Jira ticket ID to only appear at the start of the branch name. This PR addresses that by allowing the ID to appear anywhere in the branch name. As an additional guard, we check for specific project keys, as otherwise the regex would likely have too many false positives.
Greptile Overview
Updated On: 2025-10-20 07:46:25 UTC
Greptile Summary
This PR relaxes the branch name validation rules in the CI workflow to allow Jira ticket IDs (like FXC-1234) to appear anywhere in branch names, not just at the beginning. Previously, developers had to name branches like
FXC-1234-feature-name, which prevented common patterns likeusername/FXC-1234-feature-name. The change introduces an allowlist of known Jira project keys (FXC, SCEM) to prevent false positives from overly permissive matching. The validation logic now dynamically constructs a regex pattern from the allowed projects array and applies it to the entire branch name. If the branch name doesn't contain a Jira key, the existing fallback to check the PR title remains intact, ensuring compatibility with current workflows while adding flexibility for developer-prefixed branch names.Changed Files
Confidence score: 5/5
Sequence Diagram
sequenceDiagram participant User participant GitHub participant DetermineScope as "determine-test-scope" participant Lint participant Zizmor participant BranchLint as "lint-branch-name" participant CommitLint as "lint-commit-messages" participant SchemaVerify as "verify-schema-change" participant LocalTests as "local-tests" participant RemoteTests as "remote-tests" participant FinalCheck as "pr-requirements-pass" User->>GitHub: Trigger workflow (PR/Review/Dispatch/Merge) GitHub->>DetermineScope: Start job DetermineScope->>GitHub: Check PR approval status GitHub-->>DetermineScope: Return approval state DetermineScope->>DetermineScope: Determine test scope based on event & approval DetermineScope-->>GitHub: Output test flags (code_quality, local, remote, pr_review) par Code Quality Tests (if enabled) DetermineScope->>Lint: Trigger linting Lint->>Lint: Run ruff format & check Lint-->>GitHub: Report result DetermineScope->>Zizmor: Trigger security analysis Zizmor->>Zizmor: Run zizmor workflow scan Zizmor->>GitHub: Upload SARIF results Zizmor-->>GitHub: Report result DetermineScope->>CommitLint: Trigger commit message lint CommitLint->>CommitLint: Validate conventional commits CommitLint-->>GitHub: Report result DetermineScope->>SchemaVerify: Trigger schema verification SchemaVerify->>SchemaVerify: Regenerate schemas & compare SchemaVerify->>SchemaVerify: Check schema diff vs base branch SchemaVerify->>SchemaVerify: Verify allowed changes for version SchemaVerify-->>GitHub: Report result end par PR Review Tests (if enabled) DetermineScope->>BranchLint: Trigger branch name lint BranchLint->>BranchLint: Extract branch name BranchLint->>BranchLint: Check for Jira key or exempt prefix BranchLint-->>GitHub: Report result end par Local Tests (if enabled) DetermineScope->>LocalTests: Trigger local tests LocalTests->>LocalTests: Install dependencies (Python 3.10, 3.13) LocalTests->>LocalTests: Run pytest with coverage LocalTests->>LocalTests: Generate diff-coverage report LocalTests->>GitHub: Post coverage comment to PR LocalTests-->>GitHub: Report result end par Remote Tests (if enabled) DetermineScope->>RemoteTests: Trigger remote tests RemoteTests->>RemoteTests: Install dependencies (Python 3.10-3.13, multi-OS) RemoteTests->>RemoteTests: Run doctests RemoteTests->>RemoteTests: Run pytest with coverage RemoteTests->>GitHub: Create coverage badge (if develop branch) RemoteTests-->>GitHub: Report result end GitHub->>FinalCheck: Trigger final validation FinalCheck->>FinalCheck: Check all required job results alt All checks passed FinalCheck-->>GitHub: ✅ Success GitHub-->>User: All required jobs passed else Any check failed FinalCheck-->>GitHub: ❌ Failure GitHub-->>User: One or more jobs failed end