Skip to content

Conversation

jmagman
Copy link
Member

@jmagman jmagman commented Aug 15, 2025

When the version and CHANGELOG updates are missing, suggest the helpful update-release-info command.

Log showing this in action:
https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8706431147753704257/+/u/Run_package_tests/CHANGELOG_and_version_validation/stdout

No version change found, but the change to this package could not be verified to be exempt
from version changes according to repository policy.
If this is a false positive, please comment in the PR to explain why the PR
is exempt, and add (or ask your reviewer to add) the "override: no versioning needed" label.

No CHANGELOG change found.
If this PR needs an exemption from the standard policy of listing all changes in the CHANGELOG,
comment in the PR to explain why the PR is exempt, and add (or ask your reviewer to add) the
"override: no changelog needed" label.
Otherwise, please add a NEXT entry in the CHANGELOG as described in the contributing guide.

If this PR is not exempt, you may update the version and CHANGELOG with the "update-release-info" command. Example:
$ dart run script/tool/bin/flutter_plugin_tools.dart update-release-info \
	--version=minimal \
	--base-branch=upstream/main \
	--changelog="Description of the change."

Pre-Review Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. 2 3

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request enhances the version check CI by suggesting the update-release-info command when both version and CHANGELOG updates are missing. The logic in version_check_command.dart is correctly modified to check for both missing items before exiting, and a corresponding test is updated to validate this new, more helpful error reporting. I have one suggestion to slightly refactor the new logic for better clarity and to avoid a redundant check.

Comment on lines 586 to 599
if (missingVersionChange && missingChangelogChange) {
printError('If this PR is not exempt, you may update the version and '
'CHANGELOG with the "update-release-info" command. Example:\n'
'\t\$ dart run script/tool/bin/flutter_plugin_tools.dart update-release-info \\\n'
'\t--version=minimal \\\n'
'\t--base-branch=upstream/main \\\n'
'\t--changelog="Description of the change."');
}
if (missingVersionChange) {
return 'Missing version change';
}
if (missingChangelogChange) {
return 'Missing CHANGELOG change';
}

Choose a reason for hiding this comment

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

medium

This logic for printing the suggestion and returning the error string can be slightly simplified to improve clarity and avoid a redundant check. By nesting the check for the combined error message, you can make the control flow more direct.

    if (missingVersionChange) {
      if (missingChangelogChange) {
        printError('If this PR is not exempt, you may update the version and '
            'CHANGELOG with the "update-release-info" command. Example:\n'
            '\t\$ dart run script/tool/bin/flutter_plugin_tools.dart update-release-info \\\
'
            '\t--version=minimal \\\
'
            '\t--base-branch=upstream/main \\\
'
            '\t--changelog="Description of the change."');
      }
      return 'Missing version change';
    }
    if (missingChangelogChange) {
      return 'Missing CHANGELOG change';
    }

@jmagman jmagman force-pushed the update-release-info branch from 404a826 to eb01730 Compare August 15, 2025 22:33
'CHANGELOG with the "update-release-info" command. Example:\n'
'\$ dart run script/tool/bin/flutter_plugin_tools.dart update-release-info \\\n'
'\t--version=minimal \\\n'
'\t--base-branch=upstream/main \\\n'
Copy link
Member Author

Choose a reason for hiding this comment

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

My setup is for my fork to be origin and flutter org repo to be upstream, but maybe this is a niche setup, I could make it --base-branch=origin/main open to suggestions.

Copy link
Contributor

Choose a reason for hiding this comment

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

It shouldn't be niche; it's what we tell people to do for both flutter/packages and flutter/flutter.

@jmagman jmagman marked this pull request as ready for review August 18, 2025 21:43
@jmagman jmagman requested a review from stuartmorgan-g August 18, 2025 21:44
@jmagman
Copy link
Member Author

jmagman commented Aug 18, 2025

I really wanted to add this to the top of dependabot PR descriptions (ex #9622), but that's not configurable:

CHANGELOG and version update instructions
If repo_checks "CHANGELOG and version validation" check fails, the following steps will update the relevant version and CHANGELOG files:
  1. Copy the name of the dependabot branch by clicking the button next to the blue branch name above.
copy_branch
  1. From the packages repository root directory, run:
$ git fetch --all
$ git checkout <copied branch name>
$ git rebase main
$ dart run script/tool/bin/flutter_plugin_tools.dart update-release-info \
  --version=minimal \
  --base-branch=upstream/main \
  --changelog="Bumps <dependency> from <old version> to <new version>"
$ git add .
$ git commit -m "CHANGELOG"
$ git push -f

Suggested --changelog value is the following line:

printError('If this PR is not exempt, you may update the version and '
'CHANGELOG with the "update-release-info" command. Example:\n'
'\$ dart run script/tool/bin/flutter_plugin_tools.dart update-release-info \\\n'
'\t--version=minimal \\\n'
Copy link
Contributor

Choose a reason for hiding this comment

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

My one hesitation here is that minimal isn't magic (no matter what Gemini insists on believing); it's very common that external contributors are adding a feature, where minor is the right value.

What about linking to https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#version-and-changelog-updates instead of showing this? That tells people they should probably use the tool, and links to the tool docs. It's more steps, but it already has context on things like what you should pass to --version.

Copy link
Member Author

Choose a reason for hiding this comment

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

I can link to it. I could update the Flutter docs to include this example command, and swap minimal to minor? I think an example would be helpful.

Copy link
Contributor

Choose a reason for hiding this comment

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

There's an example in the full tool README, which that section of the contributing docs link to.

I've generally tried to put full details and examples in the README, which is in-repo, and have other things link to it, so we aren't maintaining multiple copies of examples, which could get out of sync with each other (especially the out-of-repo ones). Is the concern that people won't click through to the example?

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