Skip to content

🐛 jenkins: documentation issues in scaffolder plugin #4871

@kokotchY

Description

@kokotchY

Workspace

jenkins

📜 Description

While trying to use the scaffolder plugin for jenkins, we found some issues with the documentation which were impacting our usage of this plugin.

👍 Expected behavior

The documentation is showing correct information so that the actions can be used as expected.

👎 Actual Behavior with Screenshots

The documentation has inconsistencies which can block people to use this plugin.

Build job:

Image

The jobParameters input value is incorrect.

Enable job:

Image

The description of the enableJob action in the schema mention Destroy an existing job

👟 Reproduction steps

Build job

  1. Open the README.md, to the How to use it section
  2. See the some-value, which is not an object, and which cannot be used like this

Enable job

  1. In backstage, open the Installed actions page when the plugin scaffolder-backend-module-jenkins is installed
  2. Search for the action jenkins:job:enable
  3. See that the description is Destroy an existing job jenkins given a name

📃 Provide the context for the Bug.

Build job

It isn't possible to start jenkins job with parameters as the documentation is showing.

After investigation, it seems to be linked with the way the underlying library is passing the parameter to jenkins, as it expected a parameters, which is not provided by the action.

This is the correct way to provide the parameters:

- id: jenkins-job-build
  name: Jenkins Job Build
  action: jenkins:job:build
  input:
    jobName: first-job
    jobParameters:
      parameters:
        PARAM1: value1

Looking at the implementation of the library, it is also possible to provide a delay and token parameter.

We would suggest updating the action to provide correctly the jobs parameters:

const options = {
  parameters: ctx.input.JobParameters,
};
jenkins.job.build(ctx.input.jobName, options);

Enable Job

Currently, the action is confusing as it feels weird to see Destroy in a enable action.

👀 Have you spent some time to check if this bug has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

Are you willing to submit PR?

No, but I'm happy to collaborate on a PR with someone else

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions