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

Filter by branch name #599

Open
doc-sheet opened this issue Nov 2, 2022 · 5 comments
Open

Filter by branch name #599

doc-sheet opened this issue Nov 2, 2022 · 5 comments
Assignees
Labels
Difficulty/2:Medium Medium ticket Help Wanted Community help wanted Tech/Go

Comments

@doc-sheet
Copy link
Contributor

doc-sheet commented Nov 2, 2022

Hello.

Is it possible to get notifications on specific branch only?

I tried to subscribe to pushes in master/devel branches and ignore other (usually WIP) pushes.

@hanzei hanzei added Help Wanted Community help wanted Up For Grabs Ready for help from the community. Removed when someone volunteers Tech/Go Difficulty/2:Medium Medium ticket labels Nov 2, 2022
@thoratvinod
Copy link
Contributor

Hello @hanzei, I am interested in this issue, may I take this up?

@hanzei
Copy link
Contributor

hanzei commented May 16, 2023

Sure, thanks for taking a look @thoratvinod 👍

@hanzei hanzei removed the Up For Grabs Ready for help from the community. Removed when someone volunteers label May 16, 2023
@thoratvinod
Copy link
Contributor

Hi @hanzei ,

I have a question regarding the code. I've read through the codebase, and I noticed that when we run the command /github subscriptions add <repo>, it executes the handleSubscribesAdd method. However, I couldn't find the part in the code where we actually subscribe to the events. In the handleSubscribesAdd method, it seems like we are only adding subscriptions to the database as key-value pairs. Could you please let me know which file contains the code for subscribing to those events?

@hanzei
Copy link
Contributor

hanzei commented Jun 5, 2023

Hi @hanzei,

Thanks for reaching out. Plugin.handleSubscribesAdd calls Plugin.Subscribe. That methods saves to subscriptions to the KV sore. The Plugin.handleWebhook method, which is called when a webhook event from GH comes in, the fetches the list of subscriptions from the store in e.g.

func (p *Plugin) postIssueCommentEvent(event *github.IssueCommentEvent) {
repo := event.GetRepo()
subs := p.GetSubscribedChannelsForRepository(repo)
.

Please let me know if that helps.

@Kshitij-Katiyar
Copy link
Contributor

Hi @thoratvinod, Do let us know if you have any other queries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Difficulty/2:Medium Medium ticket Help Wanted Community help wanted Tech/Go
Projects
None yet
Development

No branches or pull requests

4 participants