Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(MWPW-162733): enforce JIRA ticket number in PR title scope #202

Merged
merged 11 commits into from
Nov 20, 2024

Conversation

sanrai
Copy link
Collaborator

@sanrai sanrai commented Nov 19, 2024

Overview

Enforces consistent PR title format requiring JIRA ticket numbers to be in the scope section of the conventional commit format. For example: feat(MWPW-123): add feature

Changes

  • Added commitlint configuration to enforce JIRA ticket in scope
  • Updated GitHub Action workflow to validate PR titles
  • Ensures format type(MWPW-XXX): description is followed

Testing Instructions

  1. Create a new PR with these incorrect formats (should fail):

    • feat: add feature
    • feat(foo): add feature
    • feat: MWPW-123 add feature
  2. Create a PR with these correct formats (should pass):

    • feat(MWPW-123): add feature
    • fix(MWPW-456): fix bug
  3. Try editing an existing PR title to an invalid format - check that the status check fails

Test Instructions

Prerequisites

  1. Clone the repository
  2. Install dependencies: npm install
  3. Ensure you have GitHub access to create PRs

Test Cases

1. Invalid PR Title Formats (Should Fail)

Create PRs with these titles and verify they fail the check:

  • feat: add new feature
  • feat(frontend): add feature
  • MWPW-123 feat: add feature
  • feat: MWPW-123 add feature
  • feat(MWPW): add feature
  • feat(MWPW-ABC): add feature

2. Valid PR Title Formats (Should Pass)

Create PRs with these titles and verify they pass the check:

  • feat(MWPW-123): add feature
  • fix(MWPW-456): fix bug
  • docs(MWPW-789): update readme
  • chore(MWPW-101): update dependencies

3. PR Title Editing

  1. Create a PR with valid title: feat(MWPW-123): add feature
  2. Edit the PR title to invalid format: feat: add feature
  3. Verify check fails after edit
  4. Edit back to valid format and verify check passes

4. Local Development Check

  1. Make local commits with any format
  2. Verify local commits aren't affected by this change
  3. Only PR titles should be enforced

5. Edge Cases

Test these scenarios:

  • Numbers in description: feat(MWPW-123): fix 404 error
  • Special characters: feat(MWPW-123): add @ symbol support
  • Long descriptions: feat(MWPW-123): add very long feature description that spans multiple words

Expected Results

  • GitHub Actions check should appear on PR page
  • Failed checks should show clear error message about required format
  • Local development workflow should not be affected
  • Check should re-run automatically when PR title is edited

How to Report Issues

If you find any issues:

  1. Screenshot the error
  2. Note the PR title used
  3. Document any error messages
  4. Create a bug ticket with prefix MWPW-

Resolves: MWPW-162733

@sanrai sanrai changed the title Test feat(MWPW-1234): enforce pr title to follow commit lint Nov 19, 2024
@sanrai sanrai changed the title feat(MWPW-1234): enforce pr title to follow commit lint feat(foo): enforce pr title to follow commit lint [MWPW-1234] Nov 19, 2024
@sanrai sanrai changed the title feat(foo): enforce pr title to follow commit lint [MWPW-1234] feat(foo): enforce pr title to follow commit lint Nov 19, 2024
@sanrai sanrai changed the title feat(foo): enforce pr title to follow commit lint feat(foo): enforce pr title to follow commit lint asASs Nov 19, 2024
@sanrai sanrai changed the title feat(foo): enforce pr title to follow commit lint asASs feat(foo): enforce pr title to follow commit lint BAR Nov 19, 2024
@raissanjay raissanjay changed the title feat(foo): enforce pr title to follow commit lint BAR feat(foo): enforce pr title to follow commit lint Nov 19, 2024
@raissanjay raissanjay changed the title feat(foo): enforce pr title to follow commit lint feat(foo): enforce pr title to follow commit lint 2 Nov 19, 2024
@sanrai sanrai changed the title feat(foo): enforce pr title to follow commit lint 2 feat(foo): enforce pr title to follow commit lint 3 Nov 19, 2024
@sanrai sanrai changed the title feat(foo): enforce pr title to follow commit lint 3 feat(foo): enforce pr title to follow commit lint MWPW-123 Nov 19, 2024
@sanrai sanrai changed the title feat(foo): enforce pr title to follow commit lint MWPW-123 feat(foo): enforce pr title to follow commit lint Nov 19, 2024
@sanrai sanrai changed the title feat(foo): enforce pr title to follow commit lint feat(MWPW-123): enforce pr title to follow commit lint Nov 19, 2024
@sanrai sanrai changed the title feat(MWPW-123): enforce pr title to follow commit lint feat(MWPW-123): Enforce JIRA ticket number in PR title scope Nov 19, 2024
@sanrai sanrai changed the title feat(MWPW-123): Enforce JIRA ticket number in PR title scope feat(MWPW-162733): Enforce JIRA ticket number in PR title scope Nov 19, 2024
@raissanjay raissanjay changed the title feat(MWPW-162733): Enforce JIRA ticket number in PR title scope feat(MWPW-162733): enforce JIRA ticket number in PR title scope Nov 19, 2024
Copy link

Core Web Vitals Metrics

Metric Value
LCP 13015.90 s
FID 0.60 ms
CLS N/A

Recorded at: 2024-11-20T09:19:57.043Z
PR: #202

@raissanjay raissanjay merged commit f73f799 into main Nov 20, 2024
13 checks passed
Copy link

Core Web Vitals Metrics

Metric Value
LCP 15016.20 s
FID 0.60 ms
CLS N/A

Recorded at: 2024-11-22T08:35:50.382Z
PR: #202

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.

3 participants