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

Automated changelog: remove Uncategorized header in output and place items at top #34037

Merged
merged 3 commits into from
Aug 12, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions bin/plugin/commands/changelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,10 @@ async function getChangelog( settings ) {

// Avoids double nesting such as "Documentation" feature under
// the "Documentation" section.
if ( group !== featureName ) {
if (
group !== featureName &&
featureName !== UNKNOWN_FEATURE_FALLBACK_NAME
) {
// Start new <ul> for the Feature group.
changelog += '#### ' + featureName + '\n';
}
Expand Down Expand Up @@ -709,11 +712,11 @@ async function getChangelog( settings ) {
function sortFeatureGroups( featureGroups ) {
return Object.keys( featureGroups ).sort(
( featureAName, featureBName ) => {
// Sort "Unknown" to always be at the end
// Sort "uncategorized" items to *always* be at the top of the section
if ( featureAName === UNKNOWN_FEATURE_FALLBACK_NAME ) {
return 1;
} else if ( featureBName === UNKNOWN_FEATURE_FALLBACK_NAME ) {
return -1;
} else if ( featureBName === UNKNOWN_FEATURE_FALLBACK_NAME ) {
return 1;
}

// Sort by greatest number of PRs in the group first.
Expand Down