-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Retain old JobResults #8956
Comments
I have a working implementation shortly as a PR. |
I think this makes sense. The first question that comes to mind is: How will we handle the eventual cleanup of old JobResult instances? Presumably via the housekeeping management command? We'd also need to introduce a configuration parameter to dictate the expiration age similar to
|
I actually did consider adding it to the housekeeping command, but figured that as JobResults, opposed to changelog entries, are deletable in the admin panel, it wouldn't be nessecary. I can add it if you think it would be the best way to handle it. How about default retention? Unlimited would be my preference , but I'm not sure how much data people are actually outputting from their scripts. |
IMO unlimited ( |
I added a JOBRESULT_RETENTION option, added the functionality to the housekeeping script and updated the documentation. Let me know if I missed anything. |
Since this is a fairly substantial change to the existing behavior, I'd like to tag this for v3.2 (due to be released the week of April 4th). @kkthxbye-code would you mind rebasing your PR off the |
@jeremystretch - I haven't rebased to a different parent before, could you maybe give a little hint. My google-fu comes short here, as there seems to be a bunch of different ways to get the same result. I've tried I'm kinda lost I guess :) |
Should we target this for v3.3 now or release it as a minor in v3.2? |
I think it's reasonable to implement this in v3.2, given that:
However, perhaps we should alter the default |
@jeremystretch - I changed the default to 90. While I prefer unlimited by default, I can see the rationale for 90. When merged I'll start looking at scheduling jobs. I also think it might make sense to move job results out of the admin ui at some point, espcially if scheduled tasks are on the table. Also while I tested this pretty extensively, it would ease my mind if one of you guys would just do a small verification to see if everything functions as intended. |
Thanks! It's all about trying to protect the user ultimately.
Agreed; we should implement a "proper" UI view as part of the scheduling work.
Will do! 👍 |
NetBox version
v.3.1.9
Feature type
Change to existing functionality
Proposed functionality
Currently all old JobResults are deleted when a new JobResult is in a terminal state. I propose that old JobResults are preserved.
Use case
Deleting old JobResults make it hard to use for automation through the API. Imagine a case where two runs of the same script is triggered via. the API. The API returns an id for the JobResult that can be used to query for the result. The RQ worker will run the scripts one after the other. When the first script finishes, you have the runtime of the second script to get the result. If you do not retrieve the result before the second script finishes, the JobResult is deleted and impossible to retrieve.
Also contributing to the issue is that JobResults are not webhook enabled, which could provide a workaround in some cases. But that's a different feature request.
Database changes
None
External dependencies
No response
The text was updated successfully, but these errors were encountered: