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

ci(pr-convention-checks): add job to check for linked issues for pull requests #3376

Merged
merged 10 commits into from
Jan 19, 2024

Conversation

SanchithHegde
Copy link
Member

@SanchithHegde SanchithHegde commented Jan 17, 2024

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

This PR adds a new pull request CI check to ensure that all pull requests have at least one linked issue.

However, GitHub does not send any webhooks when a pull request is linked with an issue, so the check does not get triggered automatically when an issue is linked for a pull request which is already open. One way to trigger it manually is to update either the pull request title or description/body, and another is to push commits. Since pushing new commits tends to trigger all other checks, editing the pull request description might be preferable in such scenarios.

In addition, the PR includes the following changes:

  • Renames the conventional-commit-check.yml workflow file to pr-convention-checks.yml.
  • Removes the workflow code that labelled pull requests whose titles didn't follow conventional commit standards, since we no longer use the label for any purpose nowadays. It was initially added as a means to filter pull requests by that label, when we introduced the check.

The pull request can be reviewed one commit at a time for better understanding.

Motivation and Context

Closes #3375.

How did you test it?

Temporarily modified the trigger to be pull_request instead of pull_request_target to test the workflow.

  1. The check fails if the PR does not contain any linked issues.

    Screenshot of failed check due to absence of linked issues

    Link to check run: https://github.com/juspay/hyperswitch/actions/runs/7561263548/job/20589130650?pr=3376

  2. The check succeeds if the PR contains at least one linked issue.

    Screenshot of successful check run

    Link to check run: https://github.com/juspay/hyperswitch/actions/runs/7561509816/job/20589902417?pr=3376

  3. The check fails if any of the linked issues is closed.

    Screenshot of failed check run due to one of the issues being closed

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed the submitted code
  • I added unit tests for my changes where possible
  • I added a CHANGELOG entry if applicable

@SanchithHegde SanchithHegde added A-CI-CD Area: Continuous Integration/Deployment C-feature Category: Feature request or enhancement S-waiting-on-review Status: This PR has been implemented and needs to be reviewed labels Jan 17, 2024
@SanchithHegde SanchithHegde self-assigned this Jan 17, 2024
@SanchithHegde SanchithHegde requested a review from a team as a code owner January 17, 2024 20:12
Chethan-rao
Chethan-rao previously approved these changes Jan 18, 2024
ShankarSinghC
ShankarSinghC previously approved these changes Jan 18, 2024
…stead of `pull_request_target` event for testing

This reverts commit 98dc2fd.
@likhinbopanna likhinbopanna added this pull request to the merge queue Jan 19, 2024
Merged via the queue into main with commit 7a3d8d0 Jan 19, 2024
11 checks passed
@likhinbopanna likhinbopanna deleted the ci-pr-linked-issue-check branch January 19, 2024 06:54
@SanchithHegde SanchithHegde removed the S-waiting-on-review Status: This PR has been implemented and needs to be reviewed label Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-CI-CD Area: Continuous Integration/Deployment C-feature Category: Feature request or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CI] Add workflow to ensure a pull request contains at least one linked issue
4 participants