-
Notifications
You must be signed in to change notification settings - Fork 389
xtask command to use a local registry
#4655
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
base: main
Are you sure you want to change the base?
Conversation
|
This is really cool! Thanks for experimenting with this. Using local registries is a good idea, I forgot that I've already played with them this year with those semver experiments :D. I need to play around with this a bit before I start reviewing but I have some initial thoughts. Can we reuse our current test suite and examples? We have great coverage already, it would be great to reuse these in the "release test" instead of separate compile tests. Note that I'm happy for this to land with separate tests with a view to reusing the tests later. |
Probably yes - after some pre-processing we should be able to check with the "upcoming" release - maybe in addition to the (hopefully) zero-maintenance compile-tests. I already just identified one thing where the compile-tests idea is lacking: e.g. renaming |
7542fb6 to
23f4f61
Compare
SergioGasquez
left a comment
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 was able to run the tests on my machine, the README was very useful and made things very easy! Thanks! Left a few comments/nitpicks!
xtask/src/commands/relcheck.rs
Outdated
| let _ = std::fs::create_dir("compile-tests/.cargo"); | ||
|
|
||
| std::fs::write( | ||
| "compile-tests/.cargo/config.toml", |
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.
Should we add this to .gitignore?
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'm undecided what would cause more harm: unintentional commits or forgetting to commit something which should get committed
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.
oh sorry - that file is not changed but created just for the processing .... will add it to the ignore list
23f4f61 to
9342fa6
Compare
|
My local testing suggests this is working so far. Probably the code could use some more love Not sure if we want to automate things in a release in future but maybe we want to keep this isolated for now and give it a try during the next release first |
MabezDev
left a comment
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.
How will we integrate this into our release workflow? I'm a bit concerned we're duplicated some release steps in a new relcheck command. Any reason not to make this part of the release process and use the same plan.json for creating the release environment?
That is probably the what we want in the end - I hesitated to do a deeper integration before seeing this working fine manually with a real release. (That's also the reason this is as little integrated into anything as possible) I didn't wanted to take the blame for stopping all engines during a release because something dumb is not quite right yet (i.e. my idea was to do the manual verification after applying the plan and before publishing manually) |
I think that we'll want this as part of our release process asap. I don't think we particularly need to worry about blocking a release (after all we can always delay a release by a few days and no one will die). I think I'd like to see this a bit more integrated before we land this. If we land this as a separate command, I fear it won't get used. If you're really worried about blocking the release, we can add a |
|
I see - would you prefer to run this after applying the plan or before publishing? (as part of those commands) There are a few very unfortunate things here - e.g. that whole priming of the local registry is not great (and I am thinking about ways to change that) - also modifying the manifests and then reverting it is ugly Changing this to draft for now then - maybe the real solution will be a new PR or it will be this PR |
I think this should come between executing the plan (bumping all the versions and merging the PR) and publishing, as a final check before we actually publish. I need to formulate this into some documentation, but this is the flow of a release currently: #4732 (comment), I think it should be a step just after "from main with PR merged". |
On second thoughts, I'd like this step to be run in CI, not on the releaser's machine. So it probably makes sense to trigger this step as part of opening the bump PR (execution phase), we already do this with the docs (via label). With all that in mind, maybe we need less changes than I thought here. I would just convert all the individual steps we have in the readme into a workflow that gets triggered by a label. The only things that might need to change here is that this PR won't need to bump packages, it it needs to do is seed the registry with the compile test application and then use the bumped versions from the release PR. What do you think? |
|
Thanks! Running it in CI sounds like a great idea - makes we less afraid of the temporarily modified files (need to look into the triggering of the docs workflow) I probably need / want to change a few things to make that workflow simple and the general process more robust |
e3ff452 to
672ee04
Compare
|
Before trying to create the workflow and polishing the code some instructions to test this.
You can repeat this and edit the release plan before executing it to see how a bad run would look like |
|
I ran into an issue when following the steps above: I'm using latest stable release here. It's probably just some weirdness with my local setup. Overall having a brief look at the code, I think we're ready to try and integrate it into the workflow. We might want to make the |
fb246db to
177ef4e
Compare
|
I added a workflow but I refrained from refactoring the workflows for now - turned out the overlap of Ofc the workflow currently runs into errors when trying to compile the examples/tests - we need a real release to test it |
MabezDev
left a comment
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.
Overall this looks good to me! I would still like to eventually turn the CI workflow into a composite one and test here, but this is more than enough for a start. Thanks!
This explores the idea of #4532
It's using a local registry (in the file system) instead of using a full-fledged registry. This makes things much more lightweight.
Instead of trying to "bend" things to use our registry for our crates only, this is using source replacement.
This makes things much easier and even more important: more realistic.
In theory this is violating one of the assumption Cargo has about it.
This makes totally sense for regular use but I'd say in our case it's okay (and it a very temporary thing).
Since
cargois aware of the replacement it won't mix up the registries in it's cache - the worst to happen might be ending up with some orphaned directories in the Cargo cache.This is not integrated into any of the release related tasks (yet) - it's just available as a set of xtask commands. But it already allows to estimate the consequences of updates. (the README.md in
compile-testshopefully explains things well enough)We might want / need to add some more test projects under the
compile-testsfolder to get a better coverage of different targets and feature sets. (But for the now this would just add noise - so I kept things simple)It would be good if this could get tested in different environments - on my side I tested it in Windows and WSL2.
Pretty sure there are still some rough edges we should flesh out before integrating this more.
(The code is POC-quality currently - I'm more interesting in someone else to try and play with it before polishing and nit-picking )