jenkinsci / jenkinsci/matrix-project-plugin
[JENKINS-6467] Add a new envrironment varibale to get only the job's name in a matrix project
- Dominant language
- Java
- Stars
- 17
- Forks
- 85
- Avg merge
- 4h 27m
- Merged PRs (30d)
- 5
Description
The env var JOB_NAME, and its description in env-vars.html are confusing.
In a simple project, the meaning and the description correspond, but in a matrix project, it is more complicated.
If the main job's name is Foo, using a matrix with 2 parameters bar and baz, then JOB_NAME returns "Foo/bar=x,baz=y". This was the request JENKINS-1047.
Is it possible to add another env var, like JOB_SHORT_NAME, or to be more coherent, use JOB_NAME to get the real name and JOB_IDENTIFIER for example to get the full description?
Thanks
---
Originally reported by rockeye, imported from: Add a new envrironment varibale to get only the job's name in a matrix project
Raw content of original issue
The env var JOB_NAME, and its description in env-vars.html are confusing.
In a simple project, the meaning and the description correspond, but in a matrix project, it is more complicated.
If the main job's name is Foo, using a matrix with 2 parameters bar and baz, then JOB_NAME returns "Foo/bar=x,baz=y". This was the request
JENKINS-1047.Is it possible to add another env var, like JOB_SHORT_NAME, or to be more coherent, use JOB_NAME to get the real name and JOB_IDENTIFIER for example to get the full description?
Thanks
Contributor guide
Research direction
Start with the matrix-project-plugin handling of JOB_NAME and the env-vars.html description, then inspect the existing tests for matrix job environment variables. The naming and semantics of the new variable still need agreement; done means the chosen variable reports the main job name consistently and its documentation and tests match.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- ci-cd
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100