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

Hosting request for export-job-parameters #4259

Open
BarelElbaz opened this issue Jan 11, 2025 · 18 comments
Open

Hosting request for export-job-parameters #4259

BarelElbaz opened this issue Jan 11, 2025 · 18 comments
Labels
bot-check-complete Automated hosting checks passed hosting-request Request to host a component in jenkinsci security-audit-done The hosting request code passed the security audit with success

Comments

@BarelElbaz
Copy link

BarelElbaz commented Jan 11, 2025

Repository URL

https://github.com/BarelElbaz/export-job-parameters

New Repository Name

export-job-parameters-plugin

Description

This Jenkins plugin exports job parameters to declarative pipeline syntax. It helps users migrate their jobs to Pipeline by automatically generating the parameters {} or properties() block with all configured parameters, supporting both standard Jenkins parameters and custom parameter types.

I couldn't find anything similar and it was painful to migrate 50 parameters to a Jenkinsfile (Including active choices with scripts, etc...)

My plugin is intelligent, it falls back to figuring out the syntax of any parameter types by looking at its @Symbol getters etc...

GitHub users to have commit permission

@BarelElbaz

Jenkins project users to have release permission

barelelbaz

Issue tracker

GitHub issues

@BarelElbaz BarelElbaz added the hosting-request Request to host a component in jenkinsci label Jan 11, 2025
@jenkins-cert-app
Copy link
Collaborator

Security audit, information and commands

The security team is auditing all the hosting requests, to ensure a better security by default.

This message informs you that a Jenkins Security Scan was triggered on your repository.
It takes ~10 minutes to complete.

Commands

The bot will parse all comments, and it will check if any line start with a command.

Security team only:

  • /audit-ok => the audit is complete, the hosting can continue 🎉.
  • /audit-skip => the audit is not necessary, the hosting can continue 🎉.
  • /audit-findings => the audit reveals some issues that require corrections ✏️.

Anyone:

  • /request-security-scan => the findings from the Jenkins Security Scan were corrected, this command will re-scan your repository 🔍.
  • /audit-review => the findings from the audit were corrected, this command will ping the security team to review the findings 👀. It's only applicable when the previous audit required changes.

Only one command can be requested per comment.

(automatically generated message, version: 1.32.13)

@jenkins-cert-app jenkins-cert-app added the security-audit-todo The security team needs to audit the hosting request code label Jan 11, 2025
Copy link

Hello from your friendly Jenkins Hosting Checker

It appears you have some issues with your hosting request. Please see the list below and correct all issues marked Required. Your hosting request will not be approved until these issues are corrected. Issues marked with Warning or Info are just recommendations and will not stall the hosting process.

  • ⛔ Required: The following usernames in 'Jenkins project users to have release permission' need to log into Jira: @BarelElbaz (reports are re-synced hourly, wait to re-check for a bit after logging in)
  • ⛔ Required: The following usernames in 'Jenkins project users to have release permission' need to log into Artifactory: @BarelElbaz (reports are re-synced hourly, wait to re-check for a bit after logging in)
  • ⛔ Required: The <groupId> from the pom.xml should be io.jenkins.plugins instead of io.jenkins.plugins.barelelbaz

You can re-trigger a check by editing your hosting request or by commenting /hosting re-check

@jenkins-cert-app
Copy link
Collaborator

The Jenkins Security Scan did not find anything dangerous with your plugin, congratulations! 🎉


💡 The Security team recommends that you are setting up the scan in your repository by following our guide.

@jenkins-cert-app jenkins-cert-app added security-audit-done The hosting request code passed the security audit with success and removed security-audit-todo The security team needs to audit the hosting request code labels Jan 11, 2025
Copy link

Hello from your friendly Jenkins Hosting Checker

It appears you have some issues with your hosting request. Please see the list below and correct all issues marked Required. Your hosting request will not be approved until these issues are corrected. Issues marked with Warning or Info are just recommendations and will not stall the hosting process.

  • ⛔ Required: The following usernames in 'Jenkins project users to have release permission' need to log into Jira: barelelbaz (reports are re-synced hourly, wait to re-check for a bit after logging in)
  • ⛔ Required: The following usernames in 'Jenkins project users to have release permission' need to log into Artifactory: barelelbaz (reports are re-synced hourly, wait to re-check for a bit after logging in)
  • ⛔ Required: The <groupId> from the pom.xml should be io.jenkins.plugins instead of io.jenkins.plugins.barelelbaz

