Skip to content
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

Add Ability to Push Cleanup Commits to PRs based on comments #14

Closed
blink1073 opened this issue Jan 22, 2022 · 2 comments
Closed

Add Ability to Push Cleanup Commits to PRs based on comments #14

blink1073 opened this issue Jan 22, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@blink1073
Copy link
Contributor

blink1073 commented Jan 22, 2022

Problem

We would like to be able to run simple cleanup scripts against PRs without having to use the command line.

Proposed Solution

We should allow maintainers to make "magic comments", similar to how the bots work in conda-forge.
A repo could provide a set of comments that are applicable, and the script that should be run for the given comment.
The bot would look for a matching comment on an issue_comment event, and if the user has an author_association of OWNER, COLLABORATOR, or MEMBER, it will do the following:

  • Post a comment to the issue signifying that the script is running
    • If the user is not authorized, post an issue comment and bail
  • Check out the branch in the pull request in a temporary directory
  • Run the appropriate script (or list of scripts)
  • Commit the message using its own Git credentials
  • Push the commit to the PR
  • Delete the checkout

We could decide that some common phrases are always available, like @jupyterlab-bot, please run pre-commit could always trigger a pre-commit run --all-files with no configuration necessary in the repo.

Another option is to have a @jupyterlab-bot, please auto format, and have that by default run pre-commit run --all-files, but allow config to override.

Note: get a issue_comment event for testing, add a webhook to a repo, selecting "Issue comments". Add a comment to an issue, then grab the payload from the resulting event.

Additional context

We added a limited version of this in jupyterlab/maintainer-tools#39, but it would be cleaner to do it here.

@blink1073
Copy link
Contributor Author

Alternative solution: scientific-python/MeeseeksDev#58

@blink1073
Copy link
Contributor Author

Closing in favor of meeseeks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant