[ci] Add update-release-info command suggestion when version check fails (#9834)

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

**Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). 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.

[^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.
diff --git a/script/tool/lib/src/version_check_command.dart b/script/tool/lib/src/version_check_command.dart
index 71fb489..4d147cb 100644
--- a/script/tool/lib/src/version_check_command.dart
+++ b/script/tool/lib/src/version_check_command.dart
@@ -547,11 +547,14 @@
       return null;
     }
 
+    bool missingVersionChange = false;
+    bool missingChangelogChange = false;
     if (state.needsVersionChange) {
       if (_prLabels.contains(_missingVersionChangeOverrideLabel)) {
         logWarning('Ignoring lack of version change due to the '
             '"$_missingVersionChangeOverrideLabel" label.');
       } else {
+        missingVersionChange = true;
         printError(
             'No version change found, but the change to this package could '
             'not be verified to be exempt\n'
@@ -559,8 +562,7 @@
             'If this is a false positive, please comment in '
             'the PR to explain why the PR\n'
             'is exempt, and add (or ask your reviewer to add) the '
-            '"$_missingVersionChangeOverrideLabel" label.');
-        return 'Missing version change';
+            '"$_missingVersionChangeOverrideLabel" label.\n');
       }
     }
 
@@ -569,6 +571,7 @@
         logWarning('Ignoring lack of CHANGELOG update due to the '
             '"$_missingChangelogChangeOverrideLabel" label.');
       } else {
+        missingChangelogChange = true;
         printError('No CHANGELOG change found.\n'
             'If this PR needs an exemption from the standard policy of listing '
             'all changes in the CHANGELOG,\n'
@@ -576,11 +579,24 @@
             'ask your reviewer to add) the\n'
             '"$_missingChangelogChangeOverrideLabel" label.\n'
             'Otherwise, please add a NEXT entry in the CHANGELOG as described in '
-            'the contributing guide.');
-        return 'Missing CHANGELOG change';
+            'the contributing guide.\n');
       }
     }
 
+    if (missingVersionChange && missingChangelogChange) {
+      printError('If this PR is not exempt, you can update version and '
+          'CHANGELOG with the "update-release-info" command.\\\n'
+          'See here for an example: '
+          'https://github.com/flutter/packages/blob/main/script/tool/README.md#update-changelog-and-version\\\n'
+          'For more details on versioning, check the contributing guide.');
+    }
+    if (missingVersionChange) {
+      return 'Missing version change';
+    }
+    if (missingChangelogChange) {
+      return 'Missing CHANGELOG change';
+    }
+
     return null;
   }
 }
diff --git a/script/tool/test/version_check_command_test.dart b/script/tool/test/version_check_command_test.dart
index cba573d..4c852bb 100644
--- a/script/tool/test/version_check_command_test.dart
+++ b/script/tool/test/version_check_command_test.dart
@@ -787,8 +787,8 @@
       });
 
       test(
-          'fails if a version change is missing from a change that does not '
-          'pass the exemption check', () async {
+          'fails if a version and CHANGELOG change is missing from a change '
+          'that does not pass the exemption check', () async {
         final RepositoryPackage plugin =
             createFakePlugin('plugin', packagesDir, version: '1.0.0');
 
@@ -819,6 +819,8 @@
           output,
           containsAllInOrder(<Matcher>[
             contains('No version change found'),
+            contains('No CHANGELOG change found.'),
+            contains('"update-release-info" command'),
             contains('plugin:\n'
                 '    Missing version change'),
           ]),