Git Product home page Git Product logo

Comments (12)

elvanja avatar elvanja commented on June 21, 2024

Hi, glad you use it :-)

Funny thing, I did test multilevel / composite branch names, especially since I use gitflow. But, I did notice you are probably using version 0.1.1. And this is entirely my fault. I committed the code to mine and Jenkins fork, but didn't release the plugin.

So, just did that. You should be seeing version 0.2.0 in your Jenkins plugin update center, and if not (it takes time to propagate), you can find it @ jenkins repo.

Before we go on, please use that updated version. In log, there should be some more info, e.g.

INFO: gitlab web hook triggered for repo url http://gitlab.example.com/myproject
INFO: with payload: ... here comes the payload from gitlab, you can delete sensitive data

Please send me this info.
It should be enough for me to be able to figure out the cause.

from jenkins-gitlab-hook-plugin.

Isammoc avatar Isammoc commented on June 21, 2024

Thanks for replying,

You're right, I'm using version 0.1.1.
No update is available for now, I'm waiting for propagation and will come back then.

from jenkins-gitlab-hook-plugin.

Isammoc avatar Isammoc commented on June 21, 2024

Ok, I'm on version 0.2.0 now.

I created a new branch story/test and push it to gitlab

Here the jenkins log :

INFO: gitlab web hook triggered for repo url http://gitlab.example.com/myproject and test branch
INFO: with payload: {"before"=>"0000000000000000000000000000000000000000", "after"=>"3e213054239ede90231239a41a4308bbf51df0a4", "ref"=>"refs/heads/story/test", "user_id"=>14, "user_name"=>"Me ****", "repository"=>{"name"=>"myproject", "url"=>"http://gitlab.example.com/myproject", "description"=>nil, "homepage"=>"http://gitlab.example.com/myproject"}, "commits"=>[{"id"=>"3e213054239ede90231239a41a4308bbf51df0a4", "message"=>"Dummy test 1", "timestamp"=>"2012-12-06T11:25:31+01:00", "url"=>"http://gitlab.dev.example.com/myproject/commits/3e213054239ede90231239a41a4308bbf51df0a4", "author"=>{"name"=>"Me ****", "email"=>"[email protected]"}}], "total_commits_count"=>1}
INFO: project build-webapp doesn't match the test branch
WARNING: no project references the given repo url and commit branch

(urls, names and mails manually changed)

I expected to see story/test instead of test in the first line. Maube this is the issue ?

from jenkins-gitlab-hook-plugin.

elvanja avatar elvanja commented on June 21, 2024

Yes, you are right, I've been using only the last in payload["ref"].split("/").
Wait for a fix...

from jenkins-gitlab-hook-plugin.

Isammoc avatar Isammoc commented on June 21, 2024

I can't test my fix (and I am not used to code in ruby), but I think something like this could be fix the issue :

  def get_commit_branch(payload)
    payload["ref"].split("/")[2..-1].join("/") if payload && payload["ref"]
  end

in models/gitlab_web_hook_api.rb (lines 115-117)

from jenkins-gitlab-hook-plugin.

elvanja avatar elvanja commented on June 21, 2024

Excellent, I wrote it a bit different, to ensure the intent is clear (removing head and ref from the entire path). I can't release from here but the update will be available later today. Let me know how it goes after you try it.

from jenkins-gitlab-hook-plugin.

Isammoc avatar Isammoc commented on June 21, 2024

Thanks,
I cannot wait to see this working ^^

from jenkins-gitlab-hook-plugin.

elvanja avatar elvanja commented on June 21, 2024

OK, so the new version 0.2.3 is up with another fix.
It should now accept branches like refactoring-what-not.
If you're impatient, you can find it here. Fingers crossed :-)

from jenkins-gitlab-hook-plugin.

Isammoc avatar Isammoc commented on June 21, 2024
INFO: gitlab web hook triggered for repo url http://gitlab.example.com/myproject and story/test branch
INFO: with payload: {"before"=>"3e213054239ede90231239a41a4308bbf51df0a4", "after"=>"04a609729d97f803f084695909a2751ec2172b9e", "ref"=>"refs/heads/story/test", "user_id"=>14, "user_name"=>"Me **********", "repository"=>{"name"=>"myproject", "url"=>"http://gitlab.example.com/myproject", "description"=>nil, "homepage"=>"http://gitlab.example.com/myproject"}, "commits"=>[{"id"=>"04a609729d97f803f084695909a2751ec2172b9e", "message"=>"Dummy test 5", "timestamp"=>"2012-12-07T15:59:28+01:00", "url"=>"http://gitlab.example.com/myproject/commits/04a609729d97f803f084695909a2751ec2172b9e", "author"=>{"name"=>"Me ********", "email"=>"[email protected]"}}], "total_commits_count"=>1}
INFO: project build-webapp matches the story/test branch
INFO: project build-webapp doesn't match the master branch
INFO: project build-webapp doesn't match the ** branch
WARNING: could not determine master project, please create a project for the repo (usually for the master branch)

My job is not triggered :'(

from jenkins-gitlab-hook-plugin.

elvanja avatar elvanja commented on June 21, 2024

Yep, residue from another feature I am building (automatic Jenkins project creating per Gitlab branch).
Switched it off, should work now. New version @ jenkins repo, and please test as usual :-)

from jenkins-gitlab-hook-plugin.

Isammoc avatar Isammoc commented on June 21, 2024

Tried this morning.
Job is well triggered ^^

Thanks a lot.

from jenkins-gitlab-hook-plugin.

elvanja avatar elvanja commented on June 21, 2024

Great :-)

from jenkins-gitlab-hook-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.