chore: update CI to fetch base history for flutter_plugin_tools format and apply formatting#18322
Conversation
…t and apply formatting
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. |
Wiz Scan Summary
To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension. |
…ion in multiple Package.swift files
….success(let value)` and `case .failure(let error)` for consistency; adjust swiftformat configuration to disable additional rules
…w to include Swift in formatting checks
Description
Updates FlutterFire formatting CI to match current flutter_plugin_tools behavior and formatting output.
This PR:
flutter_plugin_toolsmerge-base logicBackground
FlutterFire CI has historically run
flutter_plugin_toolsformat without passing an explicit base branch.Older versions of
flutter_plugin_toolsdetermined the diff base usingFETCH_HEAD, which made the behavior depend on the last fetch performed in the CI checkout. Newer versions changed that logic to resolve a merge base from an explicit branch instead. In the current implementation, GitVersionFinder defaults to main when no base branch is provided, and computes the base usinggit merge-base <base-branch> HEAD.That behavior means CI now needs:
a resolvable base branch locally, and
enough history for git merge-base to succeed.
Without that, formatting jobs can fail even though the same workflow worked previously with older
flutter_plugin_tools.For reference, this behavior change is visible in git_version_finder.dart in flutter/packages: https://github.com/flutter/packages/blob/main/script/tool/lib/src/common/git_version_finder.dart
What changed in this PR
The CI formatter invocation now passes --base-branch=origin/main.
This avoids relying on implicit checkout state and makes the formatter’s comparison target explicit.
Update CI to support merge-base resolution
The workflow now ensures the formatter has access to the branch/history it needs for git merge-base to succeed with the newer flutter_plugin_tools behavior.
Stop using standalone swiftformat
Previously, FlutterFire CI separately relied on swiftformat for Swift formatting.
That is no longer necessary here. This change removes that dependency and instead relies on the Swift formatting behavior provided through
flutter_plugin_tools, so formatting is handled through a single formatter path rather than split across separate tools.Because the formatter behavior/output changes as part of this update, this PR includes the resulting formatting updates.
Related Issues
Replace this paragraph with a list of issues related to this PR from the issue database. Indicate, which of these issues are resolved or fixed by this PR. Note that you'll have to prefix the issue numbers with flutter/flutter#.
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]).This will ensure a smooth and quick review process. Updating the
pubspec.yamland changelogs is not required.///).melos run analyze) does not report any problems on my PR.Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?