community-plugins icon indicating copy to clipboard operation
community-plugins copied to clipboard

🐛 jenkins: documentation issues in scaffolder plugin

Open kokotchY opened this issue 6 months ago • 7 comments

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?

  • [x] 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

kokotchY avatar Aug 08 '25 09:08 kokotchY

Thank @kokotchY, looking for help to get this corrected 👍

awanlin avatar Aug 12 '25 14:08 awanlin

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Oct 11 '25 18:10 github-actions[bot]

@kokotchY Can i work on thiss ?

Ayushmore1214 avatar Oct 17 '25 15:10 Ayushmore1214

Yeah go ahead! My time is limited at the moment, so I couldn't start with this. Thank you :)

kokotchY avatar Oct 20 '25 07:10 kokotchY

Thanks @Ayushmore1214, I've assigned the issue to you. I think you might already have something for this?

awanlin avatar Oct 21 '25 14:10 awanlin

Thanks @awanlin ! Yes, PR #5849 is intended to fix this issue. I'm just fixing the DCO and adding the missing changeset now.

Ayushmore1214 avatar Oct 22 '25 05:10 Ayushmore1214

Lets get this issue closed as completed via #5849

Ayushmore1214 avatar Nov 23 '25 04:11 Ayushmore1214

Thank you!

vinzscam avatar Dec 02 '25 15:12 vinzscam