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

Approved Merge Requests (EE-only) is not persisted #711

Closed
DieBauer opened this issue Feb 7, 2018 · 16 comments
Closed

Approved Merge Requests (EE-only) is not persisted #711

DieBauer opened this issue Feb 7, 2018 · 16 comments

Comments

@DieBauer
Copy link

DieBauer commented Feb 7, 2018

Context

  • Gitlab plugin version: 1.5.3
  • Gitlab version: 10.3.5
  • Jenkins version: 2.89.3
  • Job type: Freestyle

Problem description

The plugin doesn't respect a flag for
<f:entry title="Approved Merge Requests (EE-only)" field="triggerOnApprovedMergeRequest">

When toggling this setting and applying the change on refresh of the job, the toggle is activated again.

It should persist the toggle.

There are no log statements in the Jenkins log.

@shark-horse
Copy link

shark-horse commented Feb 7, 2018

I too cannot disable "Approved Merge Requests (EE-only)".

What does that setting do? Link to documentation saying what it does would be welcome.

I was trying to disable it because of a hunch that it means to trigger a build upon an approval. Basically I was trying to troubleshoot #633 .

Context
Gitlab plugin version: 1.5.3
Gitlab version: 10.4.0-ee
Jenkins version: 2.89.3
Job type: Maven

@prawen
Copy link

prawen commented Feb 12, 2018

Hello,

I'm facing the same issue. Will there be any fix for this?

@eddie3716
Copy link

I too am experiencing the same problem. I found the discussion #633 and followed it until I found this new open issue.

Gitlab plugin version: 1.5.3
Gitlab version: 10.2.2-ee
Jenkins version: 2.89.3

@eddie3716
Copy link

@jakub-bochenski @Argelbargel the change made from #664 is the cause of this bug.

@jakub-bochenski
Copy link
Contributor

Sorry, I cannot reproduce that. Here is a screenshot of me changing this value.

screenshot_20180214_175933

A bug that I can reproduce is connected to the Web form used to configure the job.
Because the trigger object lacks a getter for the value it will always display true regardless of the actual setting.
I recommend checking the config xml to be sure.

jakub-bochenski added a commit to jakub-bochenski/gitlab-plugin that referenced this issue Feb 14, 2018
@shark-horse
Copy link

@jakub-bochenski Are you saying you can change the value somehow, but not through the Web UI? If so, how?

Are you using a plugin to keep track of project configuration history? How do you get to that view in the screenshot you shared?

I'm just editing through the UI currently:
image

We're using a plugin to backup our configuration via a git repo. I may be able to submit a change via that, but I think additional steps are required for the change to take effect. Really, I don't know how to control the configuration via direct file manipulation--IME there's more to it than meets the eye, maybe because of the aforementioned plugin.

@shark-horse
Copy link

shark-horse commented Feb 15, 2018

Looking through history, I do see a change to the config.xml:

       <triggerOnAcceptedMergeRequest>false</triggerOnAcceptedMergeRequest>
       <triggerOnClosedMergeRequest>false</triggerOnClosedMergeRequest>
-      <triggerOnApprovedMergeRequest>true</triggerOnApprovedMergeRequest>
+      <triggerOnApprovedMergeRequest>false</triggerOnApprovedMergeRequest>
       <triggerOpenMergeRequestOnPush>source</triggerOpenMergeRequestOnPush>
       <triggerOnNoteRequest>true</triggerOnNoteRequest>

but Jenkins is still building upon Approval, which is incorrect for our workflow.

@jakub-bochenski
Copy link
Contributor

but Jenkins is still building upon Approval, which is incorrect for our workflow.

I haven't checked that, but it would be a separate issue from the incorrect display in Web UI.

We use job-dsl plugin to manage the job configuration, that's why I haven't noticed the UI issue before.

The change above was done via Web UI though, the screenshot comes from the JobConfigHistory plugin.

@williamzhao87
Copy link

I am also seeing this issue. Has anyone found any workaround?

@jakub-bochenski
Copy link
Contributor

@williamzhao87 there is a PR fixing it linked above :(

@lambourn
Copy link

lambourn commented Mar 1, 2018

Any update on this issue? I also experience this - as soon as a MR gets approved, the pipeline gets kicked of again. In our workflow we run only want to run builds when pushes are done to the MR but not on approval.

@shark-horse
Copy link

FWIW, as a workaround, I configured the Gitlab plugin (in the Jenkins job) to not build on the creation of an MR, which means we have to wait until approval for a build. (We have configured Gitlab to only allow merging with at least 1 approval + a successful build, i.e. a failed or pending build will block merging.)

@dskrvk
Copy link

dskrvk commented Mar 19, 2018

@shark-horse I'm curious how you configured Gitlab to block on Jenkins builds - is it through Gitlab CI? Did you also have to configure CI runners?

@shark-horse
Copy link

shark-horse commented Mar 19, 2018

@dskrvk What I was talking about in my previous comment was a config change in a Jenkins job, not a change in Gitlab. Specifically, I configured the Gitlab plugin in Jenkins to not build on creation of an MR:
image

Notice that Opened Merge Request Events is unchecked (because Approved Merge Requests (EE-only) is always checked.)

In Gitlab, I am using a Webhook that triggers on Merge Request Events (gitlabUrl/settings/integrations). I know it is sending information to Jenkins every time the MR is opened because, prior to disabling builds on opened MR's, Jenkins would build on opened MR's. Jenkins is simply ignoring that per the configuration in the Jenkins job.

FWIW:

  • I opted for Webhooks instead of the Jenkins CI service because we need certain flexibility not provided by the service.
  • Beyond the scope of this issue, I configured the job in Jenkins to build if someone says "Jenkins retry" in a comment, and I configured Gitlab to notify Jenkins upon a "Note event" which seems to correspond to comments in MR's.

@omehegan
Copy link
Member

This was fixed/released in version 1.5.4 of the plugin, which should be available in the update center soon.

@MaffooBristol
Copy link

Thanks! Can confirm that this has been fixed once I upgraded to 1.5.5 👍

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

10 participants