openrewrite / rewrite-jenkins

OpenRewrite recipes to continuously modernize Jenkins plugins.
Apache License 2.0
9 stars 8 forks source link

feat(jelly): Add jelly xml declaration #75

Closed gounthar closed 2 weeks ago

gounthar commented 3 weeks ago

What's changed?

Implement the AddJellyXmlDeclaration recipe to add the XML declaration to Jelly files.

What's your motivation?

While working on the AnchorChain plugin, I discovered that several Jelly files were missing the required XML declaration: <?jelly escape-by-default='true'?>

According to the Jenkins documentation, when migrating the <description> tag from pom.xml to a Jelly file, this declaration is mandatory.

While there is an existing OpenRewrite recipe that handles the file creation, it doesn't address cases where the file exists but lacks the required declaration.

Anything in particular you'd like reviewers to focus on?

Anyone you would like to review specifically?

Have you considered any alternatives or workarounds?

Any additional context

The discussion started on the Slack Channel.

Checklist

gounthar commented 2 weeks ago

Thank you so much! 🤗