fix: use caret constraint for ensemble_test_runner's ensemble dependency - #2345
Open
TheNoumanDev wants to merge 1 commit into
Open
fix: use caret constraint for ensemble_test_runner's ensemble dependency#2345TheNoumanDev wants to merge 1 commit into
TheNoumanDev wants to merge 1 commit into
Conversation
melos version bumps hosted dependency constraints by regex-replacing only the leading token of the existing constraint string. That breaks on the compound ">=X <2.0.0" form written here, leaving a mangled, unparseable constraint (e.g. "^1.2.50-beta.13 <2.0.0") whenever a beta release runs. "^1.2.50" is semver-equivalent to ">=1.2.50 <2.0.0" and survives the rewrite intact.
|
|
||
| dependencies: | ||
| ensemble: ">=1.2.50 <2.0.0" | ||
| ensemble: "^1.2.50" |
Member
There was a problem hiding this comment.
this is not right, we don't wanna leave the ensemble versions open ended, this can cause issues
see, how we are handling the real issue in release-melos-version.yml
we are using --scope and --manual-version from melos here
I think the better way would be to have a an input `Beta: true/false" in release-melos-version.yml instead of managing 2 different pipelines
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
melos versionbreaks when bumpingensembleto a beta version, because it only regex-replaces the leading token of a hosted dependency's version constraint. The compound">=1.2.50 <2.0.0"form inensemble_test_runnerleft the rewrite malformed:^1.2.50-beta.13 <2.0.0, whichdart pub getthen rejects. This broke the beta release pipeline (ensemble-v1.2.50-beta.13).tools/ensemble_test_runner/pubspec.yaml:ensemble: ">=1.2.50 <2.0.0"→"^1.2.50"tools/ensemble_test_runner/example/pubspec.yaml:version: ">=1.2.50 <2.0.0"→"^1.2.50"^1.2.50is semver-equivalent to>=1.2.50 <2.0.0, so this is a no-op for dependency resolution and survives melos's version rewrite intact.Test plan
dart pub get --dry-runresolves cleanly on both files, no dependency changesmelos version ensemble 1.2.50-beta.13 --yesagainst this branch in an isolated clone — completes without error, producesensemble: ^1.2.50-beta.13dart pub get --dry-runon the resulting bumped pubspec resolves successfully