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

[BUG] isValid() does not always work as intended #205

Open
jo2y-tock opened this issue Jul 12, 2024 · 0 comments · May be fixed by #207
Open

[BUG] isValid() does not always work as intended #205

jo2y-tock opened this issue Jul 12, 2024 · 0 comments · May be fixed by #207
Labels
bug Something isn't working

Comments

@jo2y-tock
Copy link

Describe the bug

I originally filed this as https://issues.jenkins.io/browse/JENKINS-72790 when I thought it was a general problem with pipeline-build-step-plugin. Since then I now think it's specifically this plugin.

Newer versions of the build() plugin now call isValid() before triggering the downstream pipeline. This fails for pipelines that use RestListParam. I believe it's because getValues() isn't called when accessed in that way.

To Reproduce
Steps to reproduce the behavior:

  1. Install this plugin and a version of pipeline-build-step-plugin that includes Use new isValid() API for ParameterDefinition. pipeline-build-step-plugin#45 (539.v8c889169451f or later)
  2. Create two pipelines. One pipeline (downstream) with a working RestListParam and one (upstream) that calls build() to trigger the downstream pipeline with a known valid option to RestListParam.
  3. Run the upstream pipeline. It should fail when it tries to call build() because isValid will return false.

Expected behavior

The downstream pipeline to be triggered without error.

Versions (please complete the following information):

I initially encountered this problem 6 months ago, so I don't have the exact versions in use at the time. It worked with pipeline-build-step-plugin pre-539.v8c889169451f and fails with 539.v8c889169451f or later.

Additional context

I think the simple fix would be to add this to isValid(). I haven't had a chance to test it yet, so I don't know if the call will work in this context or if there will be side-effects.

    if (values.isEmpty()) {
      getValues();
    }
@jo2y-tock jo2y-tock added the bug Something isn't working label Jul 12, 2024
@mymarche mymarche linked a pull request Aug 16, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant