Remove dependencies on `commons-math3` and `ssj` by implementing simple linear regression directly, replacing the build duration distribution chart with a histogram, and deleting the smoothed trend lines in the test history charts #639
This is a followup to https://github.com/jenkinsci/junit-plugin/pull/638 and https://github.com/jenkinsci/junit-plugin/pull/625 to further simplify the dependencies after I discussed it with some colleagues. This plugin is used pretty widely in the Jenkins ecosystem, so it seems worth trying to minimize its dependencies, especially to eliminate dependencies which are not being actively maintained.
This PR does 3 things (you can review commit by commit if you like):
It gets rid of the commons-math3 dependency by just directly implementing a simple linear regression algorithm. This is very straightforward since we are only using it for a trend line and don't care about any other data related to the regression.
It replaces the SmoothingCubicSpline-based build duration distribution chart with a histogram, which I think is a better representation of the data anyway.
It completely deletes the two SmoothingCubicSpline-based "Smooth of X" trend lines that are only shown in the test history widget if more than 200 builds' worth of test results are available. I did this so we could get rid of the ssj dependency completely. Here is my justification:
I do not think pluggable storage for test results is in widespread use, so most users set up build retention policies that will prevent them from getting anywhere close to 201 builds' worth of test results, so those users can never see these trend lines anyway
Even for users who do have at least 201 build's worth of test results, by default the page only shows 100 builds' worth test results, so only users who actively play around with the options on the page would ever see these trend lines
I could not find any simple replacement for SmoothingCubicSpline in an actively-maintained library, and I am not confident in being able to reimplement it from scratch correctly in a reasonable amount of time
ssj is not actively maintained and has some warning signs, for example its 3.3.2 release is not listed anywhere in publicly available Git commit history
I am totally ok with adding this functionality back to the plugin with any of these three approaches:
If someone can find a replacement for SmoothingCubicSpline in an actively-maintained library with minimal dependencies and that ideally is not pulling in a whole grab bag of unrelated functionality that we do not need
If someone is willing to implement an equivalent algorithm directly
If someone wants to make it possible for https://github.com/jenkinsci/license-maven-plugin to support manually-specified license information, so that we could copy/paste the implementation of SmoothingCubicSpline into this repository while still having license information be reported accurately in Jenkins on the /manage/about/ page
Here are screenshots with and without the PR:
With this PR:
Without this PR:
Testing done
Submitter checklist
[x] Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
[x] Ensure that the pull request title represents the desired changelog entry
[x] Please describe what you did
[ ] Link to relevant issues in GitHub or Jira
[x] Link to relevant pull requests, esp. upstream and downstream changes
[x] Ensure you have provided tests - that demonstrates feature works or fixes the issue
This is a followup to https://github.com/jenkinsci/junit-plugin/pull/638 and https://github.com/jenkinsci/junit-plugin/pull/625 to further simplify the dependencies after I discussed it with some colleagues. This plugin is used pretty widely in the Jenkins ecosystem, so it seems worth trying to minimize its dependencies, especially to eliminate dependencies which are not being actively maintained.
This PR does 3 things (you can review commit by commit if you like):
commons-math3
dependency by just directly implementing a simple linear regression algorithm. This is very straightforward since we are only using it for a trend line and don't care about any other data related to the regression.SmoothingCubicSpline
-based build duration distribution chart with a histogram, which I think is a better representation of the data anyway.SmoothingCubicSpline
-based "Smooth of X" trend lines that are only shown in the test history widget if more than 200 builds' worth of test results are available. I did this so we could get rid of thessj
dependency completely. Here is my justification:SmoothingCubicSpline
in an actively-maintained library, and I am not confident in being able to reimplement it from scratch correctly in a reasonable amount of timessj
is not actively maintained and has some warning signs, for example its 3.3.2 release is not listed anywhere in publicly available Git commit historySmoothingCubicSpline
in an actively-maintained library with minimal dependencies and that ideally is not pulling in a whole grab bag of unrelated functionality that we do not needSmoothingCubicSpline
into this repository while still having license information be reported accurately in Jenkins on the/manage/about/
pageHere are screenshots with and without the PR:
With this PR:
Without this PR:
Testing done
Submitter checklist