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

feat(bot): Reduce bot's reaction time down to less then 5 seconds #142

Open frol opened 2 months ago

frol commented 2 months ago

This issue is just a placeholder for a lengthy discussion.

This will require us to use a different approach than our current one. Instead of polling for updates, let's see if there is a way to use webhooks on being mentioned or to plug into Mobile push notifications.

akorchyn commented 2 months ago

I believe, webhook is not possible with our current implementation

https://docs.github.com/en/webhooks/types-of-webhooks

Webhooks are supported per repo/org/GitHub app. But we use general GitHub rest user API (not an app)

So It was the tradeoff that we have made initially. We didnt want to require maintainer to install the app and we wanted to rely on mention in any repo

elliotBraem commented 1 month ago

What if we modified this to crosspost pull-requests to social contract, and then a race of sloths bot replied there?

It would be a different approach, but this way pull requests can stay focused on the discussion without interruption from bot comments and I think it also lends itself to better UX flows and more opportunities-- it would be able to use existing BOS Notifications fellowship work, integration with nearbuilders.org/projects, crossposting to Devhub communities... and of course, more activity on near.

Repositories would need to introduce the race of sloths git workflows.

For example, here is a git workflow with script for posting a release: https://github.com/NEARBuilders/near-bos-webcomponent/pull/41

Looks like we can get PR number from:

the easiest way I found is using the github context. The following example shows how to set it to an environment variable.

env: PR_NUMBER: ${{ github.event.number }} (https://stackoverflow.com/questions/59077079/how-to-get-pull-request-number-within-github-actions-workflow)

frol commented 1 month ago

@elliotBraem the whole point of Race of Sloths design is to be frictionless for those who only use GutHub. Adding BOS notifications at this point will drop participation rate to zero