1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

96 Commits

Author SHA1 Message Date
ef774319f4 Move NetBoxFakeRequest and copy_safe_request() from utilities.utils to utilities.request 2024-03-22 08:59:52 -04:00
3ddacf4b88 Merge branch 'develop' into feature 2024-02-21 16:24:23 -05:00
af27bf5eff 15094 Add missing gettext to error strings for internationalization (#15155)
* 15049 add missing gettext to error strings

* 15049 add missing gettext to error strings

* 15094 review change

* 15094 review change

* Formatting cleanup

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2024-02-20 09:44:02 -05:00
11697d19a6 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
1f2f0860fe Merge branch 'develop' into feature 2023-12-27 16:34:38 -05:00
12beac4f1a fix the result of script jobs #14549 2023-12-20 15:15:02 -05:00
0c9919a5e8 #13334: Capture exception class when recording job error 2023-12-01 10:54:46 -05:00
a38a38218b 14132 Add EventRule - change webhook and add in script processing to events (#14267)
---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2023-11-30 16:36:33 -05:00
7323668dd0 Closes #13334: Record error message on failed jobs (#14106) 2023-10-31 08:34:57 -04:00
2a4e3dd09f Merge branch 'develop' into feature 2023-08-29 10:45:55 -04:00
88bf82be05 clear all cache when lazy is not used #13544 2023-08-24 10:12:48 -04:00
518fd8cca6 12794 change User ref to get_user_model (#12905)
* 12794 change User ref to get_user_model

* 12794 call get_user_model once in tests

* 12794 call get_user_model once in tests

* 12794 use settings.AUTH_USER_MODEL for FK reference
2023-06-22 08:26:50 -04:00
f3826e6235 fix runscript command 2023-05-04 16:18:44 -04:00
d2a694a878 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
7b258dc11f Rename JOBRESULT_RETENTION to JOB_RETENTION 2023-03-27 14:20:13 -04:00
40572b543f Rename JobResult to Job and move to core 2023-03-27 14:20:13 -04:00
5c0ce96b6f Reorganize management commands 2023-03-24 21:11:10 -04:00
f7a2eb8aef 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
2a9178af12 Merge branch 'develop' into feature 2023-03-13 11:58:37 -04:00
a8c331f88a Replace JobResult.set_status() with terminate() 2023-03-07 18:01:32 -05:00
5a4d8a7107 Closes #11787: Rebuild any missing search cache entires after upgrade 2023-02-20 09:49:13 -05:00
d8784d4155 Closes #11558: Add support for remote data sources (#11646)
* WIP

* WIP

* Add git sync

* Fix file hashing

* Add last_synced to DataSource

* Build out UI & API resources

* Add status field to DataSource

* Add UI control to sync data source

* Add API endpoint to sync data sources

* Fix display of DataSource job results

* DataSource password should be write-only

* General cleanup

* Add data file UI view

* Punt on HTTP, FTP support for now

* Add DataSource URL validation

* Add HTTP proxy support to git fetcher

* Add management command to sync data sources

* DataFile REST API endpoints should be read-only

* Refactor fetch methods into backend classes

* Replace auth & git branch fields with general-purpose parameters

* Fix last_synced time

* Render discrete form fields for backend parameters

* Enable dynamic edit form for DataSource

* Register DataBackend classes in application registry

* Add search indexers for DataSource, DataFile

* Add single & bulk delete views for DataFile

* Add model documentation

* Convert DataSource to a primary model

* Introduce pre_sync & post_sync signals

* Clean up migrations

* Rename url to source_url

* Clean up filtersets

* Add API & filterset tests

* Add view tests

* Add initSelect() to HTMX refresh handler

* Render DataSourceForm fieldsets dynamically

* Update compiled static resources
2023-02-19 20:09:51 -05:00
edbd597bf2 Update housekeeping command docs 2023-02-07 16:52:54 -05:00
07df622b59 NetBox should always be referred to as NetBox [DATALAD RUNCMD]
=== Do not change lines below ===
{
 "chain": [],
 "cmd": "git ls-files -z . | xargs --null -I '()' find './()' -type f -not -name 'style-guide.md' -print0 | xargs --null sed --in-place --regexp-extended 's/\\bNetbox\\b/NetBox/g;'",
 "exit": 0,
 "extra_inputs": [],
 "inputs": [],
 "outputs": [],
 "pwd": "."
}
^^^ Do not change lines above ^^^
2023-01-05 16:06:00 -05:00
ae440c9edf Fixes #11223 - Accept app_label for reindex 2022-12-28 16:35:05 -05:00
81c0dce5a3 Closes #10697: Move application registry into core app 2022-11-02 15:25:22 -04:00
9628dead07 Closes #10560: New global search (#10676)
* Initial work on new search backend

* Clean up search backends

* Return only the most relevant result per object

* Clear any pre-existing cached entries on cache()

* #6003: Implement global search functionality for custom field values

* Tweak field weights & document guidance

* Extend search() to accept a lookup type

* Move get_registry() out of SearchBackend

* Enforce object permissions when returning search results

* Add indexers for remaining models

* Avoid calling remove() on non-cacheable objects

* Use new search backend by default

* Extend search backend to filter by object type

* Clean up search view form

* Enable specifying lookup logic

* Add indexes for value field

* Remove object type selector from search bar

* Introduce SearchTable and enable HTMX for results

* Enable pagination

* Remove legacy search backend

* Cleanup

* Use a UUID for CachedValue primary key

* Refactoring search methods

* Define max search results limit

* Extend reindex command to support specifying particular models

* Add clear() and size to SearchBackend

* Optimize bulk caching performance

* Highlight matched portion of field value

* Performance improvements for reindexing

* Started on search tests

* Cleanup & docs

* Documentation updates

* Clean up SearchIndex

* Flatten search registry to register by app_label.model_name

* Clean up search backend classes

* Clean up RestrictedGenericForeignKey and RestrictedPrefetch

* Resolve migrations conflict
2022-10-21 13:16:16 -04:00
ed2f7f1236 Job scheduling review changes 2022-10-21 10:31:30 +02:00
d647983003 Always activate scheduler functionality when running the rqworker management command 2022-10-16 13:47:15 +02:00
679a9e839b Work on job scheduling:
* Added JobResult form filtersets
* Change housekeeping cleanup delete from `_raw_delete` to `delete` to make sure scheduled tasks are cancelled
* Change default sort of JobResult table to -created
* Added `delete` override to `JobResult` to remove scheduled tasks from RQ when a JobResult is deleted
* Updated js/css dist files. Will need to be redone when develop is merged to feature.
2022-10-09 21:05:31 +02:00
356ff457be Allow reports to be nested in submodules 2022-09-14 19:57:37 +02:00
e2eb7fdfb5 Clear webhook queue on script failure 2022-06-03 13:03:58 +02:00
7b5625a722 Add management command for clearing cache 2022-04-29 09:19:19 +02:00
aa2ec3b9c9 Add dynamic config JOBRESULT_RETENTION
and cleanup functionality to the housekeeping script
2022-04-12 11:42:47 -04:00
f13a00b2dd Save old JobResults 2022-04-12 11:42:47 -04:00
36d6ae33d1 Allow setting individual timeouts on scripts and reports 2022-04-04 18:00:38 +02:00
d1b1a45725 Enable tab completion in nbshell 2022-02-13 03:00:57 -05:00
b6ff55309e Fixes #8078: Add missing wireless models to lsmodels() in nbshell 2021-12-15 08:38:19 -05:00
2a00519b93 Move CHANGELOG_RETENTION to dyanmic configuration 2021-11-08 15:07:58 -05:00
b97167e841 Fix PEP8 error 2021-11-02 21:40:40 -05:00
19bacc9e23 #6529 - Adjusted the arguments. Fixed documentation 2021-11-02 21:37:11 -05:00
7c3318df92 #6529 - Adjusted the arguments. Added documentation 2021-11-02 15:56:42 -05:00
b7c0e8b71f #6529 - Streamline code and resolve some issues 2021-11-02 13:12:12 -05:00
0a62f75a40 #6529 - Add CLI to run scripts 2021-10-28 15:14:42 -05:00
376c776520 Fixes #7425: Housekeeping command should honor zero verbosity 2021-10-01 15:29:22 -04:00
499005f84d Merge branch 'develop' into feature 2021-08-23 13:23:39 -04:00
75c62ff729 Print request index after webhook data dump 2021-08-23 11:32:47 -04:00
fe1f221286 Log a warning when rqworker invoked without specified queues 2021-07-09 21:23:27 -04:00
e173c8b548 Add release check to the housekeeping task 2021-07-07 21:37:35 -04:00
b6ec1d9aa7 Remove cacheops workarounds & queryset caching metrics 2021-07-07 17:15:42 -04:00