Skip to content

[JENKINS-70557] Allow readYaml max aliases to be set via system property at startup #189

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

Merged
merged 4 commits into from
Feb 22, 2023

Conversation

rkivisto
Copy link
Contributor

@rkivisto rkivisto commented Feb 16, 2023

Fixes https://issues.jenkins.io/browse/JENKINS-70557

This code was previously modified to add system properties under:

https://issues.jenkins.io/browse/JENKINS-68830
#152

That previous fix works when you set them using Manage Jenkins -> Script console, but not via startup arguments (as described in JENKINS-70557)

This fix makes it possible to set these system properties at startup.

Tested with the testcase from JENKINS-70557, using:

export MAVEN_OPTS='-Dorg.jenkinsci.plugins.pipeline.utility.steps.conf.ReadYamlStep.DEFAULT_MAX_ALIASES_FOR_COLLECTIONS=51 -Dorg.jenkinsci.plugins.pipeline.utility.steps.conf.ReadYamlStep.MAX_MAX_ALIASES_FOR_COLLECTIONS=51'
mvnDebug hpi:run -Djenkins.version=2.375.2
  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

Copy link
Member

@rsandell rsandell left a comment

Choose a reason for hiding this comment

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

Looks OK to me.
It would be nice if it was possible to have a test for it, it is slightly embarrasing that this bug slipped through :)

You could use org.jvnet.hudson.test.FlagRule in a test to set a system property and clean it up after the test. There are some tests in org.jenkinsci.plugins.pipeline.utility.steps.conf.ReadYamlStepTest that could give you inspiration around testing max aliases for collections in general.

@rkivisto rkivisto marked this pull request as ready for review February 17, 2023 20:18
@rkivisto rkivisto requested a review from rsandell February 22, 2023 17:26
@rkivisto
Copy link
Contributor Author

Thanks @rsandell , it's ready for re-review now.

@rsandell rsandell merged commit 04805de into jenkinsci:master Feb 22, 2023
@rkivisto rkivisto deleted the JENKINS-70557 branch February 22, 2023 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants