Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@nturgut
Copy link
Contributor

@nturgut nturgut commented Feb 26, 2020

This is a script for fetching the correct version of the flutter framework into engine.

Using "the youngest commit of the framework which is older than engine commit". This will prevent issues which will be caused by cyclic dependency.

@Hixie
Copy link
Contributor

Hixie commented Feb 26, 2020

The approach seems reasonable to me. Does it work for branches as well?

One thing we might want to do is make the script fail if you're not in CI, because that script looks rather destructive and you wouldn't want people on the team running it accidentally. Maybe set an environment variable in .cirrus.yml and have the script exit with a message if the env var is not set correctly?

cc @tvolkert @pcsosinski since this will affect how tests run on branches.

@nturgut
Copy link
Contributor Author

nturgut commented Feb 27, 2020

The approach seems reasonable to me. Does it work for branches as well?

One thing we might want to do is make the script fail if you're not in CI, because that script looks rather destructive and you wouldn't want people on the team running it accidentally. Maybe set an environment variable in .cirrus.yml and have the script exit with a message if the env var is not set correctly?

cc @tvolkert @pcsosinski since this will affect how tests run on branches.

Yes, I agree with you. I fail the code without 'env' and will warn the team member who might try to run it locally. As long as one is careful I think it is ok run the script locally, for example, to test what is failing on CI.

(Unit tests are failing since the template was common between tests, I'll address it in the next commit)

cd flutter
# Get the time of the youngest commit older than engine commit.
# Before makes the comparison considering the timezone as well.
COMMIT_NO=`git log --before="$LATEST_COMMIT_TIME_ENGINE" -n 1 | grep commit | cut -d ' ' -f2`
Copy link
Contributor

Choose a reason for hiding this comment

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

What happens if the latest engine commit is after the latest framework commit? Will this say there's no commit to reset to? If it leaves the framework at ToT, then multiple runs of this script at the same engine commit could still yield different framework versions...

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 deterministically getting the youngest framework commit older than the engine commit. For example engine commit is 10pm PST. The framework tree was red for half a day. The framework commit will be 10am PST.

Yes you are right. Different commits running at the same time on cirrus, since their head is different, will be fetching a different version of the framework repo.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah cool - at first I read it as "oldest commit younger than the engine commit".

Copy link
Contributor

Choose a reason for hiding this comment

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

So yes, next question is about branches. How does this behave if you're running on a release branch in the engine? We may want to have this detect if you're not on master, and then fetch the branch by the same name in the framework (and fail if there's no branch by the same name in the framework).

Copy link
Contributor

Choose a reason for hiding this comment

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

Should we worry about https://stackoverflow.com/questions/12934044/git-parent-commit-is-younger-than-descendant? Perhaps topological age should take precedence over actual date?

@tvolkert How do we run tests on CI for branches? Also, how do we keep LUCI recipes stable? A change in LUCI recipe can break our tests in older commits too (in fact it did just last week).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

On flutter/engine there isn't any branches for 'dev', 'beta', 'stable'. Is the suggestion for managing the hotfixes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@yjbanov On stackoverflow article:

  1. The commit date can be changed that is true. On the other hand we are simply trying to prevent both trees being closed on an error on flutter/flutter. We can add this to the Guidelines and simply ask the engine contributors not to change the date.
  2. git log --before and --after comments are always using commit date, so all the other parts on the stackoverflow discussion regarding the rebases are irrelevant to line 21 of the script.

Copy link
Contributor

Choose a reason for hiding this comment

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

@yjbanov infra team is working on the ability to pin the recipe version to the engine.

@nturgut these won't be dev, beta, or stable - they'll be release branches (one per dev release, created on both the framework and the engine).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Hixie @tvolkert I added the checks for the branch. @yjbanov I added a comment for your concern.

Even though this script works locally, I am not sure how it will run for the release process with cirrus CI. as far I as understand cirrus only runs on detached head. 'master' branches is used for post submit benchmarks. Once the cloning is done, there isn't any other configuration for a specific branch.

In my opinion we should either use LUCI for the release process or change the clone script of cirrus https://cirrus-ci.org/guide/tips-and-tricks/#custom-clone-command

Copy link
Contributor

Choose a reason for hiding this comment

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

Looking at the github history I couldn't find any instances when a child commit date is older than the parent's, so it looks like Github's "squash and merge" button does the right thing for us. This can only happen if someone pushes using the command line, and they would really have to go out of their way to change the dates. I think we're good.

Recipe pinning SGTM. Or better, move them into the respective repos.

@tvolkert
Copy link
Contributor

Is the idea here solely to ensure that we pin the version of the framework we sync to to make sure the world isn't shifting under our feet when we run engine tests?

@nturgut
Copy link
Contributor Author

nturgut commented Feb 27, 2020

Is the idea here solely to ensure that we pin the version of the framework we sync to to make sure the world isn't shifting under our feet when we run engine tests?

Yes. we don't want to block all the engine merges if there is a breakage in flutter/flutter which occurred later than the engine commit time.

@@ -0,0 +1,24 @@
#!/bin/bash
set -e
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd also add set -x so all the commands we run here are logged

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks for the suggestion!

cd flutter
# Get the time of the youngest commit older than engine commit.
# Before makes the comparison considering the timezone as well.
COMMIT_NO=`git log --before="$LATEST_COMMIT_TIME_ENGINE" -n 1 | grep commit | cut -d ' ' -f2`
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we worry about https://stackoverflow.com/questions/12934044/git-parent-commit-is-younger-than-descendant? Perhaps topological age should take precedence over actual date?

@tvolkert How do we run tests on CI for branches? Also, how do we keep LUCI recipes stable? A change in LUCI recipe can break our tests in older commits too (in fact it did just last week).

@nturgut nturgut requested review from tvolkert and yjbanov February 28, 2020 03:01
echo "Switching branches on Framework to from $FRAMEWORK_BRANCH_NAME to $ENGINE_BRANCH_NAME"
# Switch to the same version branch with the engine.
# If same version branch does not exits, fail.
SWITCH_RESULT=`git checkout $ENGINE_BRANCH_NAME` || true
Copy link
Contributor

Choose a reason for hiding this comment

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

Wont || true make this always true?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. If we don't put it, when there is an error (such as branch not found) the script automatically ends without printing out the logs I added.

When we use this if the branch exists the SWITCH_RESULT is a non empty string if it fails it is an empty string

@tvolkert
Copy link
Contributor

LGTM modulo comments.

Copy link
Contributor

@yjbanov yjbanov left a comment

Choose a reason for hiding this comment

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

LGTM if LGT @tvolkert

@nturgut
Copy link
Contributor Author

nturgut commented Feb 28, 2020

LGTM if LGT @tvolkert

thanks!

@nturgut
Copy link
Contributor Author

nturgut commented Feb 28, 2020

LGTM if LGT @tvolkert

thanks!

Merging the PR, got approval from Todd.

@nturgut nturgut merged commit 3b0d1a8 into flutter:master Feb 28, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Feb 29, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 2, 2020
cbracken pushed a commit to flutter/flutter that referenced this pull request Mar 2, 2020
* 9beac71 Add support for software text editing controls (flutter/engine#15560)

* ab9f83f Roll fuchsia/sdk/core/linux-amd64 from RYDur... to bgFop... (flutter/engine#16855)

* 62d0c08 Roll src/third_party/dart dda5bcee00d3..4dad6d77ba50 (6 commits) (flutter/engine#16856)

* 76d12d2 Roll src/third_party/skia 03d9e8af0d25..262796edeba6 (11 commits) (flutter/engine#16857)

* 01a52b9 Try rasterizing images and layers only once, even when their rasterization fails. Further enforce the same access threshold on layers as on Pictures. Previously layers would always be cached. The latter is a semantic change. (flutter/engine#16545)

* 3b0d1a8 script for fetching correct flutter version (flutter/engine#16818)

* 9746ddb Roll src/third_party/dart 4dad6d77ba50..6708f6d4c7df (15 commits) (flutter/engine#16860)

* 90736bb Roll src/third_party/skia 262796edeba6..54cb21430ccb (23 commits) (flutter/engine#16861)

* 142882e Roll src/third_party/skia 54cb21430ccb..e1ae9c4bcf2e (4 commits) (flutter/engine#16863)

* 7192356 Manual roll of Dart 09bbd3cca5...6708f6d4c7 (flutter/engine#16864)

* fae5ff6 Roll src/third_party/skia e1ae9c4bcf2e..5d1c3e2ead61 (2 commits) (flutter/engine#16865)

* c6525a4 Roll src/third_party/skia 5d1c3e2ead61..59b160f99106 (2 commits) (flutter/engine#16866)

* 755e2b5 Roll src/third_party/skia 59b160f99106..71a20b2685c6 (1 commits) (flutter/engine#16867)

* 93d0eff Roll src/third_party/skia 71a20b2685c6..ecbb0fb2d5bc (1 commits) (flutter/engine#16869)

* bfee5ae Roll fuchsia/sdk/core/linux-amd64 from bgFop... to F_Ihm... (flutter/engine#16871)

* ca29b47 Roll fuchsia/sdk/core/mac-amd64 from K26F5... to 79I0C... (flutter/engine#16872)

* 708ca2c Roll src/third_party/skia ecbb0fb2d5bc..666707336e07 (1 commits) (flutter/engine#16873)

* 78ea291 Roll fuchsia/sdk/core/mac-amd64 from 79I0C... to NoQzJ... (flutter/engine#16874)

* 7b43bb8 Roll fuchsia/sdk/core/linux-amd64 from F_Ihm... to 22R78... (flutter/engine#16875)

* 75c9c62 Roll src/third_party/skia 666707336e07..231f1bf56556 (1 commits) (flutter/engine#16876)

* 7a86b83 Roll src/third_party/dart 09bbd3cca5d4..860dca93ea42 (1 commits) (flutter/engine#16877)

* d0c87e2 Roll src/third_party/skia 231f1bf56556..d6205322cdc5 (1 commits) (flutter/engine#16878)

* b4c5854 Roll src/third_party/skia d6205322cdc5..6729496a037f (1 commits) (flutter/engine#16879)

* 03f0ee5 Roll src/third_party/skia 6729496a037f..367dbff98555 (1 commits) (flutter/engine#16880)

* d84b968 Roll fuchsia/sdk/core/mac-amd64 from NoQzJ... to q2DAy... (flutter/engine#16881)

* 4490e7c Roll fuchsia/sdk/core/linux-amd64 from 22R78... to 9NHsJ... (flutter/engine#16882)

* a39e7ac Roll src/third_party/skia 367dbff98555..986680240f81 (1 commits) (flutter/engine#16884)

* 62b1e50 Roll src/third_party/dart 860dca93ea42..fbe9f6115d2f (9 commits) (flutter/engine#16885)

* 5e474ee Roll src/third_party/skia 986680240f81..9dd0bd78b2d7 (2 commits) (flutter/engine#16886)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants