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

Gitlab Hook names changed #608

Closed
Balint134 opened this issue Aug 22, 2017 · 22 comments
Closed

Gitlab Hook names changed #608

Balint134 opened this issue Aug 22, 2017 · 22 comments

Comments

@Balint134
Copy link

Issue

Previously working Gitlab configuration stopped working at all, hooks are sent by gitlab but they're not triggering the actual job. After investigation I've found out that gitlab changed Hook headers (without documenting it) thus breaking the plugin's ability to trigger jobs using hooks.

Context

  • Gitlab plugin version: 1.4.7
  • Gitlab version: 9.5.0.RC8
  • Jenkins version: 2.60.2
  • Job type: Pipeline
@trunov-ms
Copy link

"API V3 will be unsupported from GitLab 9.5, to be released on August 22, 2017. It will be removed in GitLab 9.5 or later."
https://docs.gitlab.com/ce/api/v3_to_v4.html

@Balint134
Copy link
Author

My main problem is that they're not mentioning this header change anywhere - at least I'm not able to find it.

Feel free to discard the issue and PR if it makes no sense.

@kuops
Copy link

kuops commented Aug 28, 2017

in gitlab-ce:9.5.1-ce.0
/project/xxx
404

@eljenso
Copy link

eljenso commented Aug 28, 2017

@SwankyPantie Could you please link the changes you found? Would be helpful if some other plugin devs stumble upon this problem.

FYI, according to their press release for the GitLab 9.5, API v3 will deprecate with GitLab 10.0.

@omehegan
Copy link
Member

The API version is unrelated to the data that webhooks send, as far as I can guess. We only use the GitLab API to send data TO GitLab about build results and so forth. If there has been a breaking change to the hook data that GitLab sends... that's annoying.

@dblessing can you comment on this?

@Balint134
Copy link
Author

@eljenso I'd be glad to do so, but as I wrote earlier there seems to be no documentations related to these changes. All I can see is that the "Test webhook" fails because of the Header changes.

@omehegan
Copy link
Member

@SwankyPantie I assume you upgraded GitLab and then this broke. What version did you upgrade from? We can probably find the commit where this was changed, and maybe some more information on it.

@Balint134
Copy link
Author

@omehegan I'm using the hosted gitlab.com version. According to source code this is the snippet doing the magic: link but this file hasn't been changed for a while.
Seems like hooks are coming from DB link

@bartos
Copy link

bartos commented Aug 30, 2017

The same situation on my side. I've upgdaded from 9.4.5 to 9.5.2. After this I was not able to trigger build on push event. I realized that X-Gitlab-Event header chanded from "Push Hook" to "Push Event".
When you go to web-hook edit on Gitlab, there is a call history with request details.

@smashou
Copy link

smashou commented Aug 30, 2017

Same situation here, after the update, not having a single build on push event.

@mariachini
Copy link

Same problem here.
Jenkins 2.76, Gitlab 9.5.1.
I can test e.g. Push Hook from GitLab (by simple git push && git commit, and job on jenkins is triggered) but I'm not able to test Push Event directly from GitLab settings page.

@nonleggouncazzo
Copy link

Same issue for me too.
When use the "Test->Push Event" button from gitlab on jenkins side I get:

**

com.dabsquared.gitlabjenkins.webhook.ActionResolver onPost
FINE: Unsupported X-Gitlab-Event header: Push Event

**

I'm using "GitLab Community Edition 9.5.2" and gitlab-plugin version 1.4.7

@dblessing
Copy link

As far as I know, hooks have always used 'Event' in the name - 'Push Event', etc. I've never seen 'Push Hook'. That doesn't explain why the integration broke, though. 🤔

@dblessing
Copy link

I found the problem. It only affects testing of web hooks, not actual pushes, etc. See https://gitlab.com/gitlab-org/gitlab-ce/issues/37288

@omehegan
Copy link
Member

@dblessing thanks so much for figuring this out! I'll have to think whether we should release this fix, or just put a note about the bug and wait for it to be fixed on the GitLab side. I'm leaning towards the latter, since this only impacts the 'Test' functionality, and I would prefer not to have dead code in the plugin just to fix that case in a couple of versions of GitLab.

@rymai
Copy link

rymai commented Sep 7, 2017

FYI this will probably be fixed in the next 9.5 release (9.5.5): https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/14108

@omehegan
Copy link
Member

omehegan commented Sep 7, 2017

@rymai thanks very much! Once this is released I'll add a note to our documentation about it.

@RaymondArias
Copy link

Any updates on this issue. Gitlab 10 is out and I am still having this issue

@rymai
Copy link

rymai commented Sep 28, 2017

@RaymondArias That's strange, this has been solved in 9.5.5 and 10.0.0.

@omehegan @SwankyPantie Do you still experience this issue?

@omehegan
Copy link
Member

I added a note about this to the Known Issues section of the doc.

@RaymondArias
Copy link

I am sorry. It is resolved. I did not update my Jenkins Project

@omehegan
Copy link
Member

This was fixed on the GitLab side, and we have a note in our README about it.

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

No branches or pull requests