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

Automate grouping of release Changelog PRs by feature #33229

Merged
merged 14 commits into from
Jul 20, 2021

Conversation

getdave
Copy link
Contributor

@getdave getdave commented Jul 6, 2021

Description

Currently when facilitating a release of the Plugin, the release lead must manually assign each PR to "feature" and then organise into those features.

This is not a good task for humans as it takes a lot of time. This puts an undue burden on the release lead.

This PR attempts to automated this process. It does this by:

  • Taking each PR in a section (eg: Experiments, Bug fixes...etc).
  • Determining the most appropriate "feature" for that PR.
  • Sorting by most PRs in the feature.
  • Printing out each feature along with PRs in a nested list structure (as has been common in the most recent releases).
  • Check feature mapping even for Block specific or Feature specific issues - for example [Block] Legacy Widget should end up in Widgets Editor and not in Block Library.

The heuristic to determine the "feature" is very basic. Firstly, it prefers to use an arbitrary map of labels to "feature" to determine the most appropriate feature. If no mapping ius found then the following additional attempts at classification:

  • If the PR has a [Feature] label then use that feature name.
  • If the PR has a [Block] XXX label then use Block Library as the feature name.
  • Otherwise use Unknown.

Obviously the hardcoded map of labels => features is far from complete but that's simple enough and can be augmented over time. The goal of this PR is a stepping stone towards the optimal solution.

This is part of addressing #30538

How has this been tested?

If you want you can target a particular milestone using the format:

npm run changelog -- --milestone="Gutenberg 11.1"

Github has rate limits on the API so I suggest grabbing your Github developer token from https://github.com/settings/tokens and passing that in the --token arg:

npm run changelog -- --milestone="Gutenberg 11.1" --token=YOUR_TOKEN

Screenshots

Types of changes

New feature (non-breaking change which adds functionality)

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • I've tested my changes with keyboard and screen readers.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR (please manually search all *.native.js files for terms that need renaming or removal).

@getdave getdave added the [Type] Build Tooling Issues or PRs related to build tooling label Jul 6, 2021
@getdave getdave self-assigned this Jul 6, 2021
@gziolo gziolo requested review from priethor and gziolo July 6, 2021 17:52
Copy link
Contributor

@priethor priethor left a comment

Choose a reason for hiding this comment

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

I've check recent changelogs for more label mappings and here are a few more direct ones, I would say ordered by precedence:

  • 'REST API Interaction': 'REST API'
  • '[Package] Icons': 'Icons'
  • '[Feature] Design Tools': 'Design Tools'
  • '[Feature] Template Editing Mode': 'Template Editor'
  • '[Package] Edit Post": 'Post Editor'

These others would have precedence in the mappings:

  • '[Feature] Component System': Components
  • '[Package] Components: 'Components'

And these others usually are bundled together under "Block Editor" if they don't fit anywhere else (or, if the same label appears a lot in a single release, it might make sense to separate them on their own section in that release):

  • '[Feature] Inserter': 'Block Editor'
  • '[Package] Rich text': 'Block Editor'
  • '[Feature] Drag and Drop': 'Block Editor'
  • '[Feature] Block Multi Selection': 'Block Editor'
  • '[Feature] Link Editing': 'Block Editor'

bin/plugin/commands/changelog.js Outdated Show resolved Hide resolved
@github-actions

This comment has been minimized.

@getdave getdave requested a review from gwwar July 19, 2021 16:08
@getdave
Copy link
Contributor Author

getdave commented Jul 19, 2021

@gwwar As you are running the 11.1.0 release I'd like to compare the output of the updates made by this PR with what you eventually land on for a changelog.

Basically it tries to doing some basic sorting and grouping of PRs into "Features" within each section upfront. That should save the release lead time.

@priethor
Copy link
Contributor

priethor commented Jul 19, 2021

This is the raw changelog for 11.0.0-rc.1 11.1.0-rc.1 before polishing.

Features

  • Enable drag and drop in List View, fix performance issues. (33320)

