Skip to content

[JENKINS-73991] withEnv does not alert when env var name is not valid #531

@jenkins-infra-bot

Description

@jenkins-infra-bot

I mistakenly tried to setting an env var which is not valid in a linux environment, e.g. :

withEnv([
    parallel-build='-j 12'
])

It is clearly not possible to create a linux env var with a variable name containing a dash.

The result is that the env var is not set, If some other env var are set in withEnv, they are not set and the pipeline can goes on without any warning.

There should have at least a warning written in the console log, and I think that as environment variables can be considered as critical data for a pipeline, the pipeline should be stopped.


Originally reported by jielpe_fr38, imported from: withEnv does not alert when env var name is not valid
  • status: Open
  • priority: Minor
  • component(s): workflow-basic-steps-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 2
  • imported: 20251215-220547
Raw content of original issue

I mistakenly tried to setting an env var which is not valid in a linux environment, e.g. :

withEnv([
    parallel-build='-j 12'
])

It is clearly not possible to create a linux env var with a variable name containing a dash.

The result is that the env var is not set, If some other env var are set in withEnv, they are not set and the pipeline can goes on without any warning.

There should have at least a warning written in the console log, and I think that as environment variables can be considered as critical data for a pipeline, the pipeline should be stopped.

environment
Jenkins : 2.462.2 LTS (alpine based docker image)<br/>
workflow-basic-steps-plugin : 1058.vcb_fc1e3a_21a_9

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions