Skip to content

[flutter_tools] auto-migrate dev users to beta#97028

Merged
fluttergithubbot merged 7 commits intoflutter:masterfrom
chris-forks:deprecate-dev
Jan 25, 2022
Merged

[flutter_tools] auto-migrate dev users to beta#97028
fluttergithubbot merged 7 commits intoflutter:masterfrom
chris-forks:deprecate-dev

Conversation

@christopherfujino
Copy link
Contributor

@christopherfujino christopherfujino commented Jan 21, 2022

This change affects Flutter users who are currently on the dev channel (which was recently deprecated #94962). When they issue flutter upgrade, they will first be migrated to the beta branch, then the regular upgrade flow will continue.

This PR is based on restoring the functionality that was removed in 0b88269#diff-5b253435730ab79efc0fca2a9d48fa84a24c298c2435784d77b31b82c3bb7ed4

Fixes #94967

Tested locally by:

  • clone test repo
  • add my mirror as an alternate remote
  • check out feature branch from my mirror
  • push feature branch to test remote repo, but named dev: git push origin deprecate-dev:dev
  • add an empty commit so we have something to upgrade to: git commit --allow-empty -m 'empty commit'
  • push to test remote repo, but this time naming it beta: git push origin deprecate-dev:beta
  • rename local branch to dev: git checkout -b dev && git branch -D deprecate-dev
  • fix(?) tags by git fetch --tags -f
  • git branch --set-upstream-to origin/dev
  • run upgrade (since we are using a test remote, you must set the FLUTTER_GIT_URL env var: FLUTTER_GIT_URL="[email protected]:<username>/flutter.git" bin/flutter upgrade

@flutter-dashboard flutter-dashboard bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Jan 21, 2022
@christopherfujino christopherfujino changed the title auto-migrate dev users to beta [flutter_tools] auto-migrate dev users to beta Jan 21, 2022
if (kObsoleteBranches.containsKey(channel)) {
final String alternative = kObsoleteBranches[channel]!;
globals.printStatus("Transitioning from '$channel' to '$alternative'...");
return _checkout(alternative);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Question: should we prompt the user first before migrating them to beta?

Copy link
Contributor

Choose a reason for hiding this comment

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

nah

@christopherfujino christopherfujino marked this pull request as ready for review January 22, 2022 00:30
/// For example, in 2021 we deprecated the "dev" channel and transitioned "dev"
/// users to the "beta" channel.
const Map<String, String> kObsoleteBranches = <String, String>{
'dev': 'beta',
Copy link
Contributor

Choose a reason for hiding this comment

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

might as well add alpha here too (also going to beta), for completeness...

Copy link
Contributor

@Hixie Hixie Jan 22, 2022

Choose a reason for hiding this comment

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

i guess maybe not, we'd also have to add hackathon and codelab and at some point there's a question of how much we care to have all these on master, since they only matter on the actual branch going away. In fact, if anything, this can literally just be a single hard-coded pair (and ditch the map), since there will never be a case where this needs to be more than one thing.

Copy link
Contributor

@Hixie Hixie left a comment

Choose a reason for hiding this comment

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

LGTM

@Hixie
Copy link
Contributor

Hixie commented Jan 22, 2022

Is the idea here that we would push one last commit to dev after this lands (and rolls into google3, presumably)?

@christopherfujino
Copy link
Contributor Author

Is the idea here that we would push one last commit to dev after this lands (and rolls into google3, presumably)?

Good point. So right now, all beta releases get duplicated to dev, so we can stop doing that once this code gets published to beta/dev.

@zanderso
Copy link
Member

Sorry this comment is coming in a bit late, but I think users on dev would have been just as well served with a message explaining how to move themselves to a good channel rather than doing an auto-migration. While the auto-migration is certainly very convenient for users, polish might have been better applied in other places.

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

Labels

tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update Flutter tool to handle people currently on the dev channel to auto migrate/guide them onto another channel

4 participants