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

allowNoFile attribute for withFileParameter step does not have the expected behavior #166

Open
RobinFauvel opened this issue Jun 5, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@RobinFauvel
Copy link

RobinFauvel commented Jun 5, 2023

Jenkins and plugins versions report

Environment
Jenkins: 2.387.2
OS: Linux - 5.4.0-146-generic
Java: 11.0.11 - AdoptOpenJDK (OpenJDK 64-Bit Server VM)
file-parameters:285.v757c5b_67a_c25

What Operating System are you using (both controller, and any agents involved in the problem)?

Ubuntu 20.04 and Windows 10 VMs

Reproduction steps

Scripted pipeline definition:

properties([
    parameters([
        base64File(name: 'myFile')
    ])
])

node {
    deleteDir()
    stage('test') {
        withFileParameter(name: 'myFile', allowNoFile: false) {
            echo readFile(file: myFile)
        }
    }
}

Expected Results

When a build is started without providing a file to the 'myFile' Job parameter, I expect the build to fail since the allowNoFile attribute is set to false.

Actual Results

The build does not fail when no file is given as a Job parameter, even though the allowNoFile argument is set to false.
However, the build fails if no parameters are declared in the Job configuration. This isn't absurd, but it's not what you'd expect from the allowNoFile argument. After all, the argument isn't called allowNoParameter.

Anything else?

No response

@RobinFauvel RobinFauvel added the bug Something isn't working label Jun 5, 2023
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

No branches or pull requests

1 participant