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

Bot: Notify people about new fellowship referendas #57

Closed
bkchr opened this issue Dec 1, 2023 · 19 comments · Fixed by #68
Closed

Bot: Notify people about new fellowship referendas #57

bkchr opened this issue Dec 1, 2023 · 19 comments · Fixed by #68

Comments

@bkchr
Copy link
Contributor

bkchr commented Dec 1, 2023

We should have some bot that is notifying people about new fellowship referendas. The idea was that this bot is maybe posting to the fellowship channel or to some dedicated notifications channel. In a future version it would be also nice to ping people directly when a RFC they commented is put on for voting.

CC @Bullrich @mordamax

@muharem
Copy link
Contributor

muharem commented Dec 1, 2023

we have similar telegram bots for public referendas - @subvt_kusama_bot and @subvt_polkadot_bot
not sure if telegram works for everyone. can be matrix

@bkchr
Copy link
Contributor Author

bkchr commented Dec 1, 2023

I'm personally against telegram :P But maybe if we have a bot that can work for telegram/matrix, I will not complain.

Where can this bot be found?

@muharem
Copy link
Contributor

muharem commented Dec 1, 2023

I would say matrix even have a higher priority since all our communication rooms set there now
Here the telagram's bot - https://github.com/helikon-labs/subvt-backend/tree/main/subvt-telegram-bot

@pandres95
Copy link

pandres95 commented Dec 1, 2023

Here's an initial draft of a matrix bot for referenda announcements, implemented on nodejs

https://github.com/pandres95/fellowship-referenda-bot


Update: Just pushed a couple of commits to update the look of it, making it also readable on mobile devices

Desktop view Mobile view

@Bullrich
Copy link
Contributor

Bullrich commented Dec 1, 2023

I believe that @rzadp has a bot that already interacts with voting and RFCs. I'll get in contact with him as maybe he can easily adapt it.

@ggwpez
Copy link
Member

ggwpez commented Dec 1, 2023

This is not restricted to RFC referendas, can we move this to https://github.com/polkadot-fellows/help-center ?

@bkchr
Copy link
Contributor Author

bkchr commented Dec 1, 2023

This is not restricted to RFC referendas, can we move this to https://github.com/polkadot-fellows/help-center ?

As we don't want to have a general referenda bot (which probably already exist), I think it is fine to keep the discussion here. We want to improve the communication around the RFC proposals.

@pandres95
Copy link

pandres95 commented Dec 1, 2023