Enhancements

  • Block Settings Menu: Don't render 'Move to' if there is only one block. (33158)
  • Experiment: Admin PWA. (33102)
  • Tag Cloud: Add ability to change number of tags shown. (32201)
  • Block Support: Set border style none when border width zero. (32080)
  • Block Support: Update border support UI. (31585)

New APIs

  • Add a SearchControl component and reuse accross the UI. (32935)

Bug Fixes

  • Close navigation sidebar when all posts clicked. (33393)
  • Fix API documentation for data reference guides. (33384)
  • Block Editor: Warn only in edit implementation when using useBlockProps. (33380)
  • Fix search block button position dropdown accessibility/UX issues. (33376)
  • Prevent color panel from showing as empty. (33369)
  • Update getTermsInfo() to workaround parsing issue for translatable strings. (33341)
  • Fix invisible Android activity indicator. (33337)
  • Decode entities in site title. (33323)
  • Border Support: Add support for custom border units. (33315)
  • Update conditions to hide duotone panel. (33295)
  • Prevent entering invalid values in the Query Loop block configuration. (33285)
  • Fix moving inner blocks in the Widgets Customizer. (33243)
  • Include missing attributes when upgrading embed block. (33235)
  • Duotone: Avoid rendering duplicate stylesheet and SVG. (33233)
  • Block editor: Iframe: Remove reset styles. (33204)
  • [Regression]: Fix breadcrumbs html structure and React warnings. (33159)
  • RN: Fix heading anchor control. (33125)
  • Fix inserter size on widgets screen header. (33118)
  • Button: Remove green background color in button preview. (33116)
  • Image Block: Improve "can switch to cover" check. (33095)
  • Fix slash command focus style. (33084)
  • RNMobile: Fix broken doc link. (33065)
  • Search: Update search block to handle per corner border radii. (33023)
  • Block editor: Move layout styles to document head (instead of rendering inline). (32083)
  • Rich text: Fix format deregistration. (31518)

Experiments

  • Specify what settings can be part of settings.layout. (33303)
  • Allow themes to provide empty values for color.duotone and spacing.units. (33280)
  • Refactor of navigation block rendering using location attribute. (33244)
  • Fix: Missing link color on style properties to css var mapping. (33150)
  • Fix: Preset variables not being user on the site editor. (33149)
  • Update theme.json documentation for WordPress 5.8. (33131)
  • Cover against non existing styles. (33127)
  • Pass block attributes with rendering with location. (33043)
  • Navigation Overlay: Improve handling of open overlay. (32886)
  • Try: Menu item placeholder inheritance. (32512)
  • Navigation Block: Add Color Options for Submenus. (31149)
  • Change Navigation block markup on front end only. (30551)

Documentation

  • Fix codetabs syntax in theme.json documentation. (33417)
  • Docs: Use markdown headings instead of links for API declarations. (33381)
  • Handbook: Update Gutenberg release documentation to clarify release post workflow. (33328)
  • Block Editor API: Changes to support multiple admin screens in WP 5.8. (33262)
  • Remove withState HOC references part 3. (33259)
  • Block API: Apply enhancements included in WordPress 5.8. (33252)
  • Handbook: Clarify the type of apiVersion in block metadata. (33249)
  • Fixes a typo in the documentation for block supports. (33247)
  • Remove withState HOC references part 2. (33222)
  • Admin PWA: Make readme private. (33216)
  • Remove withState HOC references. (33173)
  • Fixed bad image syntax and bold text. (32897)
  • Correct wrong setState call. (32808)

Code Quality

  • Packages: Hoist dependencies for WordPress packages. (33387)
  • Block Editor: Warn when useBlockProps hook used with a wrong Block API version. (33274)
  • Plugin: Remove deprecated APIs that are no longer supported in version 11.0. (33258)
  • Enforce isAlternate on ToolbarDropdownMenu. (33129)
  • Latest Posts block: Refactor to drop apiFetch usage in favor of using the data module. (33063)
  • components: Remove @emotion/css from ZStack. (33053)
  • Refactor the user autocompleter to avoid apiFetch and rely on the data module. (33028)
  • Box Control: Rename VerticalHorizontalInputControls to AxialInputControls. (33016)
  • List View: Restructure the BlockNavigation component. (31892)
  • Update: Stabilises GradientPicker and CustomGradientPicker components. (31440)
  • External image upload: Fix uncaught error. (24334)

Tools

  • Switch to new puppeteer APIs for emulating conditions. (33410)
  • Update end-to-end tests to use new puppeteer drag and drop api. (33386)
  • Skipping more end-to-end tests. (33353)
  • Skip unstable end-to-end tests. (33352)
  • Packages: Introduce release types to npm publishing script. (33329)
  • Upgrade puppeteer to 10.1. (33327)
  • Plugin: Introduce tools folder with configuration files. (33281)
  • Update CopyWebpackPlugin to v6. (33220)
  • Upgrade Storybook to v6.3. (33219)
  • Changelog generation: Remove “experimental” status from WP 5.8 stable items. (33214)
  • Use NPM caching built into action/setup-node. (33190)
  • Husky upgrade and git ignorance improved. (33183)
  • end-to-end Test Utils: Add some functionality to createUser and deleteUser. (33067)
  • end-to-end Tests: Add basic Site Title block coverage. (32868)
  • Workflows: Re-enable manually triggered workflows on forks. (32821)

Various

  • theme.json docs: Add examples and highlight backward compatibility. (33421)
  • Avoid calling gutenberg_ functions within code shipped through WordPress Core. (33331)
  • Latest posts: Remove grey color for dark themes. (33325)
  • Encode manifest data. (33310)
  • RSS Block: Update block styles. (33294)
  • Tag Cloud: Remove editor style so editor matches frontend. (33289)
  • Merge conflicting wp.editor objects into a single, non-conflicting module. (33228)
  • Add PanelBody for InspectorControls. (33227)
  • RNMobile: Add integration test to verify button block border radius functionality. (33211)
  • components: Add normalizeArrowKey. (33208)
  • components: Add mergeEventHandlers. (33205)
  • Mobile - Disable Slash inserter end-to-end. (33197)
  • Add link color control to list block. (33185)
  • Remove unnecessary function exists check on wp_filter_content_tags. (33182)
  • components: Add useCx. (33172)
  • Update documentation for link color in WordPress 5.8. (33162)
  • PostPublishButton: Disable if saving non-post entities. (33140)
  • components: Add useLatestRef hook. (33137)
  • Try: Polish labels and consolidate options in preferences. (33133)
  • Block editor settings endpoint - Remove experimental namespace. (33128)
  • Enable previously skipped widgets tests. (33121)
  • Improve high contrast mode rendering of icon buttons. (33062)
  • components: Remove @emotion/css from Divider. (33054)
  • Pattern Directory: Merge Core locale, caching updates. (33052)
  • Suppress block inserter focus loop. (33049)
  • Try: Small chevron icon for breadcrumb separators. (33042)
  • Add useControlledValue. (33039)
  • Widgets: Retrieve latest widgets before loading sidebars. (32997)
  • Add a "separator" attribute to post-terms block. (32812)
  • Add Unlink button to LinkControl popover. (32541)
  • Components: Promote g2 Popover as Flyout. (32197)
  • Mobile: Update image size picker. (31963)
  • Columns block: Add stack on mobile setting to allow for columns without mobile breakpoints. (31816)
  • Mobile - Global styles: Block-specific styles. (30997)

@getdave
Copy link
Contributor Author

getdave commented Jul 19, 2021

@priethor Thanks for the changlog. Is that 11.0.0 or 11.1.0?

At this point I guess what we need is to try and improve the list of labels to arbitrary feature groupings. This is easy using Github's "Suggestion" UI in the PR review process. We should be able to flesh this out.

The current mechanic for determining a feature for a given PR is:

  • Try lookup in feature mapping (hardcoded).
  • Check for [Feature] label and use that as the feature.
  • Check for [Block] X type label and assign Block Library as the feature.
  • Fallback to Unknown.

This means we can manually categorise but still have some basically classification as fallbacks. In the future we can get more sophisticated but for now this moves the needle to make things a little better than they are now.

