jenkinsci / jenkinsci/workflow-basic-steps-plugin

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

Open
#500 0 comments 0 reactions 0 assignees View on GitHub
component:workflow-basic-steps-plugin imported-jira-issue priority:minor resolution:unresolved
Dominant language
Java
Stars
73
Forks
129
PR merge metrics
No merged PRs in 30d

Description

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.

---
Originally reported by solvingj, imported from: Add Signature to withEnv to take Map


  • status: Open
  • priority: Minor
  • component(s): workflow-basic-steps-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 1
  • imported: 20251215-220547

Raw content of original issue

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.


Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.