Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent build_job_generator regeneration from blowing up if no targetConfigurations #1162

Merged
merged 1 commit into from
Dec 11, 2024

Conversation

andrew-m-leonard
Copy link
Contributor

@andrew-m-leonard andrew-m-leonard commented Dec 11, 2024

If there are no targetConfigurations for a given pipeline configuration and job type,
for example jdk21u_evaluation.groovy.
The the job throws exception due to trying to process an empty array...

Also:   org.jenkinsci.plugins.workflow.actions.ErrorAction$ErrorId: 5a685aff-ddc8-4482-ab2d-399fe8d9d0cc
java.lang.SecurityException: Unable to find constructor: new Regeneration java.lang.String java.util.LinkedHashMap java.util.ArrayList groovy.json.internal.LazyMap groovy.json.internal.LazyMap java.util.LinkedHashMap java.lang.Integer org.jenkinsci.plugins.workflow.support.steps.build.RunWrapper WorkflowScript java.lang.String groovy.json.internal.LazyMap java.lang.String java.lang.String java.lang.String java.lang.String java.lang.String java.lang.String java.lang.String java.lang.String
	at PluginClassLoader for script-security//org.kohsuke.groovy.sandbox.impl.GroovyCallSiteSelector.findConstructor(GroovyCallSiteSelector.java:47)
	at PluginClassLoader for script-security//org.kohsuke.groovy.sandbox.impl.Checker.checkedConstructor(Checker.java:223)
	at PluginClassLoader for workflow-cps//com.cloudbees.groovy.cps.sandbox.SandboxInvoker.constructorCall(SandboxInvoker.java:21)
	at PluginClassLoader for workflow-cps//org.jenkinsci.plugins.workflow.cps.LoggingInvoker.constructorCall(LoggingInvoker.java:122)
	at Script3.run(Script3.groovy:790)
	at WorkflowScript.run(WorkflowScript:221)
	at ___cps.transform___(Native Method)
	at PluginClassLoader for workflow-cps//com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:100)

No jobs should be generated if there is no targetConfigurations!

Tested on this evaluation job generation: https://ci.adoptium.net/job/build-scripts/job/utils/job/evaluation-pipeline_jobs_generator_jdk/619/console

@andrew-m-leonard andrew-m-leonard self-assigned this Dec 11, 2024
Copy link

Thank you for creating a pull request!

Please check out the information below if you have not made a pull request here before (or if you need a reminder how things work).

Code Quality and Contributing Guidelines

If you have not done so already, please familiarise yourself with our Contributing Guidelines and Code Of Conduct, even if you have contributed before.

Tests

Github actions will run a set of jobs against your PR that will lint and unit test your changes. Keep an eye out for the results from these on the latest commit you submitted. For more information, please see our testing documentation.

In order to run the advanced pipeline tests (executing a set of mock pipelines), it requires an admin to post run tests on this PR.
If you are not an admin, please ask for one's attention in #infrastructure on Slack or ping one here.
To run full set of tests, use "run tests"; a subset of tests on specific jdk version, use "run tests quick 11,21"

@github-actions github-actions bot added generation Issues that provide enhancements or fixes to the job generators jenkins-pipeline labels Dec 11, 2024
Copy link
Contributor

@adamfarley adamfarley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@steelhead31 steelhead31 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@andrew-m-leonard andrew-m-leonard merged commit f5db088 into adoptium:master Dec 11, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
generation Issues that provide enhancements or fixes to the job generators jenkins-pipeline
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants