Skip to content

Conversation

nirinchev
Copy link
Contributor

@nirinchev nirinchev commented Oct 24, 2024

Description

This adds two validations for the PR titles:

  1. Conventional commit style - since the commit message of the squashed commit is typically the PR title, this will ensure that our commits follow the correct style in the majority of the cases.
  2. Jira ticket presence. Right now it forces the Jira ticket to be at the end of the title, but open to making it more flexible.

Checklist

Motivation and Context

  • Bugfix
  • New feature
  • Dependency update
  • Misc

Open Questions

Dependents

Types of changes

  • Backport Needed
  • Patch (non-breaking change which fixes an issue)
  • Minor (non-breaking change which adds functionality)
  • Major (fix or feature that would cause existing functionality to change)

@nirinchev nirinchev added the no-title-validation Skips validation of PR titles (conventional commit adherence + JIRA ticket inclusion) label Oct 24, 2024
@nirinchev nirinchev changed the title build: Add github action for PR title validation Add github action for PR title validation Oct 24, 2024
@nirinchev nirinchev removed the no-title-validation Skips validation of PR titles (conventional commit adherence + JIRA ticket inclusion) label Oct 24, 2024
@nirinchev nirinchev changed the title Add github action for PR title validation build: Add github action for PR title validation VSCODE-642 Oct 24, 2024
- name: Enforce JIRA ticket in title
uses: realm/ci-actions/title-checker@main
with:
regex: 'VSCODE-[0-9]{1,5}$'
Copy link
Contributor

Choose a reason for hiding this comment

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

It happens sometimes that we have tickets in one JIRA project that are touching multiple repos at the same time, should we extend this to allow all three (MONGOSH, COMPASS, VSCODE) or is the expectation now that we're supposed to open separate tickets when this happens?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, I would vote for flexible behavior when no Jira tickets or multiple tickets are allowed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fair enough. I've relaxed the regex to look for something that looks like a JIRA ticket - LMK if that makes sense to you. The exact values I've chosen are somewhat arbitrary - I chose them as {min(projectName.length) - 2, max(projectName.length) + 2}, but happy to tweak them.

Copy link
Contributor

Choose a reason for hiding this comment

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

Dependabot PRs won't have a Jira ticket chore(deps): bump the driver group with 2 updates. Changelog PRs as well chore: update CHANGELOG.md. Sometimes there are PRs with one line change, e.g. spelling mistakes. Those don't even require approval to be merged, so I don't think a ticket is worth creating in these cases. Could we enforce Jira tickets for feat and fix prefixes only?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Enforcing for particular prefix is not super easy, so I figured I'll just skip the Jira ticket check for bot PRs.

Copy link
Contributor

Choose a reason for hiding this comment

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

What about tiny PRs that do not have a corresponding ticket?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You can add the no-title-validation label (or just merge with the check failing).

@nirinchev nirinchev merged commit 3141f33 into main Oct 25, 2024
5 of 6 checks passed
@nirinchev nirinchev deleted the ni/title-validation branch October 25, 2024 14:55
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