vitest icon indicating copy to clipboard operation
vitest copied to clipboard

chore: add `pkg.pr.new`

Open userquin opened this issue 1 year ago • 2 comments

Description

This PR includes:

  • update PR template to include /publish tip
  • add CR comment workflow via /publish (tip on the PR template)
  • add CR workflow to use cr-tracked label
  • release all packages: we can add one workflow per package releasing only the corresponding one

This PR requires:

  • create a cr-tracked label
  • add pkg-pr-new app to vitest package
  • add CR_PAT secret to Actions with a token with public_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.yaml unless 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 docs command.

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:, or chore:.

userquin avatar Aug 19 '24 14:08 userquin

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...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] avatar Aug 19 '24 14:08 netlify[bot]

I love this.

Aslemammad avatar Aug 19 '24 18:08 Aslemammad

@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.

hi-ogawa avatar Sep 26 '24 10:09 hi-ogawa

@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."}

hi-ogawa avatar Sep 26 '24 10:09 hi-ogawa

@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

sheremet-va avatar Sep 26 '24 10:09 sheremet-va

Should be installed now

sheremet-va avatar Sep 26 '24 10:09 sheremet-va

you need to add the app to vitest repo: https://github.com/stackblitz-labs/pkg.pr.new?tab=readme-ov-file#setup

userquin avatar Sep 26 '24 10:09 userquin

@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

pkg-pr-new[bot] avatar Sep 26 '24 10:09 pkg-pr-new[bot]

@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 avatar Sep 26 '24 10:09 userquin

@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 avatar Sep 26 '24 10:09 hi-ogawa

@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.

userquin avatar Sep 26 '24 10:09 userquin

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

sheremet-va avatar Sep 26 '24 11:09 sheremet-va

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

image

hi-ogawa avatar Sep 26 '24 11:09 hi-ogawa

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.

hi-ogawa avatar Sep 26 '24 23:09 hi-ogawa

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.

patak-dev avatar Sep 27 '24 07:09 patak-dev

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

userquin avatar Sep 30 '24 16:09 userquin

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

sheremet-va avatar Sep 30 '24 16:09 sheremet-va

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

hi-ogawa avatar Oct 01 '24 00:10 hi-ogawa

interesting, can you trigger a re-run for the failed workflow?

Aslemammad avatar Oct 01 '24 04:10 Aslemammad

Thanks for the help. I started a re-run and it looks like it's still stuck.

hi-ogawa avatar Oct 01 '24 04:10 hi-ogawa

That's bad, I'll just have a look soon!

Aslemammad avatar Oct 01 '24 05:10 Aslemammad

I think it is fixed now, feel free to trigger a re-run!

Aslemammad avatar Oct 01 '24 09:10 Aslemammad

@Aslemammad Thanks! I confirmed pkg-pr-new is working now https://github.com/vitest-dev/vitest/actions/runs/11115894967/job/30904769639?pr=6362

hi-ogawa avatar Oct 01 '24 09:10 hi-ogawa

Happy to hear that ❤️

Aslemammad avatar Oct 01 '24 10:10 Aslemammad