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 a bot to add models on behalf of users #255

Open
RunDevelopment opened this issue Jul 7, 2023 · 0 comments
Open

Add a bot to add models on behalf of users #255

RunDevelopment opened this issue Jul 7, 2023 · 0 comments

Comments

@RunDevelopment
Copy link
Member

Add a bot that extracts the JSON of models from code blocks in GH issues and then adds them to the database when they are valid and approved. This will allow people to make changes to the project without ever checking out the code or making a PR.

The bot should work as follows:

  1. When someone makes an issue, it will scan the issue's body for a special code block containing the diff for the model DB. If none at found, the bot won't do anything.
  2. The bot will exact the diff and validate it. Validation works by applying the diff to a CI workflow-local version of the database and then running the usual DB validation. (Validation has to be re-run every time the issue comment is edited and every time the database is changed.)
    1. If checks fail, the bot will post a comment (or update its previous one) explaining the problems validation found. The bot will add a "Needs changes" label to the issue and remove any other bot-related labels.
    2. If checks succeed, the bot will post a comment (or update its previous one) saying that the change is ready to be applied. The bot will add a "Needs review" label to the issue and remove any other bot-related labels.
  3. A human reviewer can now review the changes and either request further changes or accept the change. If the reviewer accepts the changes, they will add the "Accepted" label to the issue.
  4. The bot listens for label changes and sees the "Accepted" label. It will run validation once more (just to be sure), and upon success it will make a commit directly into the main branch with the changes applied. The issue creator will be tagged as the co-author of the commit.

Having good validation will be important. Ideally, we will get validation to the point where it covers all (simple) mistakes people make.

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

1 participant