Personally I don't think we need to get everything perfect for this PR to land. Even what we have now is probably better than what we have now in trunk. We can improve incrementally over time.

I think perhaps a code review from @gziolo or someone else familiar with the build tooling would be great.

@getdave getdave marked this pull request as ready for review July 19, 2021 18:33
@getdave
Copy link
Contributor Author

getdave commented Jul 19, 2021

FYI here's what I currently get for Gutenberg 11.1.0 (upcoming release) when I run the script. I think whilst not perfect it's pretty decent as a starting point for the release lead:


Features

  • Block Editor
    • Enable drag and drop in List View, fix performance issues. (33320)

Enhancements

  • Block Library

    • Block Settings Menu: Don't render 'Move to' if there is only one block. (33158)
    • Tag Cloud: Add ability to change number of tags shown. (32201)
  • Design Tools

    • Block Support: Set border style none when border width zero. (32080)
    • Block Support: Update border support UI. (31585)
  • Unknown

    • Experiment: Admin PWA. (33102)

New APIs

  • Components
    • Add a SearchControl component and reuse accross the UI. (32935)

Bug Fixes

  • Block Library

    • Fix search block button position dropdown accessibility/UX issues. (33376)
    • Prevent entering invalid values in the Query Loop block configuration. (33285)
    • Include missing attributes when upgrading embed block. (33235)
    • Duotone: Avoid rendering duplicate stylesheet and SVG. (33233)
    • RN: Fix heading anchor control. (33125)
    • Button: Remove green background color in button preview. (33116)
    • Image Block: Improve "can switch to cover" check. (33095)
  • Design Tools

    • Prevent color panel from showing as empty. (33369)
    • Border Support: Add support for custom border units. (33315)
    • Update conditions to hide duotone panel. (33295)
    • Search: Update search block to handle per corner border radii. (33023)
  • Block Editor

    • Writing flow: Allow select all from empty selection. (33446)
    • Image block: Fix replace link control styling. (33326)
    • Rich text: Fix format deregistration. (31518)
  • Components

    • Suggestion List: Check if a node exists to scroll into view. (33419)
  • Block API

    • Block Editor: Warn only in edit implementation when using useBlockProps. (33380)
  • Editor

    • Editor: Extract snackbars into a separate component. (33355)
  • Document Settings

    • Decode entities in site title. (33323)
  • Navigation Component

    • Navigation component: Fix item handling onClick twice. (33286)
  • Widgets Customizer

    • Fix moving inner blocks in the Widgets Customizer. (33243)
  • Block Breadcrumbs

    • [Regression]: Fix breadcrumbs html structure and React warnings. (33159)
  • Widgets Editor

    • Fix inserter size on widgets screen header. (33118)
  • Unknown

    • Add the percent unit to the default units in Core. (33468)
    • Autocomplete: Reset state for empty text. (33450)
    • Rich text: Run input rules after composition end. (33416)
    • Close navigation sidebar when all posts clicked. (33393)
    • Fix API documentation for data reference guides. (33384)
    • Update getTermsInfo() to workaround parsing issue for translatable strings. (33341)
    • Fix invisible Android activity indicator. (33337)
    • Block editor: Iframe: Remove reset styles. (33204)
    • Fix slash command focus style. (33084)
    • RNMobile: Fix broken doc link. (33065)
    • Block editor: Move layout styles to document head (instead of rendering inline). (32083)

Experiments

  • Block Library

    • Refactor of navigation block rendering using location attribute. (33244)
    • Pass block attributes with rendering with location. (33043)
    • Navigation Overlay: Improve handling of open overlay. (32886)
    • Try: Menu item placeholder inheritance. (32512)
    • Navigation Block: Add Color Options for Submenus. (31149)
    • Change Navigation block markup on front end only. (30551)
  • Unknown

    • Specify what settings can be part of settings.layout. (33303)
    • Allow themes to provide empty values for color.duotone and spacing.units. (33280)
    • Fix: Missing link color on style properties to css var mapping. (33150)
    • Fix: Preset variables not being user on the site editor. (33149)
    • Update theme.json documentation for WordPress 5.8. (33131)
    • Cover against non existing styles. (33127)

Documentation

  • Block API

    • Block API: Apply enhancements included in WordPress 5.8. (33252)
    • Handbook: Clarify the type of apiVersion in block metadata. (33249)
  • Unknown

    • Fix codetabs syntax in theme.json documentation. (33417)
    • Docs: Use markdown headings instead of links for API declarations. (33381)
    • Handbook: Update Gutenberg release documentation to clarify release post workflow. (33328)
    • Block Editor API: Changes to support multiple admin screens in WP 5.8. (33262)
    • Remove withState HOC references part 3. (33259)
    • Fixes a typo in the documentation for block supports. (33247)
    • Remove withState HOC references part 2. (33222)
    • Admin PWA: Make readme private. (33216)
    • Remove withState HOC references. (33173)
    • Fixed bad image syntax and bold text. (32897)
    • Correct wrong setState call. (32808)

Code Quality

  • Components

    • Enforce isAlternate on ToolbarDropdownMenu. (33129)
    • components: Remove @emotion/css from ZStack. (33053)
  • List View

    • List View: Restructure the BlockNavigation component. (31892)
  • Block Library

    • External image upload: Fix uncaught error. (24334)
  • Unknown

    • Packages: Hoist dependencies for WordPress packages. (33387)
    • Block Editor: Warn when useBlockProps hook used with a wrong Block API version. (33274)
    • Plugin: Remove deprecated APIs that are no longer supported in version 11.0. (33258)
    • Latest Posts block: Refactor to drop apiFetch usage in favor of using the data module. (33063)
    • Refactor the user autocompleter to avoid apiFetch and rely on the data module. (33028)
    • Box Control: Rename VerticalHorizontalInputControls to AxialInputControls. (33016)
    • Update: Stabilises GradientPicker and CustomGradientPicker components. (31440)

Tools

  • Block Library

    • end-to-end Tests: Add basic Site Title block coverage. (32868)
  • Unknown

    • Switch to new puppeteer APIs for emulating conditions. (33410)
    • Update end-to-end tests to use new puppeteer drag and drop api. (33386)
    • Skipping more end-to-end tests. (33353)
    • Skip unstable end-to-end tests. (33352)
    • Packages: Introduce release types to npm publishing script. (33329)
    • Upgrade puppeteer to 10.1. (33327)
    • Plugin: Introduce tools folder with configuration files. (33281)
    • Update CopyWebpackPlugin to v6. (33220)
    • Upgrade Storybook to v6.3. (33219)
    • Changelog generation: Remove “experimental” status from WP 5.8 stable items. (33214)
    • Use NPM caching built into action/setup-node. (33190)
    • Husky upgrade and git ignorance improved. (33183)
    • end-to-end Test Utils: Add some functionality to createUser and deleteUser. (33067)
    • Workflows: Re-enable manually triggered workflows on forks. (32821)

