-
Notifications
You must be signed in to change notification settings - Fork 688
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
ci: easy pre-releases for new packages #4757
Conversation
|
f74b979
to
c02d18c
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4757 +/- ##
==========================================
- Coverage 75.66% 71.83% -3.84%
==========================================
Files 243 285 +42
Lines 13226 14761 +1535
Branches 3396 3719 +323
==========================================
+ Hits 10008 10603 +595
- Misses 3218 4158 +940 |
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.
Nice improvement!
Expose ACTIONS_RUNTIME_TOKEN and ACTIONS_RESULTS_URL variables
Switch to `workers-sdk` object in `package.json`
426db8a
to
4f1129a
Compare
A wrangler prerelease is available for testing. You can install this latest build in your project with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/7584753028/npm-package-wrangler-4757 You can reference the automatically updated head of this PR with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/7584753028/npm-package-wrangler-4757 Or you can use npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/7584753028/npm-package-wrangler-4757 dev path/to/script.js Additional artifacts:npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/7584753028/npm-package-miniflare-4757 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/7584753028/npm-package-cloudflare-pages-shared-4757 npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/7584753028/npm-package-create-cloudflare-4757 --no-auto-update Note that these links will no longer work once the GitHub Actions artifact expires.
Please ensure constraints are pinned, and |
assert.strictEqual(name, "wrangler"); | ||
const url = getPrereleaseArtifactUrl(name); | ||
const prUrl = getPrereleasePRArtifactUrl(name); | ||
return `A wrangler prerelease is available for testing. You can install this latest build in your project with: |
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 am not a big fan of the markdown being all included here like so (and all the backticks escapes)
I am fine with it, but hopefully we can come up with something more convenient at some point 🙂
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.
Also I've disliked the prerelease comment for a while and I did try to update it 😅
It's not something really related to this PR, but yeah I'd love it if we could improve the comment/report as a whole, I just figured I'd mention it here 😄
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 fair. Could consider extracting the comment into a template file and using something like Handlebars? Although, given we don't modify the template that much, it might not be worth the additional complexity.
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.
Yes, I was thinking of something like handlebars as well 🙂
But it was just a thought, I actually don't think we should overthink this in this PR and increase it's scope, I'm 100% fine with the current implementation, I just wanted to mention that it'd be nice maybe later at some point to improve things 🙂
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.
Captured in #4790 🙂
@mrbbot sorry it is a bit unrelated... 😅 But in the runtime versions we sometimes get an extra Since you're already touching the prerelease could you also amend 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.
Looks great to me! 🤩
I just left a few very very minor nitpicks 😅
Remove extraneous `|` in pre-release comment
@dario-piotrowicz Fixed that |
|
||
/** @returns {~Package[]} */ | ||
export function getPackagesForPrerelease() { | ||
return getPackages().filter((pkg) => pkg.json["workers-sdk"]?.prerelease); |
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.
Just a quick idea, It doesn't need to be implemented in this PR but I wanted to mention it 🙂
This function gets all the packages that have the prerelease
field regardless on whether they have been modified in the PR or not (at least that's my understanding)
Could we improve this by checking using git if files within the package have changes and if not, not generate a prerelease for it at all?
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 is a good idea, I've captured it along with other suggestions in #4790 🙂
Simplify validation/extraction of `githubPullRequestNumber`
Use `forEach` instead of `for of`
Explain why we need custom action for extracting action variables
What this PR solves / how to test:
I'm planning to put a PR up for Miniflare 3's new Vitest unit-testing environment soon. This is going to be a separate
@cloudflare/vitest-pool-workers
package. While the PR is being reviewed, it would be nice to have pre-releases of the package available.Currently, we have two pre-release workflows, one that's triggered on pull requests to build pre-releases and publish them as artifacts, and then another that's triggered from
main
when the first completes to write pre-release URLs to a sticky comment. Both of these workflows must be updated to add a new package to the pre-release registry.As the 2nd workflow is triggered from
main
, a separate PR to add@cloudflare/vitest-pool-workers
to the comment would be needed, before the PR implementing the package could be put up. When packages have dependencies on other pre-released packages, these dependencies must be hardcoded in the workflow too.This change allows any package to be included in the pre-release registry by adding
"workers-sdk": { "prerelease": true }
to itspackage.json
. Anydependencies
that are also marked as pre-releasable are automatically updated to point to the correct pre-release URL.Author has addressed the following:
Note for PR author:
We want to celebrate and highlight awesome PR review! If you think this PR received a particularly high-caliber review, please assign it the label
highlight pr review
so future reviewers can take inspiration and learn from it.