nextstrain / auspice

Web app for visualizing pathogen evolution
https://docs.nextstrain.org/projects/auspice/
GNU Affero General Public License v3.0
290 stars 159 forks source link

Create preview PRs using labels #1767

Closed victorlin closed 2 months ago

victorlin commented 2 months ago

Description of proposed changes

Benefits:

  1. Ease of use - straight from the PR page
  2. Workflow runs will show on the PR checks¹
  3. Downstream PRs will be automatically updated with new PR changes
  4. Simplified logic in reusable workflow

¹ In the case that a preview label already exists and another preview label is added, this results in the workflow for the label that already exists to appear as "skipped" because it has been skipped on the latest event trigger to avoid an unnecessary update.

Checklist

victorlin commented 2 months ago

I haven't seen this approach used before -- did you see it elsewhere or come up with it yourself?

The idea popped in my head while working on #1765. I searched online for "trigger on label" which led me to a StackOverflow example, and I took it from there.

victorlin commented 2 months ago

I'll merge this now since this is a change on the dev side that we can iterate on.

tsibley commented 2 months ago

Did anyone ensure that labels can only be added by us and not random other GitHub users? Because I'm pretty sure anyone can add labels… and that's not what we want here.

victorlin commented 2 months ago

That's a good concern, it hadn't crossed my mind. But I don't think anyone can add labels... I just tried on a random PR I had opened in bioconda-recipes and don't see a way to add a label other than tagging @BiocondaBot please add label which is something they had to strictly allow.

From GitHub docs:

Anyone with triage access to a repository can apply and dismiss labels.

tsibley commented 2 months ago

Yay, that's great. I'm not sure why I recalled being able to add labels to issues/PRs I've created in third-party repos…