Various

  • Block Library

    • [Post Excerpt]: Fix excerpt_more filter conflict and remove wordCount attribute. (33366)
    • Latest posts: Remove grey color for dark themes. (33325)
    • RSS Block: Update block styles. (33294)
    • Tag Cloud: Remove editor style so editor matches frontend. (33289)
    • Add link color control to list block. (33185)
    • Mobile: Update image size picker. (31963)
    • Columns block: Add stack on mobile setting to allow for columns without mobile breakpoints. (31816)
  • Components

    • components: Add normalizeArrowKey. (33208)
    • components: Add mergeEventHandlers. (33205)
    • components: Add useCx. (33172)
    • components: Add useLatestRef hook. (33137)
    • components: Remove @emotion/css from Divider. (33054)
    • Add useControlledValue. (33039)
    • Components: Promote g2 Popover as Flyout. (32197)
  • Widgets Editor

    • Adds auxiliary class names for editor styles in the widgets editor. (33388)
    • Merge conflicting wp.editor objects into a single, non-conflicting module. (33228)
    • Enable previously skipped widgets tests. (33121)
    • Widgets: Retrieve latest widgets before loading sidebars. (32997)
  • Block Editor

    • Writing flow: Attempt to fix preview end-to-end failure. (33467)
    • Add Unlink button to LinkControl popover. (32541)
  • Themes

    • Update documentation for link color in WordPress 5.8. (33162)
  • Editor

    • PostPublishButton: Disable if saving non-post entities. (33140)
  • REST API

    • Block editor settings endpoint - Remove experimental namespace. (33128)
  • Block Breadcrumbs

    • Try: Small chevron icon for breadcrumb separators. (33042)
  • Unknown

    • Remove padding from Home Link block. (33461)
    • theme.json docs: Add examples and highlight backward compatibility. (33421)
    • Block editor: iframe: Load inline styles. (33389)
    • Avoid calling gutenberg_ functions within code shipped through WordPress Core. (33331)
    • Encode manifest data. (33310)
    • Add PanelBody for InspectorControls. (33227)
    • RNMobile: Add integration test to verify button block border radius functionality. (33211)
    • Mobile - Disable Slash inserter end-to-end. (33197)
    • Remove unnecessary function exists check on wp_filter_content_tags. (33182)
    • Try: Polish labels and consolidate options in preferences. (33133)
    • Improve high contrast mode rendering of icon buttons. (33062)
    • Pattern Directory: Merge Core locale, caching updates. (33052)
    • Suppress block inserter focus loop. (33049)
    • Add a "separator" attribute to post-terms block. (32812)
    • Mobile - Global styles: Block-specific styles. (30997)

@getdave getdave force-pushed the try/group-changelog-items-by-feature branch from a176389 to 9e19907 Compare July 19, 2021 18:55
Copy link
Member

@gziolo gziolo left a comment

Choose a reason for hiding this comment

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

I think that this PR is already a nice improvement as it groups changelog entries nicely. I would love to hear from @priethor about the shape of the changelog, but overall it goes in the direction we discussed.

I left some minor comments to consider, but it could be also done in a follow-up. I'm less concerned about the code because I can follow it and it isn't something that is going to be reused in other places. @getdave, in the places where you consider extracting functions you could also try using named functions and see if that makes it more readable.

bin/plugin/commands/changelog.js Outdated Show resolved Hide resolved
bin/plugin/commands/changelog.js Outdated Show resolved Hide resolved
bin/plugin/commands/changelog.js Show resolved Hide resolved
@priethor
Copy link
Contributor

@priethor Thanks for the changlog. Is that 11.0.0 or 11.1.0?

That's right, it's 11.1.0-rc.1. Edited and fixed it!

@getdave getdave changed the title Group Changelog items by feature Automated grouping of release Changelog PRs by feature Jul 20, 2021
@getdave getdave changed the title Automated grouping of release Changelog PRs by feature Automate grouping of release Changelog PRs by feature Jul 20, 2021
@getdave getdave merged commit d92e2ac into trunk Jul 20, 2021
@getdave getdave deleted the try/group-changelog-items-by-feature branch July 20, 2021 09:53
@github-actions github-actions bot added this to the Gutenberg 11.2 milestone Jul 20, 2021
@youknowriad
Copy link
Contributor

This is cool, saves a lot of time. That said the "uncategorized/unknown" sub title should be removed and its items just moved top-level (without any grouping) if possible.

@getdave
Copy link
Contributor Author

getdave commented Aug 5, 2021

This is cool, saves a lot of time. That said the "uncategorized/unknown" sub title should be removed and its items just moved top-level (without any grouping) if possible.

The idea is that it is made obvious you need to recategorise these items. Simple enough to do though if we want...

@youknowriad
Copy link
Contributor

I don't think all items need to be categorized 🤷‍♂️ In the last patch release, I just removed it for instance.

@getdave
Copy link
Contributor Author

getdave commented Aug 5, 2021

Oh sorry, I've just realised you're referring to the Uncategorized feature which is within each section. Ok fair enough. Easy enough to dump these items at the top of each section if that's what we prefer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Build Tooling Issues or PRs related to build tooling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants