-
Notifications
You must be signed in to change notification settings - Fork 38
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 renaming the be channel to main. #102
Support renaming the be channel to main. #102
Conversation
The tests appear to fail like my attempts to run it locally. I literally just ran:
Please advise and update DEVELOPING if I'm doing something wrong? |
I'll review and see if I can spot where this is having problems. In the meantime, is there a github issue you can reference (from the PR and the code) instead of a buganizer issue? Even if the two issues are cross-referenced, it would help w/ visibility. |
Those steps look correct (the setup and re-compiling the javascript code), and matches whats in https://github.com/dart-lang/setup-dart/blob/main/DEVELOPING.md. From the failures it does look like there's some issue with the javascript produced. Perhaps due to differing versions of node or of dart2js? |
lib/main.dart
Outdated
// automatically migrates users when the be channel is renamed to main. | ||
try { | ||
channel = 'main'; | ||
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.
Note that the latestPublishedVersion
method won't be called for all paths here, like if the raw
flavor had been specified. I take it we're trying to validate that a url exists for the main
channel, and if no, fallback on the be
channel? If so we'd need to validate the urls for the raw flavor as well.
Will this be a very quick transition? Using be
is I think a pretty specialized use case. We could do something like start double-publishing to main and be now, have the (current) 1.5.0 version of this action read from be
, and publish a newer 1.6.0 version which only read from main
.
And I know there are some used cases for having a raw
flavor, but they're so rarified I wonder if we couldn't remove that as well.
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.
Ah I missed the raw variable.
Only the raw flavor makes sense for main/be and only the latest version, since we don't publish or sign the main channel. I updated the temporary logic to handle the supported cases.
I tend to support removing the flavor support as an explicit input and instead default to the raw flavor on main only. I'll clean this up in a follow up change when we've done the migration.
I hope to do the migration this week or the next one, no big rush. Deploying this package may be a limiting factor on how fast we can roll it out? But the main channel isn't really that supported.
The migration will happen as an atomic switch when tools/VERSION in the Dart SDK is modified to the new channel. The rest of the infrastructure will respect the channel name in there and start uploading to the new places. Services like api.dart.dev and setup-dart will handle the switch automatically when the new channel pops into existence. The infra isn't quite set up to upload to both places though we could potentially do that, it just isn't the migration path I've planned out at this time.
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.
Deploying this package may be a limiting factor on how fast we can roll it out?
We can release this at any time - it's just creating a github release (https://github.com/dart-lang/setup-dart/wiki/Publishing-procedure). I can take care of that after your work lands.
The bulk of this action is tested via the various matrixs in this file: https://github.com/dart-lang/setup-dart/blob/main/.github/workflows/dart.yml I did make a small change to a file and verified that my version of node and dart sdk produces working javascript: #103. Dart SDK version: 3.2.0-134.0.dev |
bb0680b
to
bb97d87
Compare
This change automatically detects when the main channel pops into existence and starts using the latest version of it instead. The forward compatibility will be removed once the channel has been renamed. Bug: b/270022609
bb97d87
to
1d5b453
Compare
I addressed the code review but unfortunately the tests are still broken when I use the same versions as you.
|
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.
The changes look good; can you update the buganizer ref, and, add appropriate notes to the changelog? We'd want to mention the auto-handling of the old and new channels, and the changed behavior w/ versions and the main channel.
Also - as a point of workflow for github PRs - you don't want to force push to a branch that's out for review; just continue to add commits to it, and then squash them all to the default branch after the review's complete. If you force push than the comments from a review get disassociated with commits from the PR.
Also - it looks like I am able to build artifacts that work; not sure what the difference is. After your updates I'll rebuild the action, then merge this PR.
lib/main.dart
Outdated
channel = 'be'; | ||
version = | ||
raw ? 'latest' : (await latestPublishedVersion(channel, flavor)); | ||
// TODO(b/299435467): Temporary forward compatibility that |
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.
Can you replace this buganizer reference with a github issue ref?
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 could do that though the issue is just for myself to track the cleanups -- our team uses buganizer internally rather than github issues to manage our daily tasks and I never look at my github issues in practice. There's literally no content in the bug besides the title which is repeated here -- it just serves as an unique identifier that I can code search for to find all the relevant code locations that needs fixing. Do you feel I should file an issue in this repo about this cleanup instead?
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.
Gotcha. My main concern was that users w/o access to the bug would have some mystery about what it was tracking. I re-worded this comment slightly to clarify things (the buganizer issue just tracks the channel rename).
Ah good point about force pushes. A habit from my work in other code hosting solutions hehe. Thanks for recompiling for actions for me. Although I really would love if we could figure out why I can't compile them myself, or if there's something special about your setup. I added a CHANGELOG entry :) |
Yeah, I definitely agree here - I want to make sure everyone can contribute; probably worth tracking in an issue to see if other people hit it / have ideas. Thanks for updating the action! |
This change automatically detects when the main channel pops into existence and starts using the latest version of it instead. The forward compatibility will be removed once the channel has been renamed.
Bug: b/270022609
--
I couldn't figure out how to test this change. Could you add some instructions to DEVELOPING about how I can run and test my changes locally? Maybe I could catch a more specific exception or http status code to perform the fallback more cleanly so a transient failure doesn't downgrade from main to be.
No particular timetable on when we'll rename the be channel to main. I actually believe this is the final piece of forward compatibility needed but I'll need to confirm that.