jenkins-infra / plugin-health-scoring

This project aims to introduce a metric system to calculate the health score of each plugin within the Jenkins ecosystem and reflect the final scores on the Plugin Site for the plugin maintainers and users.

Home Page:https://plugin-health.jenkins.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Last plugin release date tracker probe

AayushSaini101 opened this issue · comments

Description

We need to add a new probe that helps track the release status of the plugin, and how frequently the plugin is released.

Importance:

  • Help the Stakeholders to know How long it will take as on average to resolve their issues.
  • Time will the difference between the release of the plugin

I don't really think this would produce reliable data because:

  • a new maintainer can start to work on a previously abandonned plugin and the average of that plugin would to 10 times the reality
  • and the opposite is also true when a maintainer has not enough time to work on a plugin.

This is something we already introduced with

new TimeSinceLastCommitScoringComponent() {
@Override
public String getDescription() {
return "There must be a reasonable time gap between last release and last commit.";
}
@Override
public ScoringComponentResult getScore(Plugin plugin, Map<String, ProbeResult> probeResults) {
final ProbeResult probeResult = probeResults.get(LastCommitDateProbe.KEY);
if (probeResult == null || ProbeResult.Status.ERROR.equals(probeResult.status())) {
return new ScoringComponentResult(-100, 100, List.of("Cannot determine the last commit date."));
}
final long days = getTimeBetweenLastCommitAndDate(probeResult.message(), plugin.getReleaseTimestamp().withZoneSameInstant(getZone())).toDays();
final String defaultReason = "There are %d days between last release and last commit.".formatted(days);
if (days < Duration.of(30 * 6, ChronoUnit.DAYS).toDays()) {
return new ScoringComponentResult(100, getWeight(), List.of(defaultReason, "Less than 6 months gap between last release and last commit."));
}
if (days < Duration.of((30 * 12) + 1, ChronoUnit.DAYS).toDays()) {
return new ScoringComponentResult(60, getWeight(), List.of(defaultReason, "Less than a year between last release and last commit."));
}
if (days < Duration.of((30 * 12 * 2) + 1, ChronoUnit.DAYS).toDays()) {
return new ScoringComponentResult(20, getWeight(), List.of(defaultReason, "Less than 2 years between last release and last commit."));
}
if (days < Duration.of((30 * 12 * 4) + 1, ChronoUnit.DAYS).toDays()) {
return new ScoringComponentResult(10, 2, List.of(defaultReason, "Less than 4 years between last release and last commit."));
}
return new ScoringComponentResult(-1000, getWeight(), List.of("There is more than 4 years between the last release and the last commit."));
}
}
and it can be gamified (which is bad) or largely invalid.