NEAR-DevHub / race-of-sloths

A fun way to contribute to open source. Contribute, get recognized, and boost your profile
https://race-of-sloths.com
6 stars 1 forks source link

implement the bot #33

Closed ftdgoodluck closed 2 months ago

ftdgoodluck commented 4 months ago

Implement the bot according to research provided

### Tasks
- [x] Bot event loop
- [ ] https://github.com/NEAR-DevHub/devbot/issues/40
- [x] Bot start command
- [x] Bot score command
- [x] Bot score calculation logic
- [x] Bot pause/unpause functionality
- [x] Bot replies to the commands
- [x] Bot saves data on-chain
- [x] Bot should able to whitelist particular org or repos
- [x] Bot merge functionality
- [x] Deny inactive PRs after X time
- [x] Allow re-start bot after PR was denied
- [x] Write a comment if PR is merged, but not scored
- [x] Deny merged PRs that wasn't scored after 1 day
- [x] Wait for transaction finalization with success.
- [ ] Bot responds with the correct text
- [ ] Wait at least 10 minutes until write comment after PR is merged
### PRD required changes
- [x] Automatically, fallback to include command if the first message has some issues
- [x] Bot reject command
- [x] Aliases to include command, case insensitive command, other parsing
- [x] Error messages to the user
- [x] keep various info in the top comment of the user bot (score, merge status, etc)
- [x] finalization message when we accepted PR
- [x] streaks
- [ ] tests on storage contract
- [ ] [NICE TO HAVE] user blocklist and think how to mitigate DOS attack vector through github
- [ ] [NICE TO HAVE] reduce amount of gets when organization is not in the allowlist.
- [ ] [NICE TO HAVE] rate limiter. put on hold notification processing if we have used limits
ftdgoodluck commented 4 months ago

added #37 to describe bot role model

akorchyn commented 4 months ago

Bot can pause/unpause a particular repo, but we don't have a command for full organization. For MVP, it should be done manually as we work with allowed list.

akorchyn commented 4 months ago

Hey @frol, would love to get your opinion on the contract storage. https://github.com/NEAR-DevHub/devbot/tree/main/contract

It doesn't require immediate action, but if you would have free time.

akorchyn commented 4 months ago

Currently, I exclude the PR from the sloth race after two weeks of inactivity. The users can restart it with include.

We need to do that to prevent exhausting the rate limits on checking if PR is merged

akorchyn commented 4 months ago

The bot will allow users 1 day to score after PR is merged. (maintainers still can score before emerging)