fix: use caret constraint for ensemble_test_runner's ensemble dependency - #2345
Open
TheNoumanDev wants to merge 6 commits into
Open
fix: use caret constraint for ensemble_test_runner's ensemble dependency#2345TheNoumanDev wants to merge 6 commits into
TheNoumanDev wants to merge 6 commits 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
… guard stale-ref overlay
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 versioncorrupts hosted dependency constraints written as a compound range (e.g.ensemble_test_runner's">=1.2.50 <2.0.0") when bumpingensemble— it only replaces the leading token, leaving invalid syntax behind. Broke the last beta release; would've broken the next stable release too. Bug confirmed in melos itself.Fix repairs melos's output instead of changing the dependency declaration:
.github/scripts/fix_melos_version_rewrite.dart— detects and repairs the corruption using realpub_semverparsing, preserving the original range style and upper bound; fails loudly on anything unrecognized instead of guessing.github/scripts/repair_and_retag.sh— shared by both release workflows: runs the repair aftermelos version, amends it into melos's commit, re-points every tag melos createdrelease-beta-version.yml/release-melos-version.yml— pull release scripts andpublish-ensemble-pubdev.ymlfrom the workflow's own ref rather than the branch/ref being released (which may lack or predate them); stable pipeline additionally guards against overlaying an older ref's files onto mainpublish-ensemble-pubdev.yml— added opt-in beta publishing. pub.dev only trusts publishes triggered by a genuine tag push (confirmed —workflow_call/workflow_dispatchorigins are rejected outright), so the opt-in travels as an annotated tag message ([publish-to-pubdev]) rather than a workflow input; beta tags without the marker are skippedTest plan
actionlint,shellcheck,dart analyzecleanensemble 1.2.50-beta.11) ran the full pipeline and published successfully to pub.dev as a prerelease