-
-
Notifications
You must be signed in to change notification settings - Fork 267
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
Incorporate plugin health score in JSON metadata #840
base: master
Are you sure you want to change the base?
Incorporate plugin health score in JSON metadata #840
Conversation
import okhttp3.Request; | ||
|
||
public class HealthScores { | ||
private static final String HEALTH_SCORES_URL = "https://reports.jenkins.io/plugin-health-scoring/scores.json"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than using the application endpoint, which generate the output on demand, this stores a static file, generated every hour IIRC.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First set of feedback/point of attention:
-
What is the impact on the size of the JSON metadatas? I have vague recollections of impacts due to adding even an integer field causing challenges. Of course it might be hard to evaluate: if it is the case, I would propose to start with generating both JSONs files (with and without the PH score), we keep deploying the "without PH score" and measure the impact in size and build/deploy time before going forward.
-
This PR adds a dependency on the service reports.jenkins.io. If the service is down or not reachable, what would be the expected fall backs? This webservice is "HA" (e.g. it has a QoS bound to the underlying Azure Kubernetes cluster today) but could be down.
I'll generate both and let you down the time required for the generation and the size the the files in each case.
Technically, we already have this dependency: |
I wasn't sure it was possible or easy for you (as the production dataset could be heavy, not even speaking about the cache...). Thanks!
OH: I was not aware. Then your change here does NOT add any dependency but reuse existing. It makes sense then (as per my infra hat: I can answer for the scope of the code itself). |
So for the size: ❯ ls -al with*
with-health-score:
total 18528
drwxr-xr-x 5 alecharpe * 160 3 fév 15:25 .
drwxr-xr-x 20 alecharpe * 640 3 fév 15:28 ..
-rw-r--r-- 1 alecharpe * 3158562 3 fév 15:25 update-center.actual.json
-rw-r--r-- 1 alecharpe * 3158584 3 fév 15:25 update-center.json
-rw-r--r-- 1 alecharpe * 3158787 3 fév 15:25 update-center.json.html
without-health-score:
total 18312
drwxr-xr-x 5 alecharpe * 160 3 fév 15:28 .
drwxr-xr-x 20 alecharpe * 640 3 fév 15:28 ..
-rw-r--r-- 1 alecharpe * 3124324 3 fév 15:28 update-center.actual.json
-rw-r--r-- 1 alecharpe * 3124346 3 fév 15:28 update-center.json
-rw-r--r-- 1 alecharpe * 3124549 3 fév 15:28 update-center.json.html For the timing, I ran the commands with an existing cache as downloading the files should not be part of the problem. As the health report is accessed / loaded once, this changeset should not be the biggest source of issues. Compared to accessing all the plugin GitHub repositories for example.
I'm still looking at what happens with no access to reports service. |
So apparently, with reports.jenkins.io is down (blocked it locally), the |
|
Thanks @daniel-beck. Just improved the code to not fail if the report is not available. |
public int value; | ||
} | ||
|
||
public Integer getHealthScore(String pluginId) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer not to have the boxing / unboxing but the current fastjson configuration do not serialise null
field. Using an ObjectSerializer
with another default value (like -1
) is not working as only the value can be ignored from the serialisation, but the field name is generated anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks reasonable 😃
import okhttp3.OkHttpClient; | ||
import okhttp3.Request; | ||
|
||
public class HealthScores { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Javadoc for this would be useful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just added what made sense to me. Please let me know if it's alright or if I need to improve it.
On-holding this, pending the corresponding core change. |
Thanks @daniel-beck Co-authored-by: Daniel Beck <[email protected]>
This adds the plugin health, from the https://github.com/jenkins-infra/plugin-health-scoring project, into the update-center output.
This is the first step to be able to display the scores in the Plugin Manager.
Testing
I tested on a limited number of plugins and it worked. I'm testing now with all plugins.