delphijenkinsmsbuildsoftware-qualitywarnings-next-generation

Jenkins Warnings plugin - Quality Gate on MSBuild - Reference build recorder is not configured, why?


I'm trying to implement Quality Gate via the Warnings plugin in Jenkins on my Delphi projects (based on MSBuild). The final goal, for now, is to mark as failed any build that has a count of hints+warnings greater than the previous build.

I configured the warnings plugin as suggested here as this makes sense. I also checked the "Ignore the results of the quality gates when determining the reference build" flag, as I just need the current build to be compared to the previous one.

However this doesn't work as expected and the root problem appears to be that the plugin fails to establish a reference build to compare the new build to (actually this also affects the way I see the ongoing state of the hints/warnings on my builds, they're always marked as "outstanding" even if there are new or fixed issues).

The console output shows these lines in proximity of the quality gate log:

[MSBuild] Reference build recorder is not configured
[MSBuild] No valid reference build found
[MSBuild] All reported issues will be considered outstanding
[MSBuild] Evaluating quality gates
[MSBuild] -> All quality gates have been passed
[MSBuild] -> Details for each quality gate:
[MSBuild]    - [New (any severity)]: ?Completato con successo? - (Actual value: 0, Quality gate: 1,00)

I have no idea how to configure/enable the "reference build recorder" and I don't see any reference on the web, actually I thought it should just compare the current build to the previous one.

What am I missing?


Solution

  • Ok, I've sorted it out. Actually I missed a step.

    As stated here, the "Discover reference build" step must be called before the Warnings plugin, in order to... well, discover the reference build against which to compare the current one.

    Hope this may be helpful to others missing this not-so-obvious requirement.