-
Notifications
You must be signed in to change notification settings - Fork 15
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
Comments
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 |
Or even with rewite-groovy that fail to parse a correct LST ? |
Yes, that's also what I think, but I prefer to have it logged here before forgetting about it. |
What is strange is that the newline is in the OpenRewrite recipe. |
This is an issue with the groovy parser. Rewrite-jenkins do a wrong assertion We will need to fix it before doing other Jenkinsfile modification. For the moment we just need to add the file if missing |
Possible fix by openrewrite/rewrite-jenkins#85 I'v tested the use case on rewrite groovy. Was not able to reproduce the issue At the end was only because the YAML block was trimming empty line when creating the text file |
That's why https://github.com/jenkins-infra/plugin-modernizer-tool/pull/524/files didn't show the issue I would suggest we use exclusively this even if This is tracked by #531 Closing the issue then |
When running the
AddOrModernizeJenkinsFile
recipe, the generated comment does not create a new line. As a result, the subsequentbuildPlugin
statement is appended to the comment, rather than starting on a new line.You can see this issue in this pull request.
Reproduction Steps
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.The text was updated successfully, but these errors were encountered: