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

Recipe for Jenkinsfile updates #531

Open
jonesbusy opened this issue Dec 29, 2024 · 4 comments
Open

Recipe for Jenkinsfile updates #531

jonesbusy opened this issue Dec 29, 2024 · 4 comments
Labels
enhancement For changelog: Minor enhancement. use `major-rfe` for changes to be highlighted

Comments

@jonesbusy
Copy link
Collaborator

What feature do you want to see added?

Right now the recipes doesn't override the Jenkinsfile in order to not alternate exotic configuration.

We need more logic here when we modernize a plugin. For example

  • Add a java version with platform
  • remove totally a java version
  • add first level args, like useContainerAgent

Etc.

See already groovy visitor that extract such information

Upstream changes

None

Are you interested in contributing this feature?

None

@jonesbusy jonesbusy added the enhancement For changelog: Minor enhancement. use `major-rfe` for changes to be highlighted label Jan 4, 2025
@jonesbusy
Copy link
Collaborator Author

jenkins-infra/pipeline-library#897

As information related to implicit settings

@basil
Copy link

basil commented Jan 8, 2025

add first level args, like useContainerAgent

But only if the plugin is not running Docker-based tests. A few previous modernization PRs incorrectly added useContainerAgent and accidentally disabled Docker-based tests.

@jonesbusy
Copy link
Collaborator Author

@basil Thanks, do you have any example of such recent PR ?

The current state is to not overwrite anything if a Jenkinsfile is present until we have logic :

I think we should be able to detect such types (pom, import) to know detect if we are using docker tests or not

The idea behind openrewrite is not not do any destructive changes (For example a Jenkinsfile adding configuration like https://github.com/jenkinsci/warnings-ng-plugin/blob/main/Jenkinsfile#L9-L11 should not lost it's information

@basil
Copy link

basil commented Jan 9, 2025

@basil Thanks, do you have any example of such recent PR ?

An example is jenkinsci/saml-plugin#157, which (incorrectly) set useContainerAgent: true, thereby disabling Docker-based testing. I set useContainerAgent: false in jenkinsci/saml-plugin#446 and confirmed that LiveTest was again running in CI builds. Fortunately, the test had not regressed during that time!

To be clear, it is always* OK to add an explicit useContainerAgent: false (*except if enforcing Spotless on Windows, pending jenkins-infra/helpdesk#3865), but it is only OK to add an explicit useContainerAgent: true if there are no Docker-based tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement For changelog: Minor enhancement. use `major-rfe` for changes to be highlighted
Projects
None yet
Development

No branches or pull requests

2 participants