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

Add Signature to withEnv to take Map<String, String>

      We have this utility function in our Jenkins Shared Library:

      static List<String> convertMapToJenkinsEnv(Map<String,String> srcEnv) {
          return srcEnv.collect { "${it.key}=${it.value}"}
      }

      It seems obvious that this could be an alternative signature and implementation to the current basic built-in function:

      withEnv
      

      For us, it's far more ergonomic to work with and compose maps in our Shared Library and scripted pipelines, taking advantage of it's well-defined characteristics surrounding unique keys etc.

      It seems as trivial as it could be to implement this.

          [JENKINS-60063] Add Signature to withEnv to take Map<String, String>

          jerry wiltse created issue -
          jerry wiltse made changes -
          Description Original: We have this utility function in our Jenkins Shared Library:
          {code:java}
          static List<String> convertMapToJenkinsEnv(Map<String,String> srcEnv) {
              return srcEnv.collect { "${it.key}=${it.value}"}
          }{code}

          It seems obvious that this could be an alternative signature to the current basic built-in function:

          {code:java}
          withEnv
          {code}

          For us, it's far more ergonomic to work with and compose maps in our Shared Library and scripted pipelines, taking advantage of it's well-defined characteristics surrounding unique keys etc.

          It seems as trivial as it could be to implement this.

          New: We have this utility function in our Jenkins Shared Library:
          {code:java}
          static List<String> convertMapToJenkinsEnv(Map<String,String> srcEnv) {
              return srcEnv.collect { "${it.key}=${it.value}"}
          }{code}

          It seems obvious that this could be an alternative signature and implementation to the current basic built-in function:

          {code:java}
          withEnv
          {code}

          For us, it's far more ergonomic to work with and compose maps in our Shared Library and scripted pipelines, taking advantage of it's well-defined characteristics surrounding unique keys etc.

          It seems as trivial as it could be to implement this.

            Unassigned Unassigned
            solvingj jerry wiltse
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: