-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Teamcity webhook #18668
Teamcity webhook #18668
Conversation
Add enum/strings referencing TeamCity
…t have a body for posts. Add teamcity to webhook types
Add handling for TeamCity Hook Task. TeamCity needs an 'Authorization: Bearer <token>' header to work. Added a new property to models\HookTask and a check for value. If the value is there, the header is added. Otherwise, it's omitted.
Hi, you have an outdate code base. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't taken a look at the code, but there are a few nitpicks that the CI will likely fail on.
Thanks for the PR :)
Add enum/strings referencing TeamCity
…t have a body for posts. Add teamcity to webhook types
Add handling for TeamCity Hook Task. TeamCity needs an 'Authorization: Bearer <token>' header to work. Added a new property to models\HookTask and a check for value. If the value is there, the header is added. Otherwise, it's omitted.
…webhook # Conflicts: # models/webhook.go # modules/auth/repo_form.go # modules/setting/webhook.go # modules/webhook/deliver.go # modules/webhook/webhook.go # options/locale/locale_cs-CZ.ini # options/locale/locale_de-DE.ini # options/locale/locale_en-US.ini # options/locale/locale_es-ES.ini # options/locale/locale_fa-IR.ini # options/locale/locale_fi-FI.ini # options/locale/locale_fr-FR.ini # options/locale/locale_hu-HU.ini # options/locale/locale_it-IT.ini # options/locale/locale_ja-JP.ini # options/locale/locale_ko-KR.ini # options/locale/locale_lv-LV.ini # options/locale/locale_nl-NL.ini # options/locale/locale_pl-PL.ini # options/locale/locale_pt-BR.ini # options/locale/locale_pt-PT.ini # options/locale/locale_ru-RU.ini # options/locale/locale_sr-SP.ini # options/locale/locale_sv-SE.ini # options/locale/locale_tr-TR.ini # options/locale/locale_uk-UA.ini # options/locale/locale_zh-CN.ini # options/locale/locale_zh-TW.ini # routers/repo/webhook.go # routers/routes/routes.go # templates/admin/hook_new.tmpl # templates/org/settings/hook_new.tmpl # templates/repo/settings/webhook/list.tmpl # templates/repo/settings/webhook/new.tmpl
This reverts commit 6c68fa57ece29258f0e5cdf0a0b962d0d2f34265.
Add Authorization Header when Bearer Token is present during Webhook delivery. Add empty TeamCity Payload builder to accommodate future expansion and stay consistent with existing patterns.
PR Rebased. Thought I was at latest but upstream wasn't pulling correctly, should be resolved. |
Delete obsolete files left behind in rebase. Fix linting issues.
This contains changes which should not be part of this PR. |
Found and reverted the offending files. I think they got picked up when I rebased. |
templates/admin/hook_new.tmpl
Outdated
{{else if eq .HookType "msteams"}} | ||
<img width="26" height="26" src="{{AssetUrlPrefix}}/img/msteams.png"> | ||
{{else if eq .HookType "teamcity"}} | ||
<img width="26" height="26" src="{{AssetUrlPrefix}}/img/teamcity.png"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate image?
templates/org/settings/hook_new.tmpl
Outdated
{{else if eq .HookType "msteams"}} | ||
<img width="26" height="26" src="{{AssetUrlPrefix}}/img/msteams.png"> | ||
{{else if eq .HookType "teamcity"}} | ||
<img width="26" height="26" src="{{AssetUrlPrefix}}/img/teamcity.png"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
duplicate?
{{template "repo/settings/webhook/msteams" .}} | ||
{{template "repo/settings/webhook/teamcity" .}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
duplicate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hate rebasing so much sometimes....resolved! Thanks for the catch!
This branch is a total mess. You've reverted lots of important things and caused loads of conflicts. Do you have a SHA from before you attempted to rebase? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are lots of serious reversions here due to mismerges. This cannot merge as is.
@firephreek don't be afraid to cherrypick/rebase and force push on your own branch to clean up the commit history. |
any news on this issue? |
This PR's merge history is still broken. And in future I think all webhooks could be covered by a general mechanism, instead of hard-code more and more webhooks. |
closing per above comment |
Implements a basic TeamCity Webhook.
TC Webhooks require:
TC Hook is just a REST API that takes a POST with no body and an "Authorization: Bearer " Header.
Translations properties added, templates created, logo included.
Go isn't my primary or even secondary language, so happy to hear changes that would be needed.
Adding the BearerToken property to the HookTask seemed the least problematic approach to getting the AuthToken included in the final POST, but if there's a more 'GO' approach or something specific to the project, I don't know it.