-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Always set exact version when publishing #8880
Always set exact version when publishing #8880
Conversation
@@ -68,7 +68,7 @@ | |||
"rebuild:electron": "theia rebuild:electron", | |||
"rebuild:electron:debug": "DEBUG=electron-rebuild && yarn rebuild:electron", | |||
"publish": "yarn && yarn test && yarn publish:latest", | |||
"publish:latest": "lerna publish && yarn publish:check", | |||
"publish:latest": "lerna publish --exact && yarn publish:check", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Niklas-Dahlquist I could not find any information for the --exact
flag in the lerna publish
documentation:
Can you perhaps include a link to documentation for the --exact
flag in the commit message, and/or pull-request description?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Vince!
The information for --exact is hidden under lerna version, see this direct link
/Niklas
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Niklas-Dahlquist:nidah/exact_version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛳️
@eclipse-theia/core is anyone forseing issues with setting dependencies to Theia extensions as I am in favor of this change. |
I have some concerns. I would like to improve what we have but I feel we do
not know all the consequences of this change. For example, will it become
mandatory, on practice, to pin all theia dependencies all the time using a
resolutions block?
…On Wed, Jan 6, 2021, 14:00 Paul Maréchal ***@***.***> wrote:
@eclipse-theia/core <https://github.com/orgs/eclipse-theia/teams/core> is
anyone forseing issues with setting Theia dependencies as x.y.z rather
than ^x.y.z?
I am in favor of this change.
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
<#8880 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AGEOMR6SN46SN4AUAAQFDX3SYSXL5ANCNFSM4U7PDZHQ>
.
|
@marcdumais-work when using the main |
The problem is if we are depending on an older release depending on Theia extensions we break unless we have specified a resolution with fixed versions of all Theia extensions in the entire dependency tree. (both direct and indirect dependencies). |
I understand, but my concern is that, in practice, all non-trivial Theia app will end-up having some mismatched Theia extensions (framework and/or 3rd party), and so it will become mandatory to bolt-down everything in a resolutions block. The way we currently do things, though not ideal from all angles, does afford us (and other Theia extensions developers) the leeway to lazily release theia extensions. E.g. we take advantage of that for Would it be fair to describe the situation like so: "with this new proposed dependencies handling, any and all Theia extensions part of an application will need to depend on the exact same @Theia framework extensions version". or "alternatively use a resolutions block to force all @Theia extensions (explicitly pulled or not)) to be of a same specific version " |
Take this example, a simple application that depends on an old Theia release will no longer work without a resolutions block:
Create that then run yarn followed by "yarn why @theia/core" and you will see that you have multiple instances. In the other case where we have conflicting dependency versions from our in-house extensions, then we need to either fix these conflicts or use resolutions. |
Niklas, do you see a way we could validate this? I'd like to be able to see how this would work, one and two releases down the road, since some of the side-effects will not be immediately visible. This would also permit knowing for sure what to expect, and so being able to guide adopters / extension developers in the transition. If you do not have a better idea, I would suggest simulating this using a local |
(sorry - momentarily closed PR by accident) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there will be quite important impacts for Theia app developers and probably Theia extensions developers too. This will require an entry in CHANGELOG
documenting the breakage.
961b692
to
8d136c3
Compare
We tested this by using an old See this example: Correct behaviour with
Incorrect behaviour with an old official/stable release
|
8d136c3
to
bbb8f05
Compare
Thanks for the example @Niklas-Dahlquist. I'll play a bit with |
My observations: I started with the theia-electron example app.
"dependencies": {
"@theia/callhierarchy": "1.10.0-next.2eb001e3",
"@theia/cpp-debug": "next",
"@theia/core": "1.10.0-next.2eb001e3",
"@theia/editor": "1.10.0-next.2eb001e3",
[...]
as expected 2 versions of @theia/core and possibly more are pulled:
"resolutions": {
"**/fs-extra": "^4.0.3",
"@theia/core": "1.10.0-next.2eb001e3",
"@theia/debug": "1.10.0-next.2eb001e3"
},
@Niklas-Dahlquist any surprises in the above? Is there a better way or did I work-around the issue "correctly", the same we'll suggest adopters do, when this is merged? (edit: transposed to |
@marcdumais-work No surprises in the crash nor the way you resolved the issues using resolutions. When conflicts occur the options that exists are to remove/fix the conflicting dependencies in the extension causing the duplication or hide the duplication of extensions by using a resolutions statement forcing the use of same versions like in the example above. |
Thanks for confirming @Niklas-Dahlquist. Would you be available to come briefly present and answer questions about this PR at our next dev-meeting? I'd like to get community buy-in. |
For my own peace of mind I have simulated a Theia release based on this PR (usinga local registry) and built the example app from the Here are the instructions open this PR is Gitpod: https://gitpod.io/#https://github.com/eclipse-theia/theia/pull/8880 Then kill the example app started automatically and in a terminal do: $> npm add -g verdaccio
$> verdaccio
#in another terminal:
$> npm adduser --registry http://localhost:4873
#(is there a way to supply user/pad/email programatically?: user/user/user@user.com)
# publish new Theia release to local registry, based on this PR:
$> yarn && yarn test:theia && npx lerna publish --registry http://localhost:4873
# test building a Theia app from what we published:
$> cd /workspace && git clone https://github.com/theia-ide/theia-apps.git && cd theia-apps/theia-docker && cp latest.package.json package.json && yarn --registry http://localhost:4873 && yarn theia build && yarn theia start --cwd example-electronp --hostname=0.0.0.0 The resulting application appears to work fine |
@Niklas-Dahlquist based on the above and the fact that I did not need to make changes to the example application, I think we can remove the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I have added a dev-meeting entry for this, for the dev-community's information. |
Theia is using "^1.x.y" in all modules, this causes two problems 1) Since romantic versioning is used within Theia repo, API breakage might be introduced between any version 2) It's harder to build applications using old versions of Theia extensions since if not every needed Theia extension is explicitly stated in dependencies you will likely end up with pulling several parallel versions of @theia/core for example. Due to dependency injection we can not have multiple parallel versions of the same Theia extension module Fixes issue eclipse-theia#8879 when publishing next version Contributed by STMicroelectronics Signed-off-by: Niklas DAHLQUIST <niklas.dahlquist@st.com> Signed-off-by: Samuel HULTGREN <samuel.hultgren@st.com>
bbb8f05
to
adc54c3
Compare
I did an additional test: Published a 1.10.0 as described above
Created a 1.10.1 with the --exact option
Created a 1.11.0 with the --exact option
Cloned the same application
Created 1.10.0.package.json where I replaced all versions with 1.10.0
The Theia application never leaves the spinning wheel of ....
Created 1.10.1.package.json where I replaced all versions with 1.10.1
The Theia application starts normally!!!
Created caret1.10.1.package.json where I replaced all versions with ^1.10.1
The Theia application starts normally!!!
Conclusion use --exact when publishing.... I agree that the change isn't breaking, still kept the CHANGELOG item since we need to know when we abandoned caret versioning. |
Nice test - thanks Niklas :) |
Hi Sorry we mixed up the day for the dev meeting days - Regarding the minutes and the question "Please post on the PR if you'd like more time to test - else we'll aim to merge it tomorrow" We don't aim to do more tests, the fix solves an issue and is ready to merge. |
No one has posted objections, so let's merge. |
What it does
The patch promotes usage of a specific version number for each future Theia publication. Solves issue #8879.
We add use of the --exact option to lerna, see this link:
https://github.com/lerna/lerna/tree/main/commands/version#--exact
Fixes #8879
How to test
Run $ yarn publish:latest
Observe that all Theia extensions uses a specific version number on Theia dependencies.
Review checklist
Reminder for reviewers