Comments (5)
I suspect that Gitlab sends a bit different payload when merge request is in question, as opposed to payload for a regular commit. Can you provide the exact payload?
from jenkins-gitlab-hook-plugin.
According to the api that's correct. This is what GitLab sends (also in line with what I receive as payload).
Merge request events
Triggered when a new merge request is created or an existing merge request was updated/merged/closed.
Request body:
{
"object_kind": "merge_request",
"object_attributes": {
"id": 99,
"target_branch": "master",
"source_branch": "ms-viewport",
"source_project_id": 14,
"author_id": 51,
"assignee_id": 6,
"title": "MS-Viewport",
"created_at": "2013-12-03T17:23:34Z",
"updated_at": "2013-12-03T17:23:34Z",
"st_commits": null,
"st_diffs": null,
"milestone_id": null,
"state": "opened",
"merge_status": "unchecked",
"target_project_id": 14,
"iid": 1,
"description": ""
}
}
from jenkins-gitlab-hook-plugin.
OK, so that explains it.
See https://github.com/elvanja/jenkins-gitlab-hook-plugin#hook-data-related, I added an example of Gitlab payload for a commit. You can see that that payload contains data I can use to determine which project is to be built.
One question though. Before merge request, a commit to feature branch was surely made. And that has undergone a Jenkins build, if all is set correctly. Why would you need to build again for merge request?
from jenkins-gitlab-hook-plugin.
Yes, thanks. So basically the plugin supports only push events now, as there's no trivial way to get the url. That would require reading e.g. a project configuration parameter, as the repo url is configured there (git plugin).
About your question: This job needs quite some time to build so I don't want to trigger it with every commit to a feature branch. Much rather after a MR is opened. The other relevant plugin (Gitlab Merge Request Builder) does that I think, but uses polling.
Anyway, thanks for the reply. If you have a good suggestion, I'm more than happy to hear it :-)
cheers
from jenkins-gitlab-hook-plugin.
Well, I guess that since it's done in mentioned plugin, it is doable. Please try the other plugin, no sense in duplicating behavior if it works :-) Other than that, no suggestions, sorry!
from jenkins-gitlab-hook-plugin.
Related Issues (20)
- build_now works on separate servers?
- "no project references the given repo url and commit branch" muti-branch freestyle HOT 2
- naming autogenerated project does not postfix with branchname on first creation HOT 2
- build_now hook not working on Jenkins 1.620 and Gitlab 7.8.2 HOT 3
- How could I skip building based on commit message? (Enhancement Request?) HOT 1
- Does not install on Jenkins 1.635 HOT 2
- Don't trigger a build on commit notifications in multiple scms is wrong HOT 1
- Support for git sparsepath HOT 1
- Support for multiple projects HOT 2
- Pipeline projects
- Jenkins does not run build on the "Tag Push Events" trigger from Web Hook HOT 1
- plugin does not work with (multibranch) pipeline projects?
- jenkins2 : GitLab CI Service URL in old format when using the plugin
- how to reference nested payload value
- 应该如何正确填写回调URL,我按照文档书写的地址一致验证不过 HOT 4
- Installed but not show in jenkins
- How to read json payload from gitlab webhook in Jenkins
- unsupported Java version: 11
- unsupported Java version: 11 HOT 9
- Configure Clouds in jenkins With docker give error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jenkins-gitlab-hook-plugin.