jenkins-infra / plugin-modernizer-tool

MIT License
10 stars 9 forks source link

Update the BOM Recipe to Accommodate the Latest Archetype #122

Open gounthar opened 4 months ago

gounthar commented 4 months ago

What feature do you want to see added?

Current Situation

We are currently using the existing OpenRewrite BOM recipe for our plugin modernization efforts.

Question

Does this recipe cover the case of the latest Jenkins archetype?

Potential Actions

If the current recipe covers the latest archetype:

If the current recipe does not cover the latest archetype:

  1. Create a meta-recipe that:

    • Adds the jenkins.baseline property
    • Uses this property to reference the BOM
  2. Modify the existing recipe by:

Precedent

The OpenRewrite team has been receptive to contributions in the past. They accepted our contribution when the archetype for the Jenkinsfile changed months ago.

Next Steps

  1. Verify if the current recipe covers the latest archetype.
  2. If not, decide between creating a meta-recipe or modifying the existing one.
  3. If modifying the existing recipe, prepare a PR for the OpenRewrite repository.

Your thoughts and feedback on this approach are welcome.

Upstream changes

No response

Are you interested in contributing this feature?

No response

gounthar commented 4 months ago

We should also modify it so we switch to 2.440.x instead of 2.426.x. Cf https://github.com/jenkinsci/gitlab-plugin/pull/1671.

🤔

Except if the recipe has already been updated. I must admit I can't see where the Jenkins versions are fetched from in https://github.com/openrewrite/rewrite-jenkins/blob/main/src/main/java/org/openrewrite/jenkins/AddPluginsBom.java .

jonesbusy commented 4 months ago

From what I understand is the declarative recipe https://github.com/openrewrite/rewrite-jenkins/commit/30e736b0063026b0ed504a0b813d4f4c859d67e7 that define the minimum version

The "real" version is fetch here : https://github.com/openrewrite/rewrite-jenkins/blob/main/src/main/java/org/openrewrite/jenkins/Jenkins.java#L43

Basially it doesn't check the property by itself but the managed version of org.jenkins-ci.main:jenkins-core artifact (that is influenced by the jenkins.version property

jonesbusy commented 3 months ago

Downstream PR https://github.com/openrewrite/rewrite/pull/4404

jonesbusy commented 1 month ago

Other PR related to new archetype https://github.com/openrewrite/rewrite-jenkins/pull/73 will not