Argelbargel / gitlab-branch-source-plugin

Jenkins-Plugin to create a multi-branch-project from gitlab
GNU General Public License v2.0
71 stars 44 forks source link

Blue Ocean Support #60

Closed grfullerton closed 5 years ago

grfullerton commented 6 years ago

So I've been making some progress in getting the Pull Request tab of Blue Ocean to work properly for this plugin (see #29). I've been able to get it mostly working, however I did have to make some changes that affect the classic UI as well.

29 seems to be caused due to spaces in title field. So, I adopted the pattern used by Github: naming MRs as "MR-#". So the classic UI does lose the more descriptive name. The other changes shouldn't impact existing behavior to my knowledge.

grfullerton commented 6 years ago

@Argelbargel I'd like your input on the change regarding the name of MRs in the classic Jenkins UI. Although its in line with how github-branch-source behaves, it is change that could be seen as a regression to current users of this plugin that aren't using blue ocean.

witokondoria commented 6 years ago

naming MRs with just the number, whilst keeping the title as description will presumably solve MRs renames kicking unnecesary builds, isn't it?

Argelbargel commented 6 years ago

@grfullerton: sorry for the long wait. i'll try to see whether it is possible to display the description in some other way.

acarmel commented 6 years ago

Any updates?

StefanKoenen commented 6 years ago

please?

guillaumelecerf commented 5 years ago

I tested this patch and it's working fine for unmerged branches, but the URL is still bad for merged branches, i.e. the URL still contains (merged) which breaks Blue Ocean.

StefanKoenen commented 5 years ago

@guillaumelecerf Please try my fork, I'm using it for 2 months now. https://github.com/StefanKoenen/gitlab-branch-source-plugin

guillaumelecerf commented 5 years ago

@StefanKoenen : what plugin settings are you using for your jenkins projects?

StefanKoenen commented 5 years ago

@guillaumelecerf image image

And in Gitlab add a webrequest hook for push and merge events to: "my-jenkins-instance.com/job/{jenkins-project-name}/job/{gitlab-namespace/project}/build"

But did you download / build my fork? Because I fixed all issues I found in this project, and I don't think any other branch / version is working at the moment :)

guillaumelecerf commented 5 years ago

And what about "gitlab connection" -> "advanced" ? Because I can see that you're using the "classical" build strategies, but what about the gitlab specific build strategies?

StefanKoenen commented 5 years ago

@guillaumelecerf This is in the advanced section: image

I Don't understand what you mean with "classical" vs "gitlab specific" build strategies?

guillaumelecerf commented 5 years ago

Please look at https://github.com/Argelbargel/gitlab-branch-source-plugin/pull/103 and https://github.com/Argelbargel/gitlab-branch-source-plugin/pull/104

guillaumelecerf commented 5 years ago

@StefanKoenen : there are currently 2 build strategies settings: the one coming with the gitlab plugin, in the advanced section, and the one a bit lower in the config page (aka "classical" in my mind). Hope it's clearer

grfullerton commented 5 years ago

@guillaumelecerf I just pushed a commit that should fix the merged MRs in blueocean, but I haven't tested it.

Does #104 fix the issue where "Build merged with base branch" always is checked, even after unchecking and saving? Because that's literally the only bug I've encountered that I haven't been able to fix for my usage of this plugin.

I probably need to remove 2974c7a from this PR since it doesn't actually fix that problem. I think 0e92548 probably is in the same boat, I'm running a different fork on my own jenkins without that change and haven't had any issues with duplicate branches

grfullerton commented 5 years ago

I removed the commits that were unrelated/unnecessary for getting blueocean working. @guillaumelecerf let me know if my fix for merged branches works. If it does, I'll remove the [WIP] unless there are other remaining issues specific to blueocean.

guillaumelecerf commented 5 years ago

@grfullerton :

Does #104 fix the issue where "Build merged with base branch" always is checked, even after unchecking and saving? Because that's literally the only bug I've encountered that I haven't been able to fix for my usage of this plugin.

Yes, that's exactly that :)

guillaumelecerf commented 5 years ago

@grfullerton :

I removed the commits that were unrelated/unnecessary for getting blueocean working. @guillaumelecerf let me know if my fix for merged branches works. If it does, I'll remove the [WIP] unless there are other remaining issues specific to blueocean.

I did the same fix in my personal fork, and it's working fine, so go for removing the WIP status.

grfullerton commented 5 years ago

I addressed all the changes/discussions @guillaumelecerf had. I've also tested and verified my fix for merged branches in blue ocean. I removed the WIP tag, as I think this is now good to go.

guillaumelecerf commented 5 years ago

LGTM

guillaumelecerf commented 5 years ago

Please @Argelbargel review

dastanko commented 5 years ago

Any plans to release this fix?

Argelbargel commented 5 years ago

@dastanko: i've built 0.7.8-dev yesterday containing @grfullerton's fixes