Implementation of bot in this repository #8574
Replies: 57 comments
-
Progress: Completed the feature where the bot adds and removes the label when any PR fails or succeeds. Next thing to implement is to write proper tests for it. |
Beta Was this translation helpful? Give feedback.
-
So, the bot is now in a good condition (100% coverage on tests) to be installed, you can check it out at the above link. @cclauss Do we really want to directly close the PR if it doesn't contain any tests or type hints? Also, this will only work if it contains zero tests and zero type hints. |
Beta Was this translation helpful? Give feedback.
-
It's also good for the bot to display those metrics in comments. If the none of the files changed end with |
Beta Was this translation helpful? Give feedback.
-
If a contributor suggests a change to one of our .md files or .yml files, I do not think we want to autoclose that PR. |
Beta Was this translation helpful? Give feedback.
-
@cclauss yeah I might state that wrongly: sometimes there're PRs with files without any file extension. We can deal with that case |
Beta Was this translation helpful? Give feedback.
-
I think there should be some subtlety in how the bot behaves... If the repo has > 50 open PRs then the bot should be more aggressive about autoclosing non-compliant PRs. If there are few PRs then the bot should add labels to PRs and maintainers should guide the contributors to make appropriate corrections before the stalebot jumps it. Is it possible for the bot to see how many open PRs the repo has? Should we shorten the waiting times on stalebot? |
Beta Was this translation helpful? Give feedback.
-
This idea can be implemented: auto close the PR with files without any file extension or better to have a list of accepted file extension:
Kind of. GitHub REST API (v3) considers all pull requests as issues but not all issues are considered pull requests, so the number we get is the combination of open issues and pull requests. Maybe the GraphQL API (v4) has the ability to give us the exact information, I will have to look into that. My question was whether to close the PR or label it appropriately when there are no type hints or any kind of tests. |
Beta Was this translation helpful? Give feedback.
-
The bot should always label the PR. My vote would be that if the repo has > 50 open PRs, the bot should also autoclose PR. |
Beta Was this translation helpful? Give feedback.
-
Another thing is that I'm changing the way I commit in the bot repository. I will be making different branches for related features and master will only be used for deployment which is done automatically after all the tests pass. All the constants related to the bot will be in either the Some ideas when a pull request is opened:
Also, whatever ideas anyone get just dump it here. I will make it work if it is possible :) |
Beta Was this translation helpful? Give feedback.
-
Check of no boxes are checked in the default commit message. |
Beta Was this translation helpful? Give feedback.
-
Yes, that is a good idea. But should we close the PR or label/comment it appropriately? |
Beta Was this translation helpful? Give feedback.
-
An unmodified default commit message == an empty commit message in my book. I would delete if we have a lot of open PRs. |
Beta Was this translation helpful? Give feedback.
-
Alright, got it |
Beta Was this translation helpful? Give feedback.
-
What are the criteria for marking a pull request as
Any other? |
Beta Was this translation helpful? Give feedback.
-
Woah! Take a look at this: dhruvmanila/testing#15
Please open a PR to make the changes for the comments the bot will be posting. I just made the basic ones to test out the bot: |
Beta Was this translation helpful? Give feedback.
-
With the help of @cclauss I was able to implement the feature where the bot will add a label to indicate the PR is ready to be reviewed by a maintainer ( Code: https://github.com/dhruvmanila/algorithms-keeper/blob/master/algorithms_keeper/pull_requests.py#L268 |
Beta Was this translation helpful? Give feedback.
-
It seems that the This is my proposed workflow for labeling the status of the pull request:
Ignore this, we don't need this type of workflow. Another thing I'm thinking is to let the bot comment regarding the missing requirements in every check as just the label part won't be enough for the user to understand. The later comments will include only the |
Beta Was this translation helpful? Give feedback.
-
I have got another idea: instead of commenting, we will make the bot start a check run and then that will initiate the parser in the code and the parser will go through all the files for missing requirements. After that, the bot will annotate the missing requirements right in the code with just one sentence like |
Beta Was this translation helpful? Give feedback.
-
On the labels... keep the flow simple. On the comments... make them as helpful and foolproof as possible. The more explicit the comments can be about the requested change, the better. I would like us to réengage with mypy even if it is for just one directory to start with. |
Beta Was this translation helpful? Give feedback.
-
This is my proposed changes for the label:
The bot shouldn't remove the As for the comments, how about this?
|
Beta Was this translation helpful? Give feedback.
-
Please make the choice that you feel most comfortable with. For me, I want one label that I can click on to see all (and only) PRs that are ready to be reviewed. That label tells me that all tests have passed and that changes have been made to address any previous review comments. Having multiple flavors of |
Beta Was this translation helpful? Give feedback.
-
Yes, then it makes sense to remove the
|
Beta Was this translation helpful? Give feedback.
-
Take a look at this. |
Beta Was this translation helpful? Give feedback.
-
Currently, |
Beta Was this translation helpful? Give feedback.
-
Edit: A much simpler workflow then previously suggested: https://imgur.com/74IAXG5 |
Beta Was this translation helpful? Give feedback.
-
The only thing missing from the flow is the change of status when automated tests fail. New PR --> Awaiting Review --> automated tests fail --> Awaiting Changes |
Beta Was this translation helpful? Give feedback.
-
This is the workflow around New PR ->
There is |
Beta Was this translation helpful? Give feedback.
-
@cclauss @poyea If possible, please re-approve the PR if there were commits made after being approved. It makes sense that if the PR is approved at the current state and then there are any changes added the PR needs to be reviewed and approved again. That's the way the bot understands :) As a safety net I will remove all |
Beta Was this translation helpful? Give feedback.
-
Hi there! There is one other way the bot could represent the missing requirement information in the pull request:
|
Beta Was this translation helpful? Give feedback.
-
I'm going with option number 2: dhruvmanila/testing#34 (review) Check run annotation will only be visible in the files section and the checks section which is one click away for the author. We want to make it easy for them to see what is missing in their submission and review comments seems to be the best way. The code is visible, where is it missing is visible, the file name will be provided in the comment. On a side note, I was rewriting the parser and there's going to be a |
Beta Was this translation helpful? Give feedback.
-
I'm currently working on implementing a bot: https://github.com/dhruvmanila/algobot
Currently, it can only greet the user who installed the app but I will add the functionality mentioned in this comment soon. The bot uses asynchronous programming in Python, GitHub REST API to make the calls and Heroku for hosting.
If anyone got any further ideas to be implemented or they want to help, please do tell.
P.S. Can anyone suggest a name and display photo for the bot?
Beta Was this translation helpful? Give feedback.
All reactions