jenkinsci / plugin-modernizer-tool

MIT License
8 stars 5 forks source link

Save metadata to filesystem #41

Closed jonesbusy closed 1 month ago

jonesbusy commented 3 months ago

What feature do you want to see added?

Right now the metadata is only loaded into memory. A singleton instance is used which also prevent executing recipes concurrently or will erase the content on next plugin (it can also lead to errors)

We should be able to save to a some file(s) in order to perform caching and reporting like it's done on https://docs.google.com/spreadsheets/d/1MRKPY_RDi8pvuDRmO3-nmxm4P3cy9Y-5zPKZ_8CJfzQ/edit?usp=sharing

We could support several format (CSV is useful for google docs) or JSON is useful to get ingested by other tools (Plugin Health score)

Upstream changes

No but the metadata is limited for now (Only from the pom). We don't know for a plugin if a Jenkinsfile exists for example

We should use https://github.com/openrewrite/rewrite/blob/main/rewrite-core/src/main/java/org/openrewrite/FindSourceFiles.java and check for the marker existence

Are you interested in contributing this feature?

No response

gounthar commented 3 months ago

Great suggestion! 👍

gounthar commented 3 months ago

Where should we store the result?

The most obvious answer might be "in this repository" or "in a dedicated repository," but some members of our community have reservations about this approach.

So, what are our options? We could consider:

  1. Running it on ci.jenkins.io and storing the result as an artifact
  2. Using an API to create a Google Doc dynamically
  3. Hosting it on a static website
  4. Utilizing GitHub Pages
  5. Exploring other alternatives

What do you think would work best for our needs and community preferences?

jonesbusy commented 3 months ago

On my side I didn't though a lot yet about storage, but my initial idea was to have some filesystem cache for the plugin metadata. So when you run the CLI several time in a row for the same plugin you can skip the extraction of metadata (until at some point the cache expire).

On 5) what about the plugin health score system ? Despite the score it also used a database and have some API

Also form what I remember there are some probe wanted that can be difficult to implement with static parsing and can only be achieved using OpenRewrite (because we need to build the LST).

What if we can give this data to PHS (push model) via some API ?

jonesbusy commented 3 months ago

From what I found many reports are hosted on https://reports.jenkins.io/

Those report like the PHS : https://reports.jenkins.io/plugin-health-scoring/scores.json are used when the Jenkins plugin side is rebuild

This look a good candidate to me

Some details can be found on https://groups.google.com/g/jenkinsci-dev/c/7OyVRnLvplg

lemeurherve commented 3 months ago

(Optional) suggestion: open an helpdesk or a thread on jenkinsci-dev mailing list to gather feedbacks and alternatives?

jonesbusy commented 1 month ago

This is fixed by #197. Let's open a new issue for other archiving solution