Skip to content

POC: Actions to comment on draft PR - #10733

Merged
pllim merged 1 commit into
astropy:masterfrom
pllim:actions-poc-draft-comment
Feb 15, 2021
Merged

pllim merged 1 commit into
astropy:masterfrom
pllim:actions-poc-draft-comment

Conversation

@pllim

@pllim pllim commented Sep 15, 2020 •

Copy link
Copy Markdown
Member

Description

This pull request implements our first GitHub Action! It leaves a friendly comment when a Draft PR is opened. The comment reminds PR author that they can skip CI if it is not ready. This is based on a discussion that happened, starting around #10729 (comment) .

Examples of this same Action, uh, in action:

p.s. A draft PR about a draft PR. Much Actions, so meta!

Alternative using astropy-bot

  1. Add draft property for PR handler OpenAstronomy/baldrick#99 needs to get reviewed and merged.
  2. baldrick needs to be re-deployed by Tom R or Stuart M (unless deploy is automatic somehow?).
  3. Comment on draft PR astropy-bot#118 needs to be tested and merged.
  4. astropy-bot needs to be re-deployed by Tom R (unless deploy is automatic somehow?).
  5. Integration test of new bot feature with this repo. This step can be moved up a little if Tom R is willing to deploy Comment on draft PR astropy-bot#118 on experimental branch first and hook it up to a test repo.

@mhvk mhvk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That looks nice! I think having a message also for the case when someone turns a regular PR into a draft PR is useful (though would be nice if it happened only once).

Comment thread .github/workflows/draft_pr_comment.yml Outdated
runs-on: ubuntu-latest
steps:
- name: 'Comment Draft PR'
uses: actions/github-script@v3

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a comment where the script comes from?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the feedback! I'll refrain from making this too fancy, though, until we have a buy-in. I just want to show that it is possible right now. For a more complicated workflow, like checking if the bot has commented before, I'll have to investigate more and maybe writing a script to go with this action.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It certainly gives a sense of what's possible; agreed that we should first discuss what to do, since ideally we do not have two different systems.

@bsipocz bsipocz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, and does the job.

@pllim

pllim commented Sep 15, 2020

Copy link
Copy Markdown
Member Author

As @astrofrog requested, I also updated my original post above to include a route for "Alternative using astropy-bot".

@pllim pllim modified the milestones: v4.2, v5.0 Oct 21, 2020
@pllim
pllim force-pushed the actions-poc-draft-comment branch from 5e5d023 to 28bd1f7 Compare January 8, 2021 20:43
@pllim

pllim commented Jan 8, 2021 •

Copy link
Copy Markdown
Member Author

A lot has happened since this was opened, so I removed the standalone YAML and put labeler and this new Action in the same YAML instead. I also cancelled the CI.

MNT: Add action to comment on draft PR.
@pllim
pllim force-pushed the actions-poc-draft-comment branch from 28bd1f7 to 932b78d Compare February 11, 2021 20:34
@pllim pllim modified the milestones: v5.0, v4.3 Feb 11, 2021
@pllim
pllim marked this pull request as ready for review February 11, 2021 20:35
@pllim
pllim requested a review from embray February 11, 2021 20:36
@pllim

pllim commented Feb 11, 2021

Copy link
Copy Markdown
Member Author

If there are no objections, I would like to get this in and see how things go. We can think about how to handle the use case when someone opens a non-draft PR but then turn it into draft in a future PR, if there is enough demand.

@embray embray left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me =)

@pllim

pllim commented Feb 15, 2021

Copy link
Copy Markdown
Member Author

Thanks for the reviews! Merging.

@pllim
pllim merged commit 1641661 into astropy:master Feb 15, 2021
@pllim
pllim deleted the actions-poc-draft-comment branch February 15, 2021 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants