Expand report status to include Warnings #3814

Closed
opened 2025-12-29 18:31:20 +01:00 by adam · 3 comments
Owner

Originally created by @cpmills1975 on GitHub (Jun 29, 2020).

Environment

  • Python version: 3.7.7
  • NetBox version: 2.8.6

Proposed Functionality

Expand the 'status' of a report from the current 'Passed'/'Failed' to include 'Warning' when a report returns warnings, but not failures. Effectively reports would result in a proper Red/Amber/Green status.

Use Case

A report can currently log pass, fail, warn or info for any given test, yet the result of the test is either pass or fail depending on whether any 'fails' were logged or not. I'd like to propose that 'warn' is added for situations where the report writer has deemed something bad enough to warn the user, but not bad enough to fail. Fail will take priority, but should no fails be logged, the logging of at least one warning would make the report result warn rather than pass.

Obviously this overlaps with the work in #2006, specifically the changes to the JobResultStatusChoices class.

Database Changes

JobResultStatusChoices would need to be further expanded to include a WARN status.

External Dependencies

None.

Originally created by @cpmills1975 on GitHub (Jun 29, 2020). <!-- NOTE: IF YOUR ISSUE DOES NOT FOLLOW THIS TEMPLATE, IT WILL BE CLOSED. This form is only for proposing specific new features or enhancements. If you have a general idea or question, please post to our mailing list instead of opening an issue: https://groups.google.com/forum/#!forum/netbox-discuss NOTE: Due to an excessive backlog of feature requests, we are not currently accepting any proposals which significantly extend NetBox's feature scope. Please describe the environment in which you are running NetBox. Be sure that you are running an unmodified instance of the latest stable release before submitting a bug report. --> ### Environment * Python version: 3.7.7 * NetBox version: 2.8.6 <!-- Describe in detail the new functionality you are proposing. Include any specific changes to work flows, data models, or the user interface. --> ### Proposed Functionality Expand the 'status' of a report from the current 'Passed'/'Failed' to include 'Warning' when a report returns warnings, but not failures. Effectively reports would result in a proper Red/Amber/Green status. <!-- Convey an example use case for your proposed feature. Write from the perspective of a NetBox user who would benefit from the proposed functionality and describe how. ---> ### Use Case A report can currently log pass, fail, warn or info for any given test, yet the result of the test is either pass or fail depending on whether any 'fails' were logged or not. I'd like to propose that 'warn' is added for situations where the report writer has deemed something bad enough to warn the user, but not bad enough to fail. Fail will take priority, but should no fails be logged, the logging of at least one warning would make the report result warn rather than pass. Obviously this overlaps with the work in #2006, specifically the changes to the JobResultStatusChoices class. <!-- Note any changes to the database schema necessary to support the new feature. For example, does the proposal require adding a new model or field? (Not all new features require database changes.) ---> ### Database Changes JobResultStatusChoices would need to be further expanded to include a WARN status. <!-- List any new dependencies on external libraries or services that this new feature would introduce. For example, does the proposal require the installation of a new Python package? (Not all new features introduce new dependencies.) --> ### External Dependencies None.
adam closed this issue 2025-12-29 18:31:20 +01:00
Author
Owner

@jeremystretch commented on GitHub (Jun 30, 2020):

Let's not get ahead of ourselves. The PR for #2006 hasn't even been merged yet, let alone the v2.9 beta released. Please wait until you have a chance to review the beta, and if you believe this proposal is still relevant we can look at reopening it.

@jeremystretch commented on GitHub (Jun 30, 2020): Let's not get ahead of ourselves. The PR for #2006 hasn't even been merged yet, let alone the v2.9 beta released. Please wait until you have a chance to review the beta, and if you believe this proposal is still relevant we can look at reopening it.
Author
Owner

@cpmills1975 commented on GitHub (Jun 30, 2020):

So this isn't specifically related to 2.9 or to #2006. It's a general request to expose warnings up to the report result if no errors are logged, but warnings are.

My specific use-case is monitoring. I have an idea where I will run reports periodically using Jenkins and then read the report result in to a monitoring platform using the API. Like most monitoring platforms, it supports Red (error), Amber (warning) and Green (ok) statuses but because reports can only pass or fail, warnings will not be exposed to the monitoring platform making them effectively pointless in my planned scenario.

I mentioned #2006 as I searched for other, matching or potentially conflicting, feature requests first.

@cpmills1975 commented on GitHub (Jun 30, 2020): So this isn't specifically related to 2.9 or to #2006. It's a general request to expose warnings up to the report result if no errors are logged, but warnings are. My specific use-case is monitoring. I have an idea where I will run reports periodically using Jenkins and then read the report result in to a monitoring platform using the API. Like most monitoring platforms, it supports Red (error), Amber (warning) and Green (ok) statuses but because reports can only pass or fail, warnings will not be exposed to the monitoring platform making them effectively pointless in my planned scenario. I mentioned #2006 as I searched for other, matching or potentially conflicting, feature requests first.
Author
Owner

@lampwins commented on GitHub (Jun 30, 2020):

@cpmills1975 since you are looking at the report status via the API, you have the ability to look at the log levels of all the log messages for a given report and make the decision yourself.

That said, let's let the dust settle on #2006 and come back to this if needed.

@lampwins commented on GitHub (Jun 30, 2020): @cpmills1975 since you are looking at the report status via the API, you have the ability to look at the log levels of all the log messages for a given report and make the decision yourself. That said, let's let the dust settle on #2006 and come back to this if needed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3814