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

build-token-root-plugin support lost

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • Jenkins: 2.303.1
      OS: Linux - 5.11.0-1016-aws (Ubuntu, amd64)
      ---
      Parameterized-Remote-Trigger:3.1.5.1

      Plugin description contains information:

      This plugin also has support for build authorization tokens (as defined here ), and plays nicely with these other guys:
      Build Token Root Plugin

      The above plugin expects api call (for parametrized builds) to the url path

      /buildByToken/buildWithParameters

      while this plugin keeps calling

      /job/<job_name>/api/json

      despite any parameters defined as arguments to the "triggerRemoteJob" definition.

      For example, the following pipeline step

      triggerRemoteJob job: 'remote', remoteJenkinsName: 'jenkins3', token: 'secret-token', parameters: "service=${service}\nversion=${version}"
      

      results in the following job output:

        Parameterized Remote Trigger Configuration:
          - job:                     remote 
          - remoteJenkinsName:       jenkins3
          - parameters:              [service=remote-svc, version=remote-ver]
          - blockBuildUntilComplete: true
          - connectionRetryLimit:    5
          - trustAllCertificates:    true
      ################################################################################################################
      Connection to remote server failed [403], waiting to retry - 10 seconds until next attempt. URL: http://jenkins3.example:8080/job/remote/api/json, parameters
      Retry attempt #1 out of 5
      

      while if called with curl

      curl -w "http_code: %\{http_code}" "http://jenkins3.example:8080/buildByToken/buildWithParameters/build?job=remote&token=secret-token&service=remote-svc&version=remote-ver"
      http_code: 201
      

      results in remote job execution.

      This plugin also validates the full job URL when provided and rejects attempts to configure anything which does not contain "/job" which effectively blocks to workaround the automatically generated url path.

      Although, it appears from the source code that the "hasBuildTokenRootSupport" (https://github.com/jenkinsci/parameterized-remote-trigger-plugin/blob/9ebf92013c35b806ceb8d32cbbe76b084ba4094f/src/main/java/org/jenkinsci/plugins/ParameterizedRemoteTrigger/RemoteJenkinsServer.java#L102) remote Jenkins configuration option is completely ignored further in the code.

      If the "Build Token Root Plugin" is still supported, it is not explained how to use it in the documentation and I am unable to make this plugin working as announced in the description.

            cashlalala KaiHsiang Chang
            okopecky Ondrej
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: