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

Jenkinsfile Modification: Unexpected End-of-Comment Behavior #371

Open
gounthar opened this issue Nov 6, 2024 · 4 comments
Open

Jenkinsfile Modification: Unexpected End-of-Comment Behavior #371

gounthar opened this issue Nov 6, 2024 · 4 comments

Comments

@gounthar
Copy link
Collaborator

gounthar commented Nov 6, 2024

When running the AddOrModernizeJenkinsFile recipe, the generated comment does not create a new line. As a result, the subsequent buildPlugin statement is appended to the comment, rather than starting on a new line.

You can see this issue in this pull request.

Reproduction Steps

  1. Run the AddOrModernizeJenkinsFile recipe on a plugin with an outdated Jenkinsfile.

Expected Behavior

The recipe should add a new line and carriage return after the comment.

Actual Behavior

The comment does not create a new line, and the buildPlugin statement is appended to it.

@gounthar gounthar changed the title Jenkinsfile modification brings a strange end-of-comment Jenkinsfile Modification: Unexpected End-of-Comment Behavior Nov 6, 2024
@jonesbusy
Copy link
Collaborator

Is it and issue with plugin modernizer or rewrite-jenkins ? From wat I remember we don't modify and Jenkinsfile here but just use a recipe from rewrite-jenkins

@jonesbusy
Copy link
Collaborator

Or even with rewite-groovy that fail to parse a correct LST ?

@gounthar
Copy link
Collaborator Author

gounthar commented Nov 6, 2024

Yes, that's also what I think, but I prefer to have it logged here before forgetting about it.

@gounthar
Copy link
Collaborator Author

gounthar commented Nov 6, 2024

What is strange is that the newline is in the OpenRewrite recipe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants