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

Add per-subscription setting to collapse all posts #172

Open
tivvit opened this issue May 22, 2020 · 16 comments
Open

Add per-subscription setting to collapse all posts #172

tivvit opened this issue May 22, 2020 · 16 comments
Labels
Difficulty/2:Medium Medium ticket Hacktoberfest Help Wanted Community help wanted Tech/Go Type/Enhancement New feature or improvement of existing feature Up For Grabs Ready for help from the community. Removed when someone volunteers
Milestone

Comments

@tivvit
Copy link

tivvit commented May 22, 2020

Hi, is it possible to format notifications? When I create new gitlab issue everything (title, link, content) is posted to the subscribed channel. Is it possible to customize those messages - I would like to omit content.

@tivvit
Copy link
Author

tivvit commented May 22, 2020

I can see that it is not (

message = fmt.Sprintf("#### %s\n##### [%s#%v](%s)\n###### new issue by [%s](%s) on [%s](%s)\n\n%s", issue.Title, repo.PathWithNamespace, issue.IID, issue.URL, senderGitlabUsername, w.gitlabRetreiver.GetUserURL(senderGitlabUsername), issue.CreatedAt, issue.URL, issue.Description)
), do you have any plans to support this feature?

@levb levb added Difficulty/2:Medium Medium ticket Help Wanted Community help wanted Tech/Go Triage Up For Grabs Ready for help from the community. Removed when someone volunteers Type/Enhancement New feature or improvement of existing feature labels May 26, 2020
@hanzei
Copy link
Collaborator

hanzei commented May 26, 2020

@tivvit What kind of customization do you have in mind? What is your use case?

@hanzei hanzei removed the Triage label May 26, 2020
@tivvit
Copy link
Author

tivvit commented May 26, 2020

It would be great to be able to specify custom formatting string for each subscription.

For our team for example it would be sufficient to have something like this fmt.Sprintf("new issue %s %s %s\n", issue.Title, repo.PathWithNamespace, issue.URL) and we would probably track only issue creation and close (not tagging).

The use case is: we have company GitLab instance and Mattermost instance and we are using this plugin. We have a Mattermost team channel which is subscribed to several repositories for issues. We are quite happy about the notifications about new issues or issue changes, it simplifies team communication and it helps with our response time for issues created by other teams. But the information is very thorough - imagine an issue with long description (several paragraphs) and somebody adds a label to that issue which results in posting the whole issue text to the channel (again).

I am willing to help with the implementation but I would need some guidance with how to store per subscription settings and how to incorporate this (IMHO quite big) change into the codebase.

@tivvit
Copy link
Author

tivvit commented May 26, 2020

I have redacted an example:

Screenshot from 2020-05-26 23-46-14

This happened a few minutes after the issue creation (which leads to reposting). It adds only very little information and in this example it is almost the whole screen.

And to be honest the text issue labeled ... is huge.

@tivvit
Copy link
Author

tivvit commented May 26, 2020

We would very much like to use this also for merge requests, but the issue would be the same.

@hanzei
Copy link
Collaborator

hanzei commented May 27, 2020

@tivvit Would a plugin setting to disable issue/PR bodies solve your use case?

@tivvit
Copy link
Author

tivvit commented May 28, 2020

It will definitely help. It is worth trying. Are you planning it per subscription?

@hanzei
Copy link
Collaborator

hanzei commented May 28, 2020

I was thinking about a global setting for all subscriptions

@tivvit
Copy link
Author

tivvit commented May 28, 2020

We are a part of quite big deployment and I suppose there will be use-cases for both (with and without body)

@hanzei
Copy link
Collaborator

hanzei commented May 28, 2020

I see. The github plugin has the concept of flags which are passed on a subscription creation. E.g. a --short could be used. https://github.com/mattermost/mattermost-plugin-github/blob/d4bf39aef12c932bdf9c9bd3292ee67ecf9f6769/server/command.go#L30-L32

@tivvit
Copy link
Author

tivvit commented May 28, 2020

flags for subscriptions sounds great

@tivvit
Copy link
Author

tivvit commented Aug 25, 2020

hi guys, any progress on this?

@hanzei
Copy link
Collaborator

hanzei commented Aug 28, 2020

@tivvit Given you interested in this feature I'm wondering if you are interested in implementing it?

@tivvit
Copy link
Author

tivvit commented Aug 28, 2020

@hanzei I am interested but I will not have time for this soon.

Can you please point to places in the code where it should be Implemented and describe briefly what has to be done for this feature because I am not familiar with this project.

After that, it will be simpler to do this effectively so someone may solve it i.e. for hacktoberfest. I am going to find time for this ASAP.

@hanzei
Copy link
Collaborator

hanzei commented Sep 11, 2020

@tivvit All events are handled in the webhook package in https://github.com/mattermost/mattermost-plugin-gitlab/tree/master/server/webhook. For the flag you should look into the Implementation in the GitHub plugin: mattermost/mattermost-plugin-github@23f77f0

@mickmister mickmister changed the title Possibillity to custom format notifications Add per-subscription setting to collapse all posts Jan 26, 2022
@mickmister
Copy link
Contributor

I propose we implement this as a --collapsed flag, as the issue in the GitHub plugin repo describes:

mattermost/mattermost-plugin-github#484

@mickmister mickmister added this to the Planned Work milestone Jan 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Difficulty/2:Medium Medium ticket Hacktoberfest Help Wanted Community help wanted Tech/Go Type/Enhancement New feature or improvement of existing feature Up For Grabs Ready for help from the community. Removed when someone volunteers
Projects
None yet
Development

No branches or pull requests

6 participants