-
Notifications
You must be signed in to change notification settings - Fork 189
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
Pin a precise version of Flutter #15
Comments
This caused a bit of confusion in a recent PR: We also had an outright build-break a couple of months ago:
And there's the recurring small nuisance of: So while our README says that our lack of pinning so far hasn't been a problem, that seems to no longer be true. It's not an overwhelming problem, but it is an actual problem. Also, though this next part hasn't yet concretely bitten us, I'm concerned that it will get increasingly hard to run old versions of the app — say, to test whether some behavior is a regression or bisect when it changed — because there's no automated way to get a corresponding Flutter version, and no way at all to determine the exact Flutter versions that we were running at the time we were developing a given version of the app. And unlike many kinds of problems, that isn't one where it necessarily makes sense to wait until we hit the problem before acting to solve it. That's because when you hit this problem, what you want isn't to have a solution now, but to have had a solution back when the old versions in question were developed, perhaps months earlier. So I'm bumping this up in the timeline. I don't expect to have time to pick it up immediately, though. |
… tests Along with 2f0f469, this is a reminder that it'd be good to get our repo added to Flutter's "customer tests" suite: zulip#239. It's also another reminder among several that it'd be good to pin a precise version of Flutter: zulip#15. Discussion: https://chat.zulip.org/#narrow/stream/243-mobile-team/topic/flutter.3A.20Failing.20tests/near/1615254 Related: zulip#15 Related: zulip#239
…tests Along with 2f0f469, this is a reminder that it'd be good to get our repo added to Flutter's "customer tests" suite: zulip#239. It's also another reminder among several that it'd be good to pin a precise version of Flutter: zulip#15. Discussion: https://chat.zulip.org/#narrow/stream/243-mobile-team/topic/flutter.3A.20Failing.20tests/near/1615254 Related: zulip#15 Related: zulip#239
Here's a couple more thoughts about our needs here which I think aren't yet explicit above. (These are copied from a comment I just made at #577 (comment) , on a draft PR toward an implementation of this.)
|
Further design discussion from #577:
|
@chrisirhc also wrote:
I agree, a job like that would be valuable (and that's something we currently get from our unpinned setup). It's a shame that GitHub Actions lacks the feature to support that well (by having a job where failure doesn't turn the whole commit's build status to red). It looks like this is the main thread now for that feature request: One possible workaround would be to have the job but only run it on main, not on PRs. That way when things started failing because of an upstream change, it wouldn't interfere with seeing the status of PRs — but we would still get the signal that something's wrong, as a prompt for us to investigate and fix. |
* Introduce a git submodule to pin the version of flutter SDK under `vendor/flutter`. * Use direnv to add `vendor/flutter/bin` to the current PATH so that subsequent calls to `flutter` on the shell uses the our pinned version of flutter. * Update instructions to use pinned version of flutter. * Pin to 18340ea16c of flutter which matches the current lowerbound version in pubsec.yaml (3.21.0-12.0.pre.26). NOTE: Users can still choose to opt-out and use their own version of flutter. This just provides a recommended and tested version on our CI. Closes zulip#15
* Introduce a git submodule to pin the version of flutter SDK under `vendor/flutter`. * Use direnv to add `vendor/flutter/bin` to the current PATH so that subsequent calls to `flutter` on the shell uses the our pinned version of flutter. * Update instructions to use pinned version of flutter. * Pin to 18340ea16c of flutter which matches the current lowerbound version in pubsec.yaml (3.21.0-12.0.pre.26). NOTE: Users can still choose to opt-out and use their own version of flutter. This just provides a recommended and tested version on our CI. Closes zulip#15
* Introduce a git submodule to pin the version of flutter SDK under `vendor/flutter`. * Use direnv to add `vendor/flutter/bin` to the current PATH so that subsequent calls to `flutter` on the shell uses the our pinned version of flutter. * Update instructions to use pinned version of flutter. * Pin to 18340ea16c of flutter which matches the current lowerbound version in pubsec.yaml (3.21.0-12.0.pre.26). NOTE: Users can still choose to opt-out and use their own version of flutter. This just provides a recommended and tested version on our CI. Closes zulip#15
* Introduce a git submodule to pin the version of flutter SDK under `vendor/flutter`. * Use direnv to add `vendor/flutter/bin` to the current PATH so that subsequent calls to `flutter` on the shell uses the our pinned version of flutter. * Update instructions to use pinned version of flutter. * Pin to 18340ea16c of flutter which matches the current lowerbound version in pubsec.yaml (3.21.0-12.0.pre.26). NOTE: Users can still choose to opt-out and use their own version of flutter. This just provides a recommended and tested version on our CI. Closes zulip#15
This version leaves it to the user/developer to handle actually upgrading their Flutter install to latest; but it takes care of updating pubspec.yaml and pubspec.lock. The upgrade of the actual Flutter install will presumably look different anyway after zulip#15 / zulip#579, so we leave that to the future.
This version leaves it to the user/developer to handle actually upgrading their Flutter install to latest; but it takes care of updating pubspec.yaml and pubspec.lock. The upgrade of the actual Flutter install will presumably look different anyway after zulip#15 / zulip#579, so we leave that to the future.
So far, in the prototype phase, we've been able to just always use the latest Flutter version in a given channel (either beta or main). At some point we will want more control, specifying a particular version and being sure everyone gets that version even if it's not the very newest. That way everyone's seeing the same behavior, and a change happening outside our own repo can't break our tests.
In particular, if we use versions from the Flutter main branch, then that will be a constantly moving target. Using the moving target will still be OK as long as we don't frequently see anything change that breaks us, but at some point we'll want to pin the exact version to be sure of that.
Implementation notes
The
pubspec.yaml
file lets us specify a lower bound for the Flutter version, but not an upper bound. (The syntax permits an upper bound, but it's ignored.) In particular it doesn't permit specifying an exact version. Upstream discussions:Relatedly, while the
flutter
tool providesflutter upgrade
as a handy way to get the latest Flutter version within any given channel (stable, beta, or main), there's no such way to get a specific version. So if Flutter did respect thepubspec.yaml
file as far as complaining when the version was newer than specified, it still wouldn't provide a convenient way to actually get the specified version.From those upstream threads, it seems like the usual solution in the Flutter community is to use one of several tools people have built to manage Flutter versions. I haven't looked into these in detail yet at all, but listing the ones I've seen mentioned:
So when pursuing this, we'll want to look at those and also look to see if there are other implementations to consider.
The text was updated successfully, but these errors were encountered: