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

Consider how to handle repo/issue transfer requests #11

Open
galargh opened this issue Feb 9, 2022 · 3 comments
Open

Consider how to handle repo/issue transfer requests #11

galargh opened this issue Feb 9, 2022 · 3 comments

Comments

@galargh
Copy link
Member

galargh commented Feb 9, 2022

No description provided.

@lidel
Copy link

lidel commented Feb 10, 2022

In my experience, the needs are:

Solution to both could be a bot that executes transfer when the staff comments:

  • @bot-name !move-issue <destination-org/destination-repo-name> (no confirmation, execute the move)
  • @bot-name !move-repo <destination-org>[/<optional-destination-name] (require confirmation via @bot-name !transfer-repo-confirm or something

@galargh
Copy link
Member Author

galargh commented Feb 10, 2022

Nice, thanks for adding this information to the issue. The comment command set you proposed seems very reasonable as well.

In the meantime, I found one case which might be a good indicator that a bot like that should live next to the terraform management setup. Here it is:

  1. Transfer a repository to a new organisation.
  2. Try to refresh terraform config.
    This leaves terraform confused and unable to fix itself without human intervention. If a transfer bot was next to the terraform config, I'm sure we could script around it.

@galargh
Copy link
Member Author

galargh commented Feb 28, 2022

Brain dump

I think this could work something like this.

Let's say I want the bot to do something. I would create a GitHub issue in the github-mgmt repository. The bot - a GitHub Action triggered by changes to GitHub issues - would pick it up and check if I can perform such an action OR if someone that can perform such an action "approved" the issue. If either is true, the bot would move the issue from B to C and close the GitHub issue in github-mgmt.

There are some open questions in this workflow.

Where should the actual command text be placed?

The options would be:

  • the title
  • the comments

I think either the title or description (the first comment) are good options. Either of the two might be a good answer too. Allowing to put the commands not only in the title but also in description gives the users ability to create more human friendly issue titles which is a nice feature.

I think parsing all the comments might be an overkill and it could be abused to issue bot commands that are unrelated to the original issue.

What syntax to use for bot commands?

We do need to be able to extract a command name and parameters. Maybe something similar to what GitHub Actions use for commands could work here? So something along the lines:

::transfer-issue #11 https://github.com/multiformats/github-mgmt::
or
::transfer-issue #11 protocol/github-mgmt-template::

Do we need named parameters? Maybe?

URLs might be a pretty user friendly way of defining the resources both for those requesting the command and those approving.

How to check if the command can be executed?

This could be different for different commands. Maybe for transferring issues it would be enough to be a member of the source organisation? Or have write access to the source repo? This has to be decided but I think the main point I want to make is that we might need different level of permission checks in the bot.

We should first check if the person who created the issue has enough permissions. If not, we should check if it is "approved" and if it is check if the approver has enough permissions.

It might also be a good idea to have a way of always requiring an approval for some commands - as in, even if the person making the request has enough permissions, wait for someone else to ok it.

How to approve an issue?

There's no native way to approve issues as there is for pull requests. I think we could use either reactions, labels or comments for that.

TODO
Notes

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

No branches or pull requests

2 participants