Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-41044

Unable to approve a pipeline waiting on input when permissions are specified for approvers

    Details

    • Similar Issues:
    • Epic Link:
    • Sprint:
      iapetus

      Description

      Scope

      • Investigate what the problem is here - if you have the input up to restrict to particular users are we doing the right thing to allow this to work?
        • This needs an ATH test to ensure we keep doing the right thing.
      • Work out how to return the error to the UI (this may be a simple fix in the frontend to show the message on screen?)

      Note

      • Vivek Pandey we can pass this ticket on to a frontend developer to add the message to the screen if that is not already the behaviour

      Original request
      My pipeline build has a input step that I have restricted approval from select users and I am part of those users but as I hit approve button to that input step it fails with

      "message" : "You need to be xxx, yyy, zzz to submit this", "code" : 400, "errors" : [ ]
      

      event though I am xxx, does blueocean not store the credentials/username of the person logged in ?

      Edit 1 : I restrict the user that can approve the input step with the following code :

      approvedInput = input id: 'dynamicInputApproval', message: 'Waiting for EP to approve', ok: 'Approve', parameters: [
                          [$class: 'ChoiceParameterDefinition', choices: "${dynamicInput["OS"]}", description: 'Select the os your job targets', name: 'OS'],
                          [$class: 'BooleanParameterDefinition', defaultValue: dynamicInput["Docker"], description: 'Enable docker workflow', name: 'Docker']
                                 ], submitter: "xxx,yyy,zzz", submitterParameter: "something"
      

      and yes, it works in classic view where it allows me (xxx) to approve it but fails on blue ocean with the above mentioned error.

        Attachments

          Issue Links

            Activity

            Hide
            michaelneale Michael Neale added a comment -

            Kuber Kaul can you provide a sample of your pipeline input step where you have restricted this?

            Also, I assume you can approve it from the regular classic Jenkins screen?

            Show
            michaelneale Michael Neale added a comment - Kuber Kaul can you provide a sample of your pipeline input step where you have restricted this? Also, I assume you can approve it from the regular classic Jenkins screen?
            Hide
            michaelneale Michael Neale added a comment -

            Vivek Pandey I suspect this may be api related, somehow the users context isn't being used, but it is something we could and should probably have a test for (it may be something else... just keep eyes open).

            Show
            michaelneale Michael Neale added a comment - Vivek Pandey I suspect this may be api related, somehow the users context isn't being used, but it is something we could and should probably have a test for (it may be something else... just keep eyes open).
            Hide
            kaulk Kuber Kaul added a comment -

            Michael Neale - please see edit 1.

            Show
            kaulk Kuber Kaul added a comment - Michael Neale - please see edit 1.
            Hide
            michaelneale Michael Neale added a comment -

            Kuber Kaul thanks! should be easy enough to fix.

            Show
            michaelneale Michael Neale added a comment - Kuber Kaul thanks! should be easy enough to fix.
            Show
            vivek Vivek Pandey added a comment - Probably duplicate of https://issues.jenkins-ci.org/browse/JENKINS-41421 and PR https://github.com/jenkinsci/blueocean-plugin/pull/820 . Thorsten Scherler over to you

              People

              • Assignee:
                tscherler Thorsten Scherler
                Reporter:
                kaulk Kuber Kaul
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: