-
Notifications
You must be signed in to change notification settings - Fork 3.4k
[ci] Add update-release-info command suggestion when version check fails #9834
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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.
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'; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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';
}
404a826
to
eb01730
Compare
This reverts commit eb01730.
'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' |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
I really wanted to add this to the top of dependabot PR descriptions (ex #9622), but that's not configurable: CHANGELOG and version update instructionsIf repo_checks "CHANGELOG and version validation" check fails, the following steps will update the relevant version and CHANGELOG files:
![]()
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' |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
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
Pre-Review Checklist
[shared_preferences]
pubspec.yaml
with an appropriate new version according to the pub versioning philosophy, or I have commented below to indicate which version change exemption this PR falls under1.CHANGELOG.md
to add a description of the change, following repository CHANGELOG style, or I have commented below to indicate which CHANGELOG exemption this PR falls under1.///
).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
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