gitlab-plugin icon indicating copy to clipboard operation
gitlab-plugin copied to clipboard

use BRANCH_NAME from environment as fallback for commit status ref

Open martinnemec3 opened this issue 3 years ago • 3 comments

Using ff only merging strategy in gitlab results in having same commit on a feature branch and on the main branch (there it appears after the merging is done). This PR tries to fix the situation when jenkins multibranch pipeline job is used to build both the feature branch and main branch. The problem is that status update request does not contain the "ref" parameter needed to set the status for branch correctly.

Fixes https://github.com/jenkinsci/gitlab-plugin/issues/1010

martinnemec3 avatar May 17 '22 23:05 martinnemec3

Does this PR try to fix the situation, or do you know for sure that it fixes the situation?

It actually fixes the situation.

That is, are you running this PR in production and have you verified this PR fixes the problem?

The problem is not hard to reproduce so I just tested the fix in my local (docker) test environment (set up by following https://github.com/jenkinsci/gitlab-plugin/blob/master/src/docker/README.md). I do not run the code anywhere in production.

martinnemec3 avatar Jun 20 '22 23:06 martinnemec3

Any chance you could download the incremental build from https://repo.jenkins-ci.org/incrementals/org/jenkins-ci/plugins/gitlab-plugin/1.5.33-rc1406.50cf09d3a_6fd/ and do a functional test on a production server? For instructions on how to install a custom plugin build, see: https://www.jenkins.io/doc/book/managing/plugins/#advanced-installation

basil avatar Jun 21 '22 02:06 basil

Sorry to leave you halfway through review, but I recently removed myself as the maintainer of this plugin in https://github.com/jenkins-infra/repository-permissions-updater/pull/2605, so I will not be able to merge this PR. You can consider adopting the plugin to merge and release the PR. The "Contributing to Open Source" workshop from DevOps World 2021 is a useful starting point for new maintainers. That document includes links to a five part video series that illustrates many of the steps. If the plugin is crucial to your work, you may want to ask your employer to support your work efforts by allowing you to adopt the plugin.

basil avatar Jun 21 '22 19:06 basil

@martinnemec3 Thanks for the PR! The solution looks intuitive enough for me.

krisstern avatar Jan 31 '23 13:01 krisstern

An ideal situation is if someone can test this out on a production server...

krisstern avatar Jan 31 '23 13:01 krisstern

Thanks @martinnemec3!

krisstern avatar May 11 '23 08:05 krisstern