-
Notifications
You must be signed in to change notification settings - Fork 32
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
Support one version rule for mono-repos #311
Comments
All top Flutter repos have multiple
|
flutter/flutter (and flutter/engine? I haven't looked at the Dart side of that in detail), is a very different kind of mono-repo than flutter/plugins and flutter/packages. The latter are not repos that are used in their entirety by anyone, but collections of unrelated packages. For flutter/p*, I don't think the one-version rule even makes sense:
This isn't even a particularly useful command in flutter/p*; it's not that kind of repo. For flutter/plugins we solve the diamond dependency problem by building a mega-app in CI that includes every package in the repo, so we catch even transitive conflicts. I suppose an implementation of (2) could address that need more efficiently in CI, but since it would be a different path than what clients of the packages would actually do I would worry that there could be edge cases that would pass that check, but be caught by the current approach (e.g., build time conflicts with native code dependencies). For flutter/packages we currently seem to be ignoring the potential problem, but could do the same thing we do for flutter/plugins if it becomes an issue. |
This is probably more powerful, because such mega app won't be encumbered by the I think (1) and (2) is mostly useful if you have a mono-repo where you enforce a one-version-policy, which is typically something you would do to ease development (and keep consistency with CI). |
As far as I'm aware we have no problem with our current bespoke solution for flutter/flutter and it solves some problems that I suspect aren't yet solved by other solutions (e.g. we have a hash in every pubspec.yaml that we use to verify that nobody accidentally updates a pubspec.yaml without running the script). So I'm not in a rush to find a solution. I agree with stuart that the other repos aren't really mono repos in the traditional sense. |
It would be useful for mono-repos if
mono_repo.yaml
could contain an option likeforce_one_version: true
, to support mono-repos following the one version rule.Features:
pubspec.yaml
files in the mono-repo.pubspec.yaml
to the same versions when runningmono_repo pub get
.(2) is probably a bit hard to do, might involve generating a single
pubspec.yaml
containing all dependency constraints, resolving it, and writing thepubspec.lock
to all packages in the mono-repo before runningpub get
for each package in the mono-repo.(it's rather easy to generate such a
pubspec.yaml
, save it in a temporary folder that is deleted after it's used for resolution).@yjbanov, pointed out that many Flutter mono-repos would benefit from something like this, as they are currently using pinning and various scripts to ensure that they only have one version of each package.
The text was updated successfully, but these errors were encountered: