Skip to content

Filetered hotfix prs from release notes #3738

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

nitzanyiz
Copy link
Collaborator

@nitzanyiz nitzanyiz commented May 20, 2025

Description

Changed release notes generation script to ignore hot fixed prs.
Changed release notes generation so it will take hotfix prs when generating a patch release release notes.

Changelog

Infra - release notes generation script now excludes hot fixed prs.

Additional info

MADS-4718

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the release notes generation script to exclude hotfix pull requests from the generated release notes.

  • Adds the chalk dependency for console output styling
  • Filters out PRs labeled as hotfix with an accompanying console log message
  • Preserves the sorting and mapping of the PR data

Comment on lines 50 to 56
prs => _.filter(prs, pr => {
const isHotfix = pr.labels.some(label => label.name === 'hotfix');
if (isHotfix) {
console.log(chalk.bgYellow.black(`PR ${pr.number} is a hotfix and was excluded for the release notes.`));
}
return !isHotfix;
}),
Copy link
Preview

Copilot AI May 20, 2025

Choose a reason for hiding this comment

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

[nitpick] Consider separating the logging from the filtering logic to better adhere to the single-responsibility principle; logging inside the filter function can lead to unexpected side effects if the collection is processed multiple times.

Suggested change
prs => _.filter(prs, pr => {
const isHotfix = pr.labels.some(label => label.name === 'hotfix');
if (isHotfix) {
console.log(chalk.bgYellow.black(`PR ${pr.number} is a hotfix and was excluded for the release notes.`));
}
return !isHotfix;
}),
prs => {
// Log hotfix PRs
prs.forEach(pr => {
if (pr.labels.some(label => label.name === 'hotfix')) {
console.log(chalk.bgYellow.black(`PR ${pr.number} is a hotfix and was excluded for the release notes.`));
}
});
// Filter out hotfix PRs
return _.filter(prs, pr => !pr.labels.some(label => label.name === 'hotfix'));
},

Copilot uses AI. Check for mistakes.

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.

2 participants