Skip to content

Latest commit

 

History

History
59 lines (41 loc) · 3.99 KB

ARCHITECTURE.adoc

File metadata and controls

59 lines (41 loc) · 3.99 KB

Application architecture

The application is fetching the list of plugins from the Update Center of Jenkins community. This is done in UpdateCenterScheduler. It registers all the known plugins into the database.

Once this is done, the application is divided into two main parts: Probe and Scoring.

What is a Probe?

Probes have the responsibility to fetch data for each plugins. They reach external system, like GitHub, the Jira, etc, and register the wanted data into a ProbeResult.

A probe can retrieve any kind of data. Probes can determine be used to the presence or not of a file (pom.xml,.github/dependabot.yml, etc) on the plugin repository, retrieve the number of pull requests, etc. Each probes can have a list of requirements to be executed. This means, that, more than its order, a probe requires another probe to have a successful result before being executed.

The probe, when executed, returns a ProbeResult which embedded a key, a status, a message and a timestamp of the execution of the probe.

  • The id of the ProbeResult is the key of the Probe which was executed.

  • The message can provides more details about the probe execution result.

  • The status can be one of ProbeResult.Status.ERROR or ProbeResult.Status.SUCCESS.

  • The timestamp is used to know when the result was produced.

ProbeResult.Status.ERROR is used to mark issues occurring during the probe execution. It can happen because the requirements to run a probe are not met or because the source of validation cannot be found.

ProbeResult.Status.SUCCESS means that the probe was executed correctly and the probe could retrieve the data it was looking for.

The probes are not making any judgement or observations on the plugin state. They are only reporting data.

Probes are executed by the ProbeEngine. There are conditions for each probe to be executed:

  • if all the requirements defined by the probe are met

  • if it has never been executed on a specific plugin

  • if the probe doesn’t require a new release or new code addition to be executed

  • if the last execution of the probe on a specific plugin was done before the last code change of the plugin and the probe is based on the code of the plugin

  • if the last execution of the probe on a specific plugin was done before the last release of the plugin and the probe requires a release to have its result changed

The ProbeEngine is scheduled by the ProbeEngineScheduler class. This is using a CRON expression for its scheduling. The environment variable PROBE_ENGINE_CRON is used to configure this CRON.

What is a Scoring?

The scoring implementation are responsible to determine the health of a plugin. Each implementation have a coefficient which dictate how important to the global health of a plugin, this scoring implementation is.

Each implementation can use one or many ProbeResult of a plugin, in order to determine its score. The value the score is a float between 0 and 1.

The ScoringEngine is responsible to execute each Scoring implementation on every plugin. However, if the last score of a plugin was computed more recently than the most recent ProbeResult for a plugin, the scoring implementation is skipped. This because the same score would be generated.

The execution of the ScoringEngine is schedule by the ProbeEngineScheduler, just after the ProbeEngine is finished.