You can re-trigger a check by editing your hosting request or by commenting /hosting re-check

@BarelElbaz
Copy link
Author

/hosting re-check

Copy link

Hello from your friendly Jenkins Hosting Checker

It appears you have some issues with your hosting request. Please see the list below and correct all issues marked Required. Your hosting request will not be approved until these issues are corrected. Issues marked with Warning or Info are just recommendations and will not stall the hosting process.

  • ⛔ Required: The following usernames in 'Jenkins project users to have release permission' need to log into Jira: barelelbaz (reports are re-synced hourly, wait to re-check for a bit after logging in)
  • ⛔ Required: The following usernames in 'Jenkins project users to have release permission' need to log into Artifactory: barelelbaz (reports are re-synced hourly, wait to re-check for a bit after logging in)

You can re-trigger a check by editing your hosting request or by commenting /hosting re-check

@BarelElbaz
Copy link
Author

/hosting re-check

Copy link

Hello from your friendly Jenkins Hosting Checker

It appears you have some issues with your hosting request. Please see the list below and correct all issues marked Required. Your hosting request will not be approved until these issues are corrected. Issues marked with Warning or Info are just recommendations and will not stall the hosting process.

  • ⛔ Required: The following usernames in 'Jenkins project users to have release permission' need to log into Jira: barelelbaz (reports are re-synced hourly, wait to re-check for a bit after logging in)
  • ⛔ Required: The following usernames in 'Jenkins project users to have release permission' need to log into Artifactory: barelelbaz (reports are re-synced hourly, wait to re-check for a bit after logging in)

You can re-trigger a check by editing your hosting request or by commenting /hosting re-check

@BarelElbaz
Copy link
Author

/hosting re-check

Copy link

Hello from your friendly Jenkins Hosting Checker

It looks like you have everything in order for your hosting request. A member of the Jenkins hosting team will check over things that I am not able to check(code review, README content, etc) and process the request as quickly as possible. Thank you for your patience.

Hosting team members can host this request with /hosting host

@github-actions github-actions bot added bot-check-complete Automated hosting checks passed and removed needs-fix labels Jan 12, 2025
@mawinter69
Copy link
Contributor

@NotMyFault
Copy link
Member

Is there a reason not to modernize https://plugins.jenkins.io/export-params/ and integrate functionality missing?

@BarelElbaz
Copy link
Author

@mawinter69 Thanks for the review
I fixed the comments

@BarelElbaz
Copy link
Author

Is there a reason not to modernize https://plugins.jenkins.io/export-params/ and integrate functionality missing?

@NotMyFault The plugin you mention has a completely different intention - it's a build step that writes the parameters and their values into a file in the workspace during the build (Supports only freestyle jobs)

My plugin aims to help Jenkins users migrate their interactively UI-defined parameters into the pipeline's code (Jenkinsfile). I started to develop this plugin after years of experience with Jenkins, during my career as a DevOps engineer, I met multiple companies that had 10s of parameters defined in the "Configure" job page, and it was completely unmaintainable and was a nightmare to migrate them into the Jenkinsfile (Required custom scripts that manipulating the Job's config.xml file)

If you want, I don't care about integrating the functionality of the mentioned plugin into mine, but it's not directly connected to the main goal of the plugin.

@mawinter69
Copy link
Contributor

The plugin https://plugins.jenkins.io/declarative-pipeline-migration-assistant/ seems to be able to generate a Jenkinsfile out of a freestyle project. And it already supports all the parameter types that you've implemented.

@BarelElbaz
Copy link
Author

It's also not the same, I'm talking about jobs that are already declarative pipelines but the parameters part is declared in the UI ("Configure")
The plugin you mentioned is not similar.

P.S I implemented a smart logic for supporting all parameters types, the predefined parameters that you see are the fallback, there is a logic to automatically figure out any kind of parameter

@BarelElbaz
Copy link
Author

May I get a repo?

@k-caps
Copy link

k-caps commented Feb 2, 2025

I also struggle with getting already existing parameters which were defined by UI into code - it is also very painful to create a new parameter by code when you don't know it's code already, for example who remembers how to create an "active choices reactive reference multiple select groovy script" parameter?

I would much prefer to use the UI and then have a simple way to export it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot-check-complete Automated hosting checks passed hosting-request Request to host a component in jenkinsci security-audit-done The hosting request code passed the security audit with success
Projects
None yet
Development

No branches or pull requests

5 participants