-
Notifications
You must be signed in to change notification settings - Fork 2.7k
WIP: Enable continuous package release to crates.io #9417
Conversation
...rather than using an explicit filter in CI jobs.
| <<: *docker-env | ||
| <<: *test-refs-no-trigger | ||
| script: | ||
| - cargo install cargo-unleash ${CARGO_UNLEASH_INSTALL_PARAMS} |
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.
Is it mature enough to be installed into CI image?
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.
Probably - until it's not v1 I'd prefer not to; the time savings is miniscule I'd say comparing to the actual checking done by the tool later on
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.
not on every commit tho
| unleash-check: | ||
| stage: test | ||
| <<: *docker-env | ||
| <<: *test-refs-no-trigger |
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.
do you really want to publish before the tests are green?
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.
That's the unleash-check - I think it should be run early/at the same time as tests; only publishing should be done after every test is green
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.
In my view (I actually do not know what does it check, Check whether crates can be packaged in the docs is probably not enough) it's an overkill to run these checks on every commit. We should run them before the release target, so maybe on master, or even nightly?
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.
If I understand this correctly, what you propose may lead to the PR checks being green at first but only discovered to be red once merged. If that's the case, then won't be much incentive to fix this once a PR is merged and it'll just hang around being red until someone disables it again - I'd rather we catch that early.
If this is deemed to expensive to run on every commit, we might want to run this as an extra step for bot merge to not merge a given PR until we know for sure that this check is green.
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.
It is expensive, the job takes 30 minutes. Any possible way to combine it with something to reuse the cache?
Ideally, it will run on the pre-merge pipeline and a merge-train, but they are not ready yet.
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.
Maybe it's better to either check only if certain files are changed or versions got bumped?
| publish-to-crates-io: | ||
| stage: publish | ||
| needs: | ||
| - job: unleash-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.
Either you should list the jobs necessary to be green in order to start this job, because this way it starts right after unleash-check without waiting anything else. Or remove this needs and the stage won't start if the previous jobs are not successful. I prefer the latter.
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 we somehow make it so that it runs at publish but also make sure that unleash-check is never allow_failure: true?
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.
By publish I mean only after everything else completes from the test stage and so on
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.
We can run unleash check on the build stage, so after all the code tests pass, and unleash em-dragons on the publish phase after everything's proven to be buildable.
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 can move this to the build stage if you want me to, running parallel to the tests is also good (at least wrt developer feedback latency, maybe not so much wrt CI builder overhead 😀 )
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.
it's worth it, the test stage already brings a lot of concurrent jobs. The longest job in the test stage is test-linux-stable , which takes 36 minutes. This one takes ~32. The longest on the build stage is check-polkadot-companion-build , so unless we make use of caching (or simplify it somehow) it will severely contribute to the pipelines concurrency.
|
@s3krit what's your take on releasing on every commit to master? That's something even beyond nightly releases in my view. |
| publish-to-crates-io: | ||
| stage: publish | ||
| needs: | ||
| - job: unleash-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.
We can run unleash check on the build stage, so after all the code tests pass, and unleash em-dragons on the publish phase after everything's proven to be buildable.
| # cycle and cannot proceed with publishing/checking | ||
| - cargo unleash de-dev-deps | ||
| - cargo unleash em-dragons --no-check --owner github:paritytech:core-devs --dry-run | ||
| allow_failure: true |
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.
this may be removed as soon as it will publish stably.
|
This means we can finally increase a crate version and it will be published? |
My general view would be that it might be better for developers to have the power themselves to bump versions and only then would it get pushed to crates.io. I.e., rather than us using CI to detect whether or not we need to push to crates.io or whatever, we simply let the much smarter developers decide whether they want to release a new version of a crate (and subsequent dependencies). That being said, if we're not really doing much in the way of additional testing/QA once something's been committed to master, I'm not really sure what the drawback is. If we're happy for something to be merged with master, due to the way we currently use substrate and builders use substrate, we're basically saying 'this is OK to use' (as I understand it). And pushing to crates.io just makes it easier for developers. Of course, I could be entirely wrong here. |
TriplEight
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.
Right, let's publish just on version bumps.
Yes.
That is inconsistent with the requirement from @bkchr just stated above. Why should this not be run unless a specific tag is set?
This discussing is irrelevant, as this is not what is happening here. To clarify: |
|
Ok, this makes sense then. Thanks @gnunicorn . Then it should run on master. |
It's waiting for another review, but not sure how long that will take tbh.
That might work, though I would need to change the deps on my PRs to use the git dependency which would break the unleash CI. But I think that has changed now to be non-mandatory. |
| unleash-check: | ||
| stage: test | ||
| <<: *docker-env | ||
| <<: *test-refs-no-trigger |
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.
Maybe it's better to either check only if certain files are changed or versions got bumped?
Co-authored-by: Denis Pisarev <[email protected]>
|
Hey, is anyone still working on this? Due to the inactivity this issue has been automatically marked as stale. It will be closed if no further activity occurs. Thank you for your contributions. |
| stage: publish | ||
| needs: | ||
| - job: unleash-check | ||
| <<: *docker-env |
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.
| <<: *docker-env | |
| <<: *docker-env | |
| <<: *build-refs |
| unleash-check: | ||
| stage: test | ||
| <<: *docker-env | ||
| <<: *test-refs-no-trigger |
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.
| <<: *test-refs-no-trigger | |
| <<: *build-refs |
|
cc #9705 |
|
Hey, is anyone still working on this? Due to the inactivity this issue has been automatically marked as stale. It will be closed if no further activity occurs. Thank you for your contributions. |
...rather than doing it only on select tags. This should publish only versions that are not published yet.
Related #7634
cc @gnunicorn @TriplEight