(Jenkins plugin) - buildResult periodically resets back to 0

Crossposting from GitHub, as I haven’t heard back and the repo seems to be unmonitored.

Hi there,

I would like to use the Jenkins plugin to configure build alerts instead of using the native Jenkins one.

What I would ideally like is to query just the latest pipeline build on the master branch and get its build result. A violation would be opened if that latest result is a failure.

My NRQL query:

SELECT filter(uniqueCount(buildId), WHERE buildEventType='finalized' AND buildUrl RLIKE 'job/path/to/pipeline/job/name-of-job/job/master/.*' AND buildResult != 'SUCCESS' as 'Failures') FROM AppBuildEvent

If the job fails, a violation is being opened but then auto-closing itself.

This is seems to be related to the query returning zero periodically. This screenshot is where the build failed, and has not since been run:

I would like the result to consistently be 1, until the latest result is a success.

Is this a mistake in the query, or something else I’m missing?

TIA!

Hi there @anthony.Magalhaes -

Thanks for posting in the community! I did want to make sure we set expectations for help on this one. The Jenkins plugin is classified as a New Relic Experimental project. This code solves an interesting problem but does not yet have an active maintainer. The project is being developed in the open for the purpose of feedback on a new feature or function.

So - the folks who have made commits MAY be able to help you out, but may not even be working on the code base anymore.

Hi there. Apologies for the late reply. Thank you for responding! I’ll hold out hope for a response and just look for an alternative solution for now.