-
Notifications
You must be signed in to change notification settings - Fork 27.5k
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
Don't send images to Gold on release branches #139706
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.
@@ -19,6 +19,7 @@ export 'package:flutter_goldens_client/skia_client.dart'; | |||
// https://github.com/flutter/flutter/wiki/Writing-a-golden-file-test-for-package%3Aflutter | |||
|
|||
const String _kFlutterRootKey = 'FLUTTER_ROOT'; | |||
final RegExp _kReleaseBranch = RegExp(r'flutter-\d+\.\d+-candidate\.\d+'); |
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.
Instead of thinking this as release branches, what if we change it to only look at master|main? It seems unlikely we want to run goldens anywhere that isn't HEAD.
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.
Unfortunately Luci does not give us that kind of info. From this place in the test execution, I only have the environment that Luci has set up to work with.
I could try targeting master/stable/beta in ci.yaml, but it would double the amount of recipes, which feels super brittle for maintaining which one is which and how its configured.
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.
To clarify, I mean checking ENV['GIT_BRANCH'] == RegEx('master|main')
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.
Oo, let me check a PR to see if this works. I think in presubmit checks it will reflect whatever the contributor named the branch.
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.
TIL! Looks like in post and presubmit the branch reflects master
, that is way better - thank you!
Part of fixing flutter#139673, it will need to be cherry picked into the stable branch to fully resolve. Originally I tried to come at this from `ci.yaml`, but the syntax does not exist to either conditionally include a dependency based on the branch we are on, or to disable a shard for a given branch (as opposed to enabling it which is supported). I could double every CI shard that uses Gold to try to serve my purpose, but it is already a very large and cumbersome file to keep up to date. Doubling it does not feel like the best solution. Using a RegEx is not my favorite, but I am using the same one we use in our CI, and left a note there to update it if it should ever change. Since there is already a whole infra built around it, I feel it is pretty safe so we can fix the stable tree. We already had mitigated Gold affecting release branches in the past through flutter/cocoon (flutter#58814), but flutter#139673 exposed a rather rare edge case. A change was CP'd into the stable branch that introduced golden file image changes. Typically this would not cause an issue since any change that has landed on the master branch has golden files accounted for. In this case, the CP'd change on master has generated a different image on canvaskit due to another change that was not on stable. So when the CP landed, it generated a new image Gold had never seen before. Gold only tracks the master branch, so we cannot approve the image, and so cannot fix the stable tree. This would disable the failing check on release branches and fix the tree.
|| platform.environment.containsKey('CIRRUS_CI'); | ||
|| platform.environment.containsKey('CIRRUS_CI')) | ||
// If we are in CI, skip on branches that are not main. | ||
&& !_kMainBranch.hasMatch(platform.environment['GIT_BRANCH'] ?? ''); |
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 doesn't seem right? it makes us use the local file comparator on the main branch on Cirrus, for example, whereas before we used the skipping one.
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'll fix it in my PR, let me know if i misunderstood this)
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.
Oh. Well gosh. Yeah that's wrong, and obviously not covered by a test.
We don't actually run these tests on Cirrus at all anymore. I had the thought to clean everything Cirrus related out while I was here, but didn't want to make merging with your PR even worse.
This reverts commit 91ea024.
* [CP] Gold fix for stable branch (flutter#139764) Fixes flutter#139673 Cherry picks flutter#139706 to the stable branch to fix the tree. * [macOS] Suppress Xcode 15 createItemModels warning (flutter#138243) (flutter#139782) As of Xcode 15 on macOS Sonoma, the following message is (repeatedly) output to stderr during builds (repros on non-Flutter apps). It is supppressed in xcode itself, but not when run from the command-line. ``` 2023-11-10 10:44:58.031 xcodebuild[61115:1017566] [MT] DVTAssertions: Warning in /System/Volumes/Data/SWE/Apps/DT/BuildRoots/BuildRoot11/ActiveBuildRoot/Library/Caches/com.apple.xbs/Sources/IDEFrameworks/IDEFrameworks-22267/IDEFoundation/Provisioning/Capabilities Infrastructure/IDECapabilityQuerySelection.swift:103 Details: createItemModels creation requirements should not create capability item model for a capability item model that already exists. Function: createItemModels(for:itemModelSource:) Thread: <_NSMainThread: 0x6000027c0280>{number = 1, name = main} Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide. ``` This suppresses this message from stderr in our macOS build logs. Issue: flutter#135277 Cherry-pick: flutter#139284 https://github.com/flutter/flutter/wiki/Tree-hygiene#overview [Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene [test-exempt]: https://github.com/flutter/flutter/wiki/Tree-hygiene#tests [Flutter Style Guide]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo [Features we expect every widget to implement]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/wiki/Chat *Replace this paragraph with a description of what this PR is changing or adding, and why. Consider including before/after screenshots.* *List which issues are fixed by this PR. You must list at least one issue. An issue is not required if the PR fixes something trivial like a typo.* *If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].* * [CP] have `Java.version` return null if `java --version` fails or cannot be run (flutter#139698) cherry-picks changes from flutter#139614 onto the stable channel * [CP] Catch error for missing directory in `FontConfigManager` (flutter#138496) (flutter#139743) Closes: - flutter#138434 We will catch any errors while attempting to clear the temp directories that don't exist for the `FontConfigManager` class --------- Co-authored-by: Kate Lovett <[email protected]> Co-authored-by: Chris Bracken <[email protected]> Co-authored-by: Andrew Kolos <[email protected]> Co-authored-by: Elias Yishak <[email protected]>
Part of fixing #139673, it will need to be cherry picked into the stable branch to fully resolve.
Originally I tried to come at this from
ci.yaml
, but the syntax does not exist to either conditionally include a dependency based on the branch we are on, or to disable a shard for a given branch (as opposed to enabling it which is supported). I could double every CI shard that uses Gold to try to serve my purpose, but it is already a very large and cumbersome file to keep up to date. Doubling it does not feel like the best solution. Using a RegEx is not my favorite, but I am using the same one we use in our CI, and left a note there to update it if it should ever change. Since there is already a whole infra built around it, I feel it is pretty safe so we can fix the stable tree.We already had mitigated Gold affecting release branches in the past through flutter/cocoon (#58814), but #139673 exposed a rather rare edge case. A change was CP'd into the stable branch that introduced golden file image changes. Typically this would not cause an issue since any change that has landed on the master branch has golden files accounted for. In this case, the CP'd change on master has generated a different image on canvaskit due to another change that was not on stable. So when the CP landed, it generated a new image Gold had never seen before. Gold only tracks the master branch, so we cannot approve the image, and so cannot fix the stable tree.
This would disable the failing check on release branches and fix the tree.
Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.