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

Slack Support #379

Merged
merged 1 commit into from Aug 31, 2014
Merged

Slack Support #379

merged 1 commit into from Aug 31, 2014

Conversation

compressed
Copy link
Contributor

Hi,
I've added Slack webhook support. I needed to make a few changes to better support different hook types. In addition, I fixed one existing bug that caused all webhooks to be updated when updating a single webhook (first commit).

Please let me know if you see any changes needed.

Closes #292

Once this is merged, I have another PR to submit to allow comparing two different commit sha1s (one of the TODOs in here)

@unknwon
Copy link
Member

unknwon commented Aug 27, 2014

Thanks your PR! It's quite a lot changes, look good so far. But I would recommend to modify .less file rather than gogs.css.

@compressed
Copy link
Contributor Author

Great thanks! Ah yes... I was thinking those css files were generated, but for some reason I never stumbled onto the less files in my searching ... doh!

I've rebased now and made those changes.

@unknwon
Copy link
Member

unknwon commented Aug 27, 2014

This PR involves a lot changes, I have to take a little time to go through.

@compressed
Copy link
Contributor Author

Sure! Yeah even I didn't think as many changes would be needed when I started, but hopefully adding additional hooks should be more flexible now.

Glad to make any additional changes. Still very new to go myself.

@unknwon
Copy link
Member

unknwon commented Aug 27, 2014

I believe your code is working, but just for reviewing some design pattern.

ContentType: w.ContentType,
IsSsl: w.IsSsl,
})
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This case can be deleted because Gogs is the default.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah good point. On it.

@unknwon
Copy link
Member

unknwon commented Aug 31, 2014

Other than that looks good, please resolve the conflicts then re-PR. I'll merge it as one of 0.5 release feature!

@compressed
Copy link
Contributor Author

Okay all set! Thanks for reviewing.

Also as a heads-up - I have one more PR which compares two commits that I will submit in once this is merged.

unknwon added a commit that referenced this pull request Aug 31, 2014
@unknwon unknwon merged commit 1ed6779 into gogs:dev Aug 31, 2014
@unknwon
Copy link
Member

unknwon commented Aug 31, 2014

Thanks!

@unknwon
Copy link
Member

unknwon commented Aug 31, 2014

I'm getting this error in template: template: repo/settings/slack_hook:1:91: executing "repo/settings/slack_hook" at <eq .HookType "slack">: error calling eq: invalid type for comparison

@unknwon
Copy link
Member

unknwon commented Aug 31, 2014

I don't know why, but suddenly worked.

@unknwon
Copy link
Member

unknwon commented Aug 31, 2014

Looks prefect!

@unknwon
Copy link
Member

unknwon commented Aug 31, 2014

I've pushed a mirror fix for file name from xx_hook.tmpl to hook_xx.tmpl.

@drwlrsn
Copy link

drwlrsn commented Dec 18, 2015

I have noticed that the Slack webhook fails with the following message:

Delivery: Post %20https://hooks.slack.com/services/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%20: unsupported protocol scheme ""

I did a curl with the payload and it's all good. I think it might be related to the %20 at the start.

Edit: This is totally on me. I, of course, had a space at the start. I am leaving this up just in case anyone is as silly as me.

@unknwon
Copy link
Member

unknwon commented Dec 18, 2015

@drwlrsn I think it is because you have a space in the input field?

@dansteingart
Copy link

does the current slack support push issues to slack? it only seems to deal with commits. TIA

@unknwon
Copy link
Member

unknwon commented Jul 10, 2016

@dansteingart , no it does not..

@dansteingart
Copy link

dansteingart commented Jul 10, 2016

@unknwon OK thanks. I'll try to hack the planet and see if I can get it to happen

@Radiergummi
Copy link

Sorry for digging this up again, but would it be possible to make the messages pushed to Slack localizable - or even better, customizable? Currently, they are hard coded in english. It would be nice to have translations here or the possibility to set the strings using variables in the Gogs admin area.
I'll open a separate issue if that's more suited.

@unknwon
Copy link
Member

unknwon commented Nov 14, 2017

@Radiergummi good idea... please file another issue for this suggestion!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🎯 feature Categorizes as related to a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants