vitest
vitest copied to clipboard
chore: add `pkg.pr.new`
Description
This PR includes:
- update PR template to include
/publishtip - add CR comment workflow via
/publish(tip on the PR template) - add CR workflow to use
cr-trackedlabel - release all packages: we can add one workflow per package releasing only the corresponding one
This PR requires:
- create a
cr-trackedlabel - add pkg-pr-new app to vitest package
- add
CR_PATsecret to Actions with a token withpublic_repo(Classic Token): later we can automate it with something like this https://github.com/vitest-dev/vitest/blob/main/.github/workflows/ecosystem-ci-trigger.yml#L63C1-L68 (I'm a newbye on GH actions/webflows)
This PR requires also a review to exclude CR for docs for example, we can use something like this in on.pull_request:
paths-ignore:
- '.github/**'
- 'test/**'
- 'examples/**'
- 'docs/**'
- '*.md'
/cc @Aslemammad
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
- [ ] It's really useful if your PR references an issue where it is discussed ahead of time. If the feature is substantial or introduces breaking changes without a discussion, PR might be closed.
- [ ] Ideally, include a test that fails without this PR but passes with it.
- [ ] Please, don't make changes to
pnpm-lock.yamlunless you introduce a new test example.
Tests
- [ ] Run the tests with
pnpm test:ci.
Documentation
- [ ] If you introduce new functionality, document it. You can run documentation with
pnpm run docscommand.
Changesets
- [ ] Changes in changelog are generated from PR name. Please, make sure that it explains your changes in an understandable manner. Please, prefix changeset messages with
feat:,fix:,perf:,docs:, orchore:.
Deploy Preview for vitest-dev ready!
| Name | Link |
|---|---|
| Latest commit | 094916af9ee22a3713ca8dacedb239e029845fc4 |
| Latest deploy log | https://app.netlify.com/sites/vitest-dev/deploys/66fb3863210ac1000801e7bd |
| Deploy Preview | https://deploy-preview-6362--vitest-dev.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
I love this.
@userquin We discussed about how to trigger pkg.pr.new and we agreed "cr-tracked" label based workflow is okay. I'll push a few commits here and see how it goes.
@sheremet-va We haven't installed the app yet? https://github.com/vitest-dev/vitest/actions/runs/11050071341/job/30697038656?pr=6362#step:7:13
{"url":"/check","statusCode":404,"statusMessage":"Not Found","message":"The app https://github.com/apps/pkg-pr-new is not installed on vitest-dev/vitest."}
@sheremet-va We haven't installed the app yet? vitest-dev/vitest/actions/runs/11050071341/job/30697038656?pr=6362#step:7:13
{"url":"/check","statusCode":404,"statusMessage":"Not Found","message":"The app https://github.com/apps/pkg-pr-new is not installed on vitest-dev/vitest."}
We didn't install anything
Should be installed now
you need to add the app to vitest repo: https://github.com/stackblitz-labs/pkg.pr.new?tab=readme-ov-file#setup
@vitest/coverage-istanbul
pnpm add https://pkg.pr.new/@vitest/coverage-istanbul@6362
@vitest/browser
pnpm add https://pkg.pr.new/@vitest/browser@6362
@vitest/coverage-v8
pnpm add https://pkg.pr.new/@vitest/coverage-v8@6362
@vitest/expect
pnpm add https://pkg.pr.new/@vitest/expect@6362
@vitest/pretty-format
pnpm add https://pkg.pr.new/@vitest/pretty-format@6362
@vitest/mocker
pnpm add https://pkg.pr.new/@vitest/mocker@6362
@vitest/spy
pnpm add https://pkg.pr.new/@vitest/spy@6362
@vitest/snapshot
pnpm add https://pkg.pr.new/@vitest/snapshot@6362
@vitest/runner
pnpm add https://pkg.pr.new/@vitest/runner@6362
@vitest/utils
pnpm add https://pkg.pr.new/@vitest/utils@6362
@vitest/ui
pnpm add https://pkg.pr.new/@vitest/ui@6362
vite-node
pnpm add https://pkg.pr.new/vite-node@6362
@vitest/web-worker
pnpm add https://pkg.pr.new/@vitest/web-worker@6362
@vitest/ws-client
pnpm add https://pkg.pr.new/@vitest/ws-client@6362
vitest
pnpm add https://pkg.pr.new/vitest@6362
commit: 094916a
@userquin We discussed about how to trigger pkg.pr.new and we agreed "cr-tracked" label based workflow is okay. I'll push a few commits here and see how it goes.
Check vitepress repo, using vue bot, check cr.yml and cr-comment.yml here: https://github.com/vuejs/vitepress/tree/main/.github/workflows
@userquin cr-comment.yml doesn't look necessary since we can just add label manually when we want to allow PRs to be released. Isn't it only doing /publish comment to trigger adding label cr-tracked indirectly?
@hi-ogawa I've sent you an invitation to vue discord server and a link to Vitepress room/channel, I asked brc_dd and his answer was:
Actually, github actions can also add labels but labels added via their default bot cannot trigger other actions. 🫠 That's why add it using separate user.
Actually, github actions can also add labels but labels added via their default bot cannot trigger other actions. 🫠 That's why add it using separate user.
We don't want to add labels automatically. The idea is that the maintainer adds a label to allow CR manually
Yeah, I just also checked re-labeling "cr-tracked" and this alone can also trigger CR correctly. https://github.com/vitest-dev/vitest/actions/workflows/cr.yml
I tested a few examples locally and also on stackblitz and it looks working https://stackblitz.com/edit/vitest-dev-vitest-ei9jaw?file=package.json I think we can proceed with this PR.
For reference, adding the label automatically refers to this scheme:
- https://github.com/vitejs/vite/pull/18211
I think adding a label instead of a comment is quite nice too, so good to move forward with this PR as is. I think in Vite we'll keep the comment (with the label workaround). We can try both approaches and see what ends up working best.
Do we need a mention in the readme/documentation that we have this? We have this for example: https://vitest.dev/guide/#using-unreleased-commits
https://github.com/vite-pwa/vite-plugin-pwa/blob/main/.github/pull_request_template.md
Do we need a mention in the readme/documentation that we have this? We have this for example: vitest.dev/guide#using-unreleased-commits
vite-pwa/vite-plugin-pwa@
main/.github/pull_request_template.md
The comment can only be added by the maintainers
We also publish every commit on main
I just pushed a few commits but pkg-pr-new publish is getting stuck today.
@Aslemammad Could it be some infra issue? Would be great to know if there's something we can do to diagnose issue.
EDIT: Oh, it got OOM https://github.com/vitest-dev/vitest/actions/runs/11115894967/job/30885165567#step:7:22
interesting, can you trigger a re-run for the failed workflow?
Thanks for the help. I started a re-run and it looks like it's still stuck.
That's bad, I'll just have a look soon!
I think it is fixed now, feel free to trigger a re-run!
@Aslemammad Thanks! I confirmed pkg-pr-new is working now https://github.com/vitest-dev/vitest/actions/runs/11115894967/job/30904769639?pr=6362
Happy to hear that ❤️