Commit Graph

53 Commits

Author SHA1 Message Date
Arthur Hanson
fda9518740 12510 Merge Scripts and Reports (#14976)
* 12510 move reports to use BaseScript

* 12510 merge report into script view

* 12510 add migration for job report to script

* 12510 update templates

* 12510 remove reports

* 12510 cleanup

* 12510 legacy jobs

* 12510 legacy jobs

* 12510 fixes

* 12510 review changes

* 12510 review changes

* 12510 update docs

* 12510 review changes

* 12510 review changes

* 12510 review changes

* 12510 review changes

* 12510 main log results to empty string

* 12510 move migration

* Introduce an internal log level for debug to simplify Script logging

* Misc cleanup

* Remove obsolete is_valid() method

* Reformat script job data (log, output, tests)

* Remove ScriptLogMessageSerializer

* Fix formatting of script logs

* Record a timestamp with script logs

* Rename _current_method to _current_test

* Clean up template

* Remove obsolete runreport management command

* Misc cleanup & refactoring

* Clean up template

* Clean up migration

* Clean up docs

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2024-02-07 12:02:09 -05:00
Jeremy Stretch
ba78e270ce #13334: Capture exception class when recording job error 2023-12-01 10:54:46 -05:00
Jeremy Stretch
d330ac699b Closes #13334: Record error message on failed jobs (#14106) 2023-10-31 08:34:57 -04:00
Arthur
272a8e122e 13944 fix report detail api 2023-10-03 14:39:46 -04:00
Jeremy Stretch
6f0a11624e #13666: Add is_valid property to Report class 2023-09-26 10:53:38 -04:00
JCWasmx86
8be38492d0 Fixes #13666: Fix behavior for reports without test methods (#13667) 2023-09-26 10:41:09 -04:00
Jeremy Stretch
a65f9f3770 Fixes #13369: Fix job termination status for failed reports 2023-08-04 08:12:52 -04:00
jeremystretch
b84ad3e244 Enable scheduling_enabled parameter for reports 2023-04-18 08:45:31 -04:00
jeremystretch
0078119bf7 Closes #12085: Add a file source view for reports 2023-03-29 16:58:35 -04:00
Jeremy Stretch
648d0711e5 #12081: Script & report cleanup (#12091)
* start() and terminate() methods on Job should call save()

* Fix display of associated jobs

* Introduce get_latest_jobs() method on JobsMixin

* Update messaging when no reports/scripts exist

* Catch ImportErrors when rendering report/script lists

* Fix loading of nested modules

* Fix URLs for nested scripts/reports
2023-03-29 16:51:55 -04:00
Jeremy Stretch
409c1aa118 Closes #12068: Establish a direct relationship from jobs to objects (#12075)
* Reference database object by GFK when running scripts & reports via UI

* Reference database object by GFK when running scripts & reports via API

* Remove old enqueue_job() method

* Enable filtering jobs by object

* Introduce ObjectJobsView

* Add tabbed views for report & script jobs

* Add object_id to JobSerializer

* Move generic relation to JobsMixin

* Clean up old naming
2023-03-28 15:47:09 -04:00
jeremystretch
6a8ffd9fac Rename JobResult to Job and move to core 2023-03-27 14:20:13 -04:00
Jeremy Stretch
20fa941687 Closes #11890: Sync/upload reports & scripts (#12059)
* Initial work on #11890

* Consolidate get_scripts() and get_reports() functions

* Introduce proxy models for script & report modules

* Add add/delete views for reports & scripts

* Add deletion links for modules

* Enable resolving scripts/reports from module class

* Remove get_modules() utility function

* Show results in report/script lists

* Misc cleanup

* Fix file uploads

* Support automatic migration for submodules

* Fix module child ordering

* Template cleanup

* Remove ManagedFile views

* Move is_script(), is_report() into extras.utils

* Fix URLs for nested reports & scripts

* Misc cleanup
2023-03-24 21:00:36 -04:00
jeremystretch
bb7ab748bd Replace JobResult.set_status() with terminate() 2023-03-07 18:01:32 -05:00
Jeremy Stretch
c6a8cbf030 Closes #10945: Enable recurring execution of scheduled reports & scripts (#11096)
* Add interval to JobResult

* Accept a recurrence interval when executing scripts & reports

* Cleaned up jobs list display

* Schedule next job only if a reference start time can be determined

* Improve validation for scheduled jobs
2022-12-08 18:17:13 -05:00
jeremystretch
2350557d90 #8366: Add started field to JobResult 2022-11-15 15:06:11 -05:00
kkthxbye-code
59cd87b283 Added scheduled_time field to JobResult model 2022-10-16 13:42:28 +02:00
kkthxbye-code
ffea42a984 PEP8: Fix whitespace on blank line 2022-09-14 20:00:12 +02:00
kkthxbye-code
5ddb799989 Allow reports to be nested in submodules 2022-09-14 19:57:37 +02:00
jeremystretch
3593fcaa75 Closes #9896: Discontinue arbitrary use of OrderedDict 2022-08-01 16:51:44 -04:00
kkthxbye
557248c53f Save old JobResults 2022-04-12 11:42:47 -04:00
kkthxbye-code
cd29a1897e Allow setting individual timeouts on scripts and reports 2022-04-04 18:00:38 +02:00
jeremystretch
e8c3910065 Closes #8572: Add a pre_run() method for reports 2022-02-07 12:57:02 -05:00
jeremystretch
1f6bf88e72 Drop as_dict() method from ChoiceSet 2021-12-16 10:22:05 -05:00
maximumG
82606891c5 feat: reports within a module can now be ordered 2021-09-27 11:02:31 +02:00
Jeremy Stretch
1c335551a0 Fixes #5012: Return details of exceptions resulting from report/script execution 2020-08-20 12:47:26 -04:00
Jeremy Stretch
a1d03e969a Provide a default view for Report instances 2020-07-06 13:30:13 -04:00
John Anderson
2340d4d592 review updates 2020-07-06 02:00:16 -04:00
John Anderson
38ef8fb4c4 PR review updates 2020-07-06 02:00:16 -04:00
John Anderson
a91de7f5da fix previous job result deletion 2020-06-30 09:29:50 -04:00
John Anderson
ec4be16aef Implements #2006 - run reports and scripts in the background 2020-06-29 03:50:05 -04:00
Jeremy Stretch
e635c5eba3 Fixes #4646: Correct UI link for reports with custom name 2020-05-15 09:13:51 -04:00
Jeremy Stretch
1530d62568 Enable system logging for reports 2020-03-04 14:22:30 -05:00
Jeremy Stretch
b4acade70d Miscellaneous cleanup 2019-10-04 12:59:10 -04:00
Jeremy Stretch
f6d4ea00df Cleaned up import statements 2018-11-02 15:20:08 -04:00
Jeremy Stretch
68a5dcd47e Removed Python 2 string compatibility 2018-08-14 11:58:42 -04:00
Jeremy Stretch
1724491366 Closes #2000: Remove support for Python 2 2018-08-14 11:48:12 -04:00
Jeremy Stretch
40f7667e51 Fixes #2318: ImportError when viewing a report 2018-08-07 12:10:14 -04:00
Jeremy Stretch
318e5aac45 Fixes #2312: Running a report yields a ValueError exception 2018-08-07 09:12:05 -04:00
Jeremy Stretch
e47ea595cc Fixes #1786: Correct loading of reports from a custom file path 2018-07-31 13:48:07 -04:00
Jeremy Stretch
002848cf09 Closes #1691: Cleaned up and reorganized import statements 2017-11-07 11:08:23 -05:00
Jeremy Stretch
17528294fe Closes #1631: Added a post_run method to the Report class 2017-10-27 10:02:27 -04:00
Jeremy Stretch
6671ded02f Introduced the REPORTS_ROOT config parameter; Python2 fixes 2017-10-11 14:03:35 -04:00
Jeremy Stretch
7e0b54eadd Bugfixes 2017-09-28 13:36:50 -04:00
Jeremy Stretch
cceb4c69f8 Expanded report view 2017-09-28 13:35:18 -04:00
Jeremy Stretch
0b3cddb56b Moved ReportResult creation into Report.run() 2017-09-28 12:50:32 -04:00
Jeremy Stretch
ec6475e60b Started adding a view for individual reports 2017-09-27 17:39:22 -04:00
Jeremy Stretch
5aefe987c2 Cleaned up the API quite a bit 2017-09-26 16:36:43 -04:00
Jeremy Stretch
69f90c6342 Extended reports API 2017-09-25 17:27:58 -04:00
Jeremy Stretch
6f401636f8 Implemented rough UI for accessing report results 2017-09-22 12:11:10 -04:00