Details
-
Type:
New Feature
-
Status: Open (View Workflow)
-
Priority:
Major
-
Resolution: Unresolved
-
Component/s: pipeline-model-definition-plugin
-
Labels:
-
Similar Issues:
Description
By default a branch project will automatically run the first build, with no parameters, so params will just pick up any default values. You have the option to suppress the automatic first build, but this does not give you any way to enter parameters for it (at least in the UI; perhaps possible via CLI/REST), since Jenkins does not know what the parameters are going to be until it starts running. But in the case of Declarative we could in principle inspect the Jenkinsfile when the branch project is created (via SCMFileSystem) and determine the parameter definitions by static parsing without actually running.
More generally, if Declarative is in use and there are properties, we could set all the project properties when the branch project is created, even if the first build is run automatically. (Though I would suggest that the automatic first build should be automatically suppressed if there is a ParametersDefinitionProperty.)
Attachments
Issue Links
- is duplicated by
-
JENKINS-40574 Pipeline build parameters are null in first build
-
- Resolved
-
-
JENKINS-46594 Pipelines with parameters always fail to pick up parameters on first run
-
- Closed
-
-
JENKINS-40241 Detemine parameters before running job
-
- Closed
-
-
JENKINS-45454 Pipeline from SCM jobs should have a fetch option
-
- Resolved
-
- is related to
-
JENKINS-52939 Need to lint pipeline from UI, and also parse parameters
-
- Open
-
- relates to
-
JENKINS-41865 buildWithParameters does not work when project has not been built before parameters configured
-
- Open
-
-
JENKINS-49079 Copy job properties for new branch project from base/default branch
-
- Open
-
- links to
We have other workaround for those builds do not have default values on all parameters, and they need values, we mark the build as not build at when level and we skip everything, to do that we check that the environment variable and the parameter has the same value, we also check that the mandatory parameters has value.