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

fix error when using empty agent label #414

Merged
merged 1 commit into from
Oct 27, 2021
Merged

fix error when using empty agent label #414

merged 1 commit into from
Oct 27, 2021

Conversation

pkwarren
Copy link
Contributor

Update AgentDeclaration to only fail if label is null (and not found via
other conditionals) instead of when it is falsy.

Fixes #412

  • 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

Update AgentDeclaration to only fail if label is null (and not found via
other conditionals) instead of when it is falsy.

Fixes #412
@@ -647,4 +647,12 @@ class TestDeclarativePipeline extends DeclarativePipelineTest {
assertCallStack().contains('echo(Deploy to someLabel)')
assertJobStatusSuccess()
}

@Test void should_agent_with_empty_label() throws Exception {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This test failed prior to making the suggested code change.

Copy link
Contributor

@nre-ableton nre-ableton left a comment

Choose a reason for hiding this comment

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

Very nice, thanks for the fix!

@nre-ableton nre-ableton merged commit 78c8c3a into jenkinsci:master Oct 27, 2021
@pkwarren pkwarren deleted the issue-412 branch October 27, 2021 05:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AgentDeclaration fails in execute if an empty label is specified
2 participants