jenkinsci / plugin-modernizer-tool

MIT License
8 stars 5 forks source link

What else can be extracted? #56

Open sridamul opened 3 months ago

sridamul commented 3 months ago

What feature do you want to see added?

This issue is to discuss what other metadata of a plugin can be useful

List of implemented metadata extraction: 1) Plugin Name 2) has License? 3) has Developers Tag? 4) has Java level? 5) Uses Https instead of git? 6) has Jenkins file? 7) dependencies 8) Jenkins version 9) Plugin Parent (includes parent version) 10) Property tags

Please feel free to add what other metadata of a plugin could be useful.

Upstream changes

No response

Are you interested in contributing this feature?

No response

gounthar commented 3 months ago

Used spotbug, and if so, what is the threshold level?

sridamul commented 3 months ago

Used spotbug, and if so, what is the threshold level?

Can be determined via properties. (spotbugs.threshold)

Following is the Plugin Metadata extracted for gitlab-oauth-plugin

{
  "pluginName": "GitLab Authentication plugin",
  "isLicensed": true,
  "hasDevelopersTag": true,
  "hasJavaLevel": false,
  "usesHttps": true,
  "hasJenkinsfile": true,
  "dependencies": [
    {
      "gav": {
        "groupId": "io.jenkins.plugins",
        "artifactId": "caffeine-api"
      }
    },
    {
      "gav": {
        "groupId": "org.jenkins-ci.plugins",
        "artifactId": "apache-httpcomponents-client-4-api"
      }
    },
    {
      "gav": {
        "groupId": "org.jenkins-ci.plugins",
        "artifactId": "mailer"
      }
    },
    {
      "gav": {
        "groupId": "io.jenkins.plugins",
        "artifactId": "gitlab-api"
      }
    },
    {
      "gav": {
        "groupId": "org.jenkins-ci.plugins",
        "artifactId": "git"
      }
    },
    {
      "gav": {
        "groupId": "org.jenkins-ci.plugins",
        "artifactId": "jackson2-api"
      }
    }
  ],
  "jenkinsVersion": "2.387.3",
  "pluginParent": {
    "gav": {
      "groupId": "org.jenkins-ci.plugins",
      "artifactId": "plugin",
      "version": "4.82"
    }
  },
  "properties": {
    "revision": "1.20",
    "changelist": "-SNAPSHOT",
    "jenkins.version": "2.387.3",
    "spotbugs.effort": "Max",
    "spotbugs.threshold": "Low",
    "gitHubRepo": "jenkinsci/${project.artifactId}-plugin",
    "project.build.sourceEncoding": "UTF-8",
    "project.reporting.outputEncoding": "UTF-8",
    "project.basedir": "\\plugin-modernizer-tool\\test-plugins\\gitlab-oauth-plugin",
    "basedir": "\\plugin-modernizer-tool\\test-plugins\\gitlab-oauth-plugin"
  }
}
jonesbusy commented 3 months ago

For me I would be useful to know if a plugin is using a direct or transitive dependency not provided by an API plugin.

If would be good to have a mapping of api plugin and their dependency and raise the point when the dependency is found in the chain of dependency but the api plugin is not

Not sure if a metadata or just a recipe that will perform the change

There is already a recipe https://github.com/openrewrite/rewrite-jenkins/blob/main/src/main/java/org/openrewrite/jenkins/ReplaceLibrariesWithApiPlugin.java but we need to provide to the recipe input. I would expect that is recipe is called directly with correct argument

sridamul commented 3 months ago

I would expect that is recipe is called directly with correct argument

Opened issue #58 to discuss about recipes with configuration parameters