From what I've done so far with the Matrix box, here's what I consider are the next steps:

  • Defining the output format (here's a suggestion for how it may look like).
  • Setting up the announcements channel.
  • Setting up an account for the bot.
    • Set up the account.
    • Create an announcements channel.
    • Invite to the announcements channel.
  • Fixing an issue that makes the bot send unencrypted messages.
  • Filtering for RFC-related referenda (@olanod suggested creating a specific RFC track / another suggestion might be adding a tag on Subsquare).
    • Hint: Lookup the referendum preimage. If the remark contains RFC in it, then that's a RFC-related referendum.
  • Deploying the bot on a scheduler.
    • Once, twice a week, maybe?
    • Deploy on this repo as a scheduled GitHub Action.
    • Maybe building a small tool Use this repo's settings to handle the scheduling and the input variables.

Nice to have / Next version:

  • Keep stored the earliest ongoing referendum index, to optimize the fetching of referendum info.
  • More types of announcements
  • Listening to on-chain events to notify on votes
  • Talking to Subsquare guys to have a proper API (that doesn't depend on their Next build hash).

cc/ @bkchr


Update: changed deployment on serverless platform for schedule action within this repository (thanks to @bkchr for the suggestion).

@bkchr
Copy link
Contributor Author

bkchr commented Dec 5, 2023

  • Maybe, deploy on a serverless platform where it doesn't cost too much

We could probably put it into an action in this repo?

@pandres95
Copy link

Updates:

  • Now the Matrix Box it handles E2EE.
  • Now it's filtered by RFC remark
    Screenshot 2023-12-06 at 04 05 02
  • Now it keeps the earliest ongoing referendum index to reduce fetching time.

I think is safe to say we can discuss deployment. Wdyt @bkchr?

@rzadp
Copy link
Contributor

rzadp commented Dec 6, 2023

we don't want to have a general referenda bot (which probably already exist)

Indeed - There are even email/telegram notifications about fellowship referenda right in Subsquare (no matrix support though):

So I understand that in this issue we want to focus on RFC referenda specifically.


@pandres95 I see you're on top of the matrix bot, but I don't see integration with github in your plan.
(Talking about this: ping people directly when a RFC they commented is put on for voting)
(I'm assuming we're talking about comments in PRs and pinging github handles)

We already have a github action in this repo that understands RFC PRs and is able to match them with corresponding ongoing referenda. I can work on extending this action with the functionality of posting updates in the PRs and pinging people - this could work in parallel to the matrix bot.

@pandres95
Copy link

pandres95 commented Dec 6, 2023

(Talking about this: ping people directly when a RFC they commented is put on for voting)
(I'm assuming we're talking about comments in PRs and pinging github handles)

The GitHub part is not that hard. We can always connect through GitHub Actions, triggered by PR comments and make the association between commenters and the actual referendum, and since both the github profiles and matrix users are tied to each member's identities (or at least, they should be, i.e. I haven't setup my GitHub profile into my identity yet), there's a chance of doing so.

The only question is: should those pings be via DMs, or via a threaded reply under the notifications room.

But yeah, this can be in parallel. The first part of scheduling notifications to everyone can always be a first release, an MVP of how that'd work in the future.

@bkchr
Copy link
Contributor Author

bkchr commented Dec 6, 2023

I think is safe to say we can discuss deployment. Wdyt @bkchr?

What you need to know?

@mordamax
Copy link

mordamax commented Dec 7, 2023

The idea was that this bot is maybe posting to the fellowship channel or to some dedicated notifications channel
In a future version it would be also nice to ping people directly when a RFC they commented is put on for voting.

ping people in DM? did you mean mention their GH handle or in matrix 1:1 ? If someone has an RFC PR open the conversations are already happening there, right? So if someone has commented on PR - they get notification (either push or email) and react, so they subscribe already via github.

What's missing for sure - is referenda status changes in scope of Open RFC PR - whether it's Submitted or Confirmed [rejected/approved], which could also potentially be tracked per PR via GitHub notifications. Then on status change - we could add comment IN the PR.
Why PR - because it already has a channel of communication (push/email) to author and to whoever commented (subscribed).
Why not DM - because it's not guaranteed that everyone who will ever submit RFC will have DM credentials set in identity/bio, so the comment in PR is more reliable source.

Re. sending to matrix channel - it could also be addition to comment in RFC PR, but what would be a goal?
As I understand (i could be wrong for sure) - If the referendum started - people need to act and vote, so would be good to post RFC-related proposals? or perhaps all kinds of referendums? I guess any fellowship referenda ideally deserve attention of voters once it's there, so limiting only to RFC type doesn't sound correct to me, but could be that currently that's the expectation though

  1. So for "commenters" - to notify PR subscribers that this RFC has put on Vote, and it's time to act - we could try to add some monitoring for the PRs additionally to rfc-action ([EngAut] RFCs Referenda status tracker / notifications paritytech/eng-automation#2 -> @rzadp)
  2. For Matrix - it could easily be the solution which @pandres95 build, and they could work in parallel. And either exclusively only RFCs or all of them to any desired channel

@pandres95
Copy link

pandres95 commented Dec 11, 2023

I think is safe to say we can discuss deployment. Wdyt @bkchr?

What you need to know?

Basically, whether it would be possible to set the bot using username/password, or an access token is preferred. Meanwhile, I'm working on building the GitHub Action to deploy the bot.

Aside from that, would be good to know who's the person on the matrix homeserver's end, so they would be able to do the following:

  • Setting up the announcements channel.
  • Setting up an account for the bot.
    • Set up the account.
    • Create an announcements channel.
    • Invite to the announcements channel.

@bkchr
Copy link
Contributor Author

bkchr commented Dec 12, 2023

Aside from that, would be good to know who's the person on the matrix homeserver's end, so they would be able to do the following:

Matrix is a decentralized messaging solution. This means that anyone can create a channel (including you). This requires no special permissions.

@pandres95
Copy link

pandres95 commented Dec 12, 2023

Oh, I know that 😅

I was just wondering if there's anyone who can make it "official". But I guess that option of releasing the bot and channel by my own, and then using an invite link for everyone to join is possible, too.

I'll do that, then. Releasing tomorrow afternoon for the first announcement next Friday. 🚀

@pandres95
Copy link

pandres95 commented Dec 19, 2023

Update: The bot is up!

  • Find the notifications channel here.
  • Also, the README has been updated.

cc/ @bkchr @Bullrich @mordamax @muharem

Bullrich added a commit to paritytech/rfc-action that referenced this issue Jan 19, 2024
Added functionality for a cron job to iterate over all ongoing
referendas and compare them to the open PRs. If there is any match on
the remark, and the referenda has been opened **after** the last time
the action was run, it will comment a link to the referenda in
Polkassembly.

This is intended to resolve the requirements in polkadot-fellows/RFCs#57
Bullrich added a commit to paritytech-stg/RFCs that referenced this issue Jan 19, 2024
Added RFC Cron job which will iterate over existing referendas and post a link to them in the open Pull Requests.

This resolves polkadot-fellows#57

Every time it iterates, it looks for referendas that have been submitted _after_ the time of the last run, to stop itself from posting duplicated comments.

It is set to run every day at 12, and it can also be triggered manually.
rphmeier pushed a commit that referenced this issue Jan 24, 2024
Added RFC Cron job which will iterate over existing referendas and post
a link to them in the open Pull Requests.

This resolves #57

Every time it iterates, it looks for referendas that have been submitted
_after_ the time of the last run, to stop itself from posting duplicated
comments.

It is set to run every day at 12, and it can also be triggered manually.
@mordamax
Copy link

Additionally to #68 @Bullrich have added an auto-message on after confirmation RFC proposal with a command which is easy to copy & paste

Going forward, if it works as intended, we could let it auto-merge / close the PR accordingly to a result of a proposal, if that makes sense. For now it's still manual action to process

image

Thanks @Bullrich!

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

Successfully merging a pull request may close this issue.

7 participants