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 label milestone check #2533

Merged
merged 1 commit into from
May 24, 2024
Merged

ci: Pr label milestone check #2533

merged 1 commit into from
May 24, 2024

Conversation

AlfredoG87
Copy link
Collaborator

@AlfredoG87 AlfredoG87 commented May 23, 2024

Description:

Related issue(s):

Fixes #2534

Notes for reviewer:
When the PR has no Labels:
image

When the PR has no Milestone:
image

When the associated Ticket has no milestone:

image

When everything has labels and milestones:
image

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

Copy link

github-actions bot commented May 23, 2024

Tests

    2 files  149 suites   13s ⏱️
833 tests 832 ✔️ 1 💤 0
845 runs  844 ✔️ 1 💤 0

Results for commit 8001a9a.

♻️ This comment has been updated with latest results.

@AlfredoG87 AlfredoG87 added the enhancement New feature or request label May 23, 2024
@AlfredoG87 AlfredoG87 added this to the 0.49.0 milestone May 23, 2024
@AlfredoG87 AlfredoG87 force-pushed the pr-label-milestone-check branch from fc37f65 to 436d6a5 Compare May 23, 2024 21:38
@AlfredoG87 AlfredoG87 closed this May 23, 2024
@AlfredoG87 AlfredoG87 force-pushed the pr-label-milestone-check branch from 436d6a5 to c6cfd6c Compare May 23, 2024 21:41
@AlfredoG87 AlfredoG87 reopened this May 23, 2024
Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@AlfredoG87 AlfredoG87 changed the title Pr label milestone check ci: Pr label milestone check May 23, 2024
@AlfredoG87 AlfredoG87 added the P3 label May 23, 2024
Copy link

github-actions bot commented May 23, 2024

Acceptance Tests

     23 files     363 suites   39m 38s ⏱️
   591 tests    583 ✔️   3 💤   5
1 367 runs  1 340 ✔️ 17 💤 10

Results for commit 8001a9a.

♻️ This comment has been updated with latest results.

@AlfredoG87 AlfredoG87 self-assigned this May 23, 2024
@AlfredoG87 AlfredoG87 marked this pull request as ready for review May 23, 2024 22:10
@AlfredoG87 AlfredoG87 requested a review from a team as a code owner May 23, 2024 22:10
@AlfredoG87 AlfredoG87 requested a review from quiet-node May 23, 2024 22:10
Copy link
Member

@quiet-node quiet-node left a comment

Choose a reason for hiding this comment

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

Great addition! Love it!

@quiet-node
Copy link
Member

@Nana-EC We should make this Required

@AlfredoG87 AlfredoG87 requested a review from Nana-EC May 24, 2024 02:41
Comment on lines +34 to +55
throw new Error('The PR has no labels.');
}
if (!prMilestone) {
throw new Error('The PR has no milestone.');
}

const issueNumberMatches = prBody.match(/#(\d+)/g);

if (!issueNumberMatches) {
console.log('No associated issues found in PR description.');
} else {
for (const match of issueNumberMatches) {
const issueNumber = match.replace('#', '');
const issue = await getIssueDetails(issueNumber);
const { labels: issueLabels, milestone: issueMilestone } = issue;

if (issueLabels.length === 0) {
throw new Error(`Associated issue #${issueNumber} has no labels.`);
}
if (!issueMilestone) {
throw new Error(`Associated issue #${issueNumber} has no milestone.`);
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@Nana-EC before merging, I want to confirm with you that both the issue(s) and the PR, need to have labels and milestones set.

Also, if there are no issue related, no problem, this is to allow PRs opened by Snyks and dependabot, as well as some cherry-picks and other PRs that usually don't have related issues.

@AlfredoG87
Copy link
Collaborator Author

AlfredoG87 commented May 24, 2024

@Nana-EC We should make this Required

I agree, but let's merge first it and leave it as non required for a couple weeks, just to validate that does not blocks things. And once we are confident that is not blocking any needed flow (that might need custom exceptions) we can set it as required.

@AlfredoG87 AlfredoG87 merged commit 2c3269d into main May 24, 2024
43 of 47 checks passed
@AlfredoG87 AlfredoG87 deleted the pr-label-milestone-check branch May 24, 2024 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request P3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PR Check for labels and tickets
2 participants