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

[JENKINS-72886] fix command & args are lost when combining container templates #1525

Merged
merged 2 commits into from
Mar 19, 2024

Conversation

moleus
Copy link
Contributor

@moleus moleus commented Mar 19, 2024

The issue is described in detail here - https://issues.jenkins.io/browse/JENKINS-72886

This PR adds checks for empty Lists because args and command fields are initialized as empty lists by default, and they can't be null. Before this change args and command from parent template were overridden with empty values, because null check always returned false.

After this change args and command fields will be preserved from parent template if child don't provide any. This is the expected behavior.

Testing done

I've added simple unit test which failed before this change and now passes successfully. It check that fields from parent container template are present if child template doesn't contain these fields

Submitter checklist

Edit tasklist title
Beta Give feedback Tasklist Submitter checklist, more options

Delete tasklist

Delete tasklist block?
Are you sure? All relationships in this tasklist will be removed.
  1. Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
    Options
  2. Ensure that the pull request title represents the desired changelog entry
    Options
  3. Please describe what you did
    Options
  4. Link to relevant issues in GitHub or Jira
    Options
  5. Link to relevant pull requests, esp. upstream and downstream changes
    Options
  6. Ensure you have provided tests - that demonstrates feature works or fixes the issue
    Options
Loading

@moleus moleus requested a review from a team as a code owner March 19, 2024 06:07
@Vlatombe Vlatombe added the bug Bug Fixes label Mar 19, 2024
Copy link
Member

@Vlatombe Vlatombe left a comment

Choose a reason for hiding this comment

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

Thank you!

@Vlatombe Vlatombe changed the title [JENKINS-72886] fix command & args are lost when combining contai… [JENKINS-72886] fix command & args are lost when combining container templates Mar 19, 2024
@Vlatombe Vlatombe merged commit 1dd44f5 into jenkinsci:master Mar 19, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug Fixes
Projects
None yet
2 participants