Skip to content

Conversation

@chunhtai
Copy link
Contributor

also opts in go_router

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

@github-actions github-actions bot added p: go_router triage-framework Should be looked at in framework triage labels Jan 22, 2026
@chunhtai chunhtai marked this pull request as ready for review January 27, 2026 23:32
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 CI checks for batch release file integrity by adding validation for workflow files, triggers, and branches for packages that opt into batch releases. It also opts in the go_router package to this new system. The changes are well-tested and improve the reliability of the release process. I have a few suggestions to further improve the robustness of the new checks and clean up a minor code duplication issue in the tests.

Comment on lines +387 to +391
if (errors.isNotEmpty) {
for (final error in errors) {
printError('$indentation$error');
}
}

Choose a reason for hiding this comment

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

medium

This error printing loop is redundant. The PackageLoopingCommand framework, which is the caller of runForPackage, is responsible for iterating over the returned errors and printing them. Including this loop will cause error messages to be printed twice. These lines can be removed.

return errors;
}
final String content = workflowFile.readAsStringSync();
final bool hasTrigger = content.contains("- 'release-$packageName'");

Choose a reason for hiding this comment

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

medium

Using String.contains to check for the workflow trigger is brittle. It could incorrectly match a commented-out line or fail to match if the formatting (e.g., quoting) is different. To make this check more robust, you should parse the YAML and inspect the branches list. This would be consistent with how the package-specific workflow file is validated elsewhere in this command.

    final YamlMap? yaml = loadYaml(content) as YamlMap?;
    final on = yaml?['on'] as YamlMap?;
    final push = on?['push'] as YamlMap?;
    final branches = push?['branches'] as YamlList?;
    final bool hasTrigger = branches?.contains('release-$packageName') ?? false;

@@ -0,0 +1,3 @@
changelog: |
- Converts go_router to use batch release.
version: patch
Copy link
Collaborator

Choose a reason for hiding this comment

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

What's the goal of putting this in a changelog and versioning it? There's no functionality change for clients here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is for me to test the feature to ensure the entire workflow works, or do you think we should wait until we have a contribution?

if (isBatchRelease) {
if (!batchWorkflowFile.existsSync()) {
errors.add(
'Missing batch workflow file: .github/workflows/${packageName}_batch.yml',
Copy link
Collaborator

Choose a reason for hiding this comment

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

https://github.com/flutter/flutter/blob/master/docs/ecosystem/release/README.md needs to be updated to describe batched release, and this error message should link to the relevant part of that updated page that explains the process of adopting batched releases (workflow file to add, workflow file to update to list the new package name, config file to add, etc.)

'Missing batch workflow file: .github/workflows/${packageName}_batch.yml',
);
} else {
// Validate content.
Copy link
Collaborator

Choose a reason for hiding this comment

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

If there's a large block of code all to do one conceptual task, that should be extracted to a clearly named and documented helper.

In general, any time code has the pattern:

// Description of what the following code does
<lots of code>

// Description of a new thing that the next section of code does
<lots of code>

...

That's a code smell that there should be smaller functions to do the steps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

p: go_router triage-framework Should be looked at in framework triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants