Skip to content

[material_ui, cupertino_ui, infra] Support skipping golden files for the design migration#11649

Merged
auto-submit[bot] merged 24 commits into
flutter:mainfrom
Piinks:goldSkipper
May 8, 2026
Merged

[material_ui, cupertino_ui, infra] Support skipping golden files for the design migration#11649
auto-submit[bot] merged 24 commits into
flutter:mainfrom
Piinks:goldSkipper

Conversation

@Piinks
Copy link
Copy Markdown
Contributor

@Piinks Piinks commented May 5, 2026

This branches off of #10753 and strips it down to just the skipping comparator. This means when golden file testing is used with this version of flutter_goldens, matchesGoldenFile will return true in all environments without executing image comparison.
The goal of this PR is to join the material_ui and cupertino_ui mega-migration PR (cc @justinmc ) to disable golden file testing for now in material_ui and cupertino_ui so we can get a clearer signal from CI about any remaining blockers.
Full golden file testing support will likely land in #10753 as a separate step given the enormity of these PRs.

cupertino_ui and material_ui are set publish_to: none here, which is intentional. This allows us to split up these changes, and wait to publish until everything lands and is working as we want it to.

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

@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label May 5, 2026
@github-actions github-actions Bot added triage-framework Should be looked at in framework triage p: material_ui labels May 5, 2026
@Piinks Piinks changed the title Add goldctl dependency on unit tests [material_ui, cupertino_ui, infra] Support skipping golden files for the design migration May 5, 2026
@Piinks Piinks requested a review from justinmc May 5, 2026 14:30
Copy link
Copy Markdown

@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 introduces a new internal package, flutter_goldens, to support Skia Gold integration for golden image testing. It includes CI script updates, configuration for cupertino_ui and material_ui packages, and the core implementation of custom golden file comparators. Feedback highlights the need for proper URI-to-path conversion using the path package, correcting the Dart SDK version, fixing an incorrect import in material_ui, and ensuring safer YAML parsing.

Comment thread script/flutter_goldens/lib/flutter_goldens.dart Outdated
Comment thread script/flutter_goldens/lib/flutter_goldens.dart Outdated
Comment thread script/flutter_goldens/pubspec.yaml Outdated
Comment thread packages/material_ui/test/goldens/goldens_test.dart Outdated
Comment thread script/flutter_goldens/lib/flutter_goldens.dart
Comment thread script/flutter_goldens/lib/flutter_goldens.dart Outdated
@github-actions github-actions Bot removed the CICD Run CI/CD label May 5, 2026
@Piinks Piinks added the CICD Run CI/CD label May 5, 2026
Copy link
Copy Markdown
Contributor

@justinmc justinmc left a comment

Choose a reason for hiding this comment

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

LGTM. After merging I can update my PR #11568 and then make sure it correctly skips the golden tests.

description: The official Flutter Material UI Library, implementing Google's Material Design design system.
version: 0.0.1
version: 0.0.2
publish_to: none
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Good call for now. I'll plan to remove this when we are ready to attempt to publish the first pre-release version.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ok thanks. Let me double check with Stuart before merging this.

@Piinks Piinks requested a review from stuartmorgan-g May 5, 2026 18:26
@github-actions github-actions Bot removed the CICD Run CI/CD label May 5, 2026
@Piinks Piinks added the CICD Run CI/CD label May 5, 2026
Comment thread script/flutter_goldens/pubspec.yaml Outdated
Comment thread packages/cupertino_ui/test/goldens/goldens_test.dart
Comment thread script/flutter_goldens/pubspec.yaml Outdated
@github-actions github-actions Bot removed the CICD Run CI/CD label May 8, 2026
@Piinks Piinks added the CICD Run CI/CD label May 8, 2026
@Piinks Piinks requested a review from stuartmorgan-g May 8, 2026 13:28
infra_step: true # Note infra steps failing prevents "always" from running.
- name: tool unit tests
script: .ci/scripts/plugin_tools_tests.sh
- name: flutter_goldens unit tests
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

If this package isn't intended to be run from Windows, you could just not add this here rather than fix the failures.

Comment thread script/flutter_goldens/pubspec.yaml Outdated
path: 1.9.1
platform: 3.1.6
process: 5.0.5
yaml: 3.1.3
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

What is the plan for keeping these updated?

Also, since this is non-standard for this repo, it would be good to explain in a comment in this file why it's important that these be pinned instead of using the typical ^ dependencies.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

What is the plan for keeping these updated?

I am not sure yet given they are any in flutter/flutter we haven't had to consider that. I can take up as an action item for the full golden infra PR to resolve ongoing maintenance.

instead of using the typical ^ dependencies.

I don't think they need to be pinned, I just referred to the lock file in flutter/flutter to determine the right versions. If they weren't pinned, would ongoing maintenance be easier?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

If they weren't pinned, would ongoing maintenance be easier?

Yes; if they use a standard ^ range then they only need to be touched when there is a new major version, or someone is adding code that uses a newer feature that needs a higher minimum version (both of which are likely to be rare), rather than every single time we want to get a bugfix to any dependency.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ok cool. All green here, I am will add a section to the doc about maintaining this going forward. We need a better strategy for that in flutter/flutter anyways, recently we bumped the goldctl version that had not been updated in... maybe years.

@github-actions github-actions Bot removed the CICD Run CI/CD label May 8, 2026
@Piinks Piinks added the CICD Run CI/CD label May 8, 2026
@github-actions github-actions Bot removed the CICD Run CI/CD label May 8, 2026
@Piinks Piinks added CICD Run CI/CD autosubmit Merge PR when tree becomes green via auto submit App labels May 8, 2026
@auto-submit auto-submit Bot merged commit 54eb7f2 into flutter:main May 8, 2026
83 checks passed
pull Bot pushed a commit to soloinovator/flutter that referenced this pull request May 11, 2026
…r#186350)

flutter/packages@92552b1...19ec8b8

2026-05-11 49699333+dependabot[bot]@users.noreply.github.com Bump
actions/labeler from 6.0.1 to 6.1.0 in the all-github-actions group
(flutter/packages#11686)
2026-05-08 suojae.developer@gmail.com [flutter_svg] add imageBuilder
property to SvgPicture (flutter/packages#11615)
2026-05-08 katelovett@google.com [material_ui, cupertino_ui, infra]
Support skipping golden files for the design migration
(flutter/packages#11649)
2026-05-08 stuartmorgan@google.com [video_player] Add missing
swift_version to podspec (flutter/packages#11670)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC flutter-ecosystem@google.com on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App CICD Run CI/CD p: material_ui triage-framework Should be looked at in framework triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants