Commit Graph

129 Commits

Author SHA1 Message Date
Jeremy Stretch
10a74492f6 #17143: Update docs for nested serializer use 2024-08-30 10:18:29 -04:00
Jeremy Stretch
6f7bf5baf4 Merge branch 'develop' into feature 2024-08-29 10:51:38 -04:00
Jeremy Stretch
a9fd5bbf55 Fix broken intra-page links 2024-08-29 09:13:02 -04:00
Jeremy Stretch
8e70e3ad20 Update release checklist for v4.1 2024-08-15 12:59:44 -04:00
Arthur Hanson
ca63aed9ee
17061 add new models to docs (#17062)
* 17061 add new models to docs

* Reorder; remove CircuitGroupAssignment

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2024-08-02 10:00:51 -04:00
Alexander Haase
d3a3a6ba46
15692: Introduce background jobs (#16927)
* Introduce reusable BackgroundJob framework

A new abstract class can be used to implement job function classes. It
handles the necessary logic for starting and stopping jobs, including
exception handling and rescheduling of recurring jobs.

This commit also includes the migration of data source jobs to the new
framework.

* Restore using import_string for jobs

Using the 'import_string()' utility from Django allows the job script
class to be simplified, as module imports no longer need to avoid loops.
This should make it easier to queue and maintain jobs.

* Use SyncDataSourceJob for management command

Instead of maintaining two separate job execution logics, the same job
is now used for both background and interactive execution.

* Implement BackgroundJob for running scripts

The independent implementations of interactive and background script
execution have been merged into a single BackgroundJob implementation.

* Fix documentation of model features

* Ensure consitent code style

* Introduce reusable ScheduledJob

A new abstract class can be used to implement job function classes that
specialize in scheduling. These use the same logic as regular
BackgroundJobs, but ensure that they are only scheduled once at any given
time.

* Introduce reusable SystemJob

A new abstract class can be used to implement job function classes that
specialize in system background tasks (e.g. synchronization or
housekeeping). In addition to the features of the BackgroundJob and
ScheduledJob classes, these implement additional logic to not need to be
bound to an existing NetBox object and to setup job schedules on plugin
load instead of an interactive request.

* Add documentation for jobs framework

* Revert "Use SyncDataSourceJob for management"

This partially reverts commit db591d4. The 'run_now' parameter of
'enqueue()' remains, as its being used by following commits.

* Merge enqueued status into JobStatusChoices

* Fix logger for ScriptJob

* Remove job name for scripts

Because scripts are already linked through the Job Instance field, the
name is displayed twice. Removing this reduces redundancy and opens up
the possibility of simplifying the BackgroundJob framework in future
commits.

* Merge ScheduledJob into BackgroundJob

Instead of using separate classes, the logic of ScheduledJob is now
merged into the generic BackgroundJob class. This allows reusing the
same logic, but dynamically deciding whether to enqueue the same job
once or multiple times.

* Add name attribute for BackgroundJob

Instead of defining individual names on enqueue, BackgroundJob classes
can now set a job name in their meta class. This is equivalent to other
Django classes and NetBox scripts.

* Drop enqueue_sync_job() method from DataSource

* Import ScriptJob directly

* Relax requirement for Jobs to reference a specific object

* Rename 'run_now' arg on Job.enqueue() to 'immediate'

* Fix queue lookup in Job enqueue

* Collapse SystemJob into BackgroundJob

* Remove legacy JobResultStatusChoices

ChoiceSet was moved to core in 40572b5.

* Use queue 'low' for system jobs by default

System jobs usually perform low-priority background tasks and therefore
can use a different queue than 'default', which is used for regular jobs
related to specific objects.

* Add test cases for BackgroundJob handling

* Fix enqueue interval jobs

As the job's name is set by enqueue(), it must not be passed in handle()
to avoid duplicate kwargs with the same name.

* Honor schedule_at for job's enqueue_once

Not only can a job's interval change, but so can the time at which it is
scheduled to run. If a specific scheduled time is set, it will also be
checked against the current job schedule. If there are any changes, the
job is rescheduled with the new time.

* Switch BackgroundJob to regular methods

Instead of using a class method for run(), a regular method is used for
this purpose. This gives the possibility to add more convenience methods
in the future, e.g. for interacting with the job object or for logging,
as implemented for scripts.

* Fix background tasks documentation

* Test enqueue in combination with enqueue_once

* Rename background jobs to tasks (to differentiate from RQ)

* Touch up docs

* Revert "Use queue 'low' for system jobs by default"

This reverts commit b17b2050df.

* Remove system background job

This commit reverts commits 4880d81 and 0b15ecf. Using the database
'connection_created' signal for job registration feels a little wrong at
this point, as it would trigger registration very often. However, the
background job framework is prepared for this use case and can be used
by plugins once the auto-registration of jobs is solved.

* Fix runscript management command

Defining names for background jobs was disabled with fb75389. The
preceeding changes in 257976d did forget the management command.

* Use regular imports for ScriptJob

* Rename BackgroundJob to JobRunner

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2024-07-30 13:31:21 -04:00
Jeff Gehlbach
b3fbcb3afc Small additions and tweaks to release checklist from releasing v4.0.7 2024-07-26 16:20:46 -04:00
Jeff Gehlbach
bf97138c78 Small additions and tweaks to release checklist from releasing v4.0.7 2024-07-10 08:45:36 -04:00
Jeff Gehlbach
33004dfab0 Added missing CDN cache clearing step to release checklist in docs 2024-06-25 16:21:32 -04:00
Jeremy Stretch
83da49cfa3 Update release checklist to include building public docs 2024-06-12 12:28:27 -04:00
Jeremy Stretch
418389c577 Update translations workflow documentation 2024-05-29 09:14:02 -04:00
Jeremy Stretch
d847f02434 Correct link 2024-05-09 15:39:48 -04:00
Arthur Hanson
56ea7b8714
16014 Update incorrect django-graphene reference and add link to filtering docs. (#16015)
* 16014 change ref from django-graphene to django-strawberry

* 16014 add references to filtering syntax

* 16014 remove graphene reference

* 16014 remove graphene reference

* Remove obsolete reference to Graphene

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2024-05-08 14:29:54 -04:00
Jeremy Stretch
d824e90e0a Extend release checklist to include updating UI resources 2024-05-02 17:07:41 -04:00
Jeremy Stretch
6530051958 Closes #15630: Remove server-side color mode preference & simplify toggling 2024-05-01 18:59:42 -04:00
Jeremy Stretch
89150f4b27 Add form rendering utilities to plugins dev docs 2024-03-19 13:34:13 -04:00
Jeremy Stretch
74e67afa41 Merge branch 'develop' into feature 2024-02-05 14:38:26 -05:00
Jeremy Stretch
edc2e3809d Closes #14765: Add developer documentation for updating translations 2024-01-10 14:03:25 -05:00
Jeremy Stretch
7bedf48a97 Closes #14638: Drop support for Python 3.8 and 3.9 2024-01-03 13:33:00 -05:00
Jeremy Stretch
b532435a6d
Closes #14436: Add indexes for all GenericForeignKey fields (#14463)
* Closes #14436: Add PostgreSQL indexes for all GenericForeignKeys

* Add note about GFK indexes to developer docs
2023-12-07 14:02:51 -05:00
Jeremy Stretch
5b0b366b82 #9816: Promote IKE & IPSec proposals and policies to primary models 2023-12-04 09:28:29 -05:00
Jeremy Stretch
2ed261e9c2 Update developer model docs 2023-12-01 08:47:31 -05:00
Jeremy Stretch
4fc0a999ea
Closes #14365: Introduce job_start and job_end signals (#14393)
* Introduce job_start and job_end signals, and receivers to process event rules

* Complete signals documentation
2023-11-30 19:36:41 -05:00
Arthur Hanson
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
Jeremy Stretch
e767fec5cc
Closes #14173: Enable plugins to register columns on core tables (#14265)
* Closes #14173: Enable plugins to register columns on core tables

* Support translation for column name

* Document new registry store
2023-11-16 12:16:35 -05:00
Jeremy Stretch
3d20276f55
Closes #14134: Display additional object attributes in global search results (#14154)
* WIP

* Add display_attrs for all indexers

* Linkify object attributes

* Clean up prefetch logic

* Use tooltips for display attributes

* Simplify template code

* Introduce get_indexer() utility function

* Add  to examples in docs

* Use tooltips to display long strings
2023-11-09 16:21:09 -05:00
Jeremy Stretch
8dcbd66de6
Closes #13427: Public model registration (#14152)
* Initial work on #13427

* Clarify documentation

* Reference public models registry when populating models for ConfigTemplate context
2023-11-03 10:32:59 -04:00
Jeremy Stretch
39cb9c32d6 Clean up blocktrans template tags (i18n) 2023-09-11 16:17:02 -04:00
Jeremy Stretch
44f8a777df Merge branch 'develop' into feature 2023-08-15 11:04:03 -04:00
Arthur Hanson
8593715149
13319 add documentation for internationalization (#13330)
* 13319 add documentation for internationalization

* 13319 add verbose name to model

* 13319 fix typo

* Flesh out developer doc for i18n

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2023-08-11 11:27:48 -04:00
Daniel W. Anner
40afe6cf36
Feature - Schema Generation (#13353)
* Schema generation is working

* Added option to either dump to a file or the console

* Moving schema file and utilizing settings definition for file paths

* Cleaning up the imports and fixing a few pythonic issues

* Tweak command flags

* Clean up choices mapping

* Misc cleanup

* Rename & move template file

* Move management command from extras to dcim

* Update release checklist

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2023-08-11 11:00:26 -04:00
Jeremy Stretch
914588f55d Merge branch 'develop' into feature 2023-08-09 15:31:21 -04:00
Jeremy Stretch
7f22c6bf12 Include notes re: demo data and netbox-docker 2023-08-04 10:12:15 -04:00
Arthur Hanson
149a496011
6347 Cache the number of each component type assigned to devices/VMs (#12632)
---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2023-07-25 09:39:05 -04:00
jeremystretch
2c756873aa Fix broken links 2023-05-04 08:43:17 -04:00
Daniel Sheppard
9d709c84e7
Closes: #9047 - Add Provider Accounts (#12057)
* #9047 - ProviderAccount

* #9047 - Move to new selector types

* #9047 - Re-introduce provider FK to Circuit model

* #9047 - Fix broken tests

* Misc cleanup

* Revert errant change

* Fix tests

* Update circuit filter form

---------

Co-authored-by: jeremystretch <jstretch@netboxlabs.com>
2023-03-29 08:27:11 -04:00
jeremystretch
40572b543f Rename JobResult to Job and move to core 2023-03-27 14:20:13 -04:00
jeremystretch
574b5551a0 Clean up model & registry documentation 2023-02-19 20:09:52 -05:00
jeremystretch
3f28d6aef3 Add step for creating search index 2023-02-07 16:55:50 -05:00
jeremystretch
216d8d24b8 Add note to update model's SearchIndex 2022-11-16 16:40:01 -05:00
jeremystretch
4230162294 Add missing model documentation 2022-11-15 10:50:26 -05:00
Jeremy Stretch
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
jeremystretch
00d2dcda68 Refactor navigation resources and menu 2022-09-28 15:56:09 -04:00
jeremystretch
73b85f9b29 Minor tweaks to git cheat sheet 2022-08-31 15:44:06 -04:00
jeremystretch
301ebe0da3 Add content to the git cheat sheet 2022-08-31 10:52:58 -04:00
jeremystretch
f98f1647da Add "fixing mistakes" section 2022-08-29 15:40:39 -04:00
jeremystretch
152dcbe522 Initial draft of git cheat sheet 2022-08-26 16:52:00 -04:00
jeremystretch
61ba5817c9 Add branch naming standard to developer docs 2022-08-25 15:03:16 -04:00
Arthur Hanson
ec2e8ad184
#10139 update development documents for githooks and web-ui (#10141)
* #10139 update development documents for githooks and web-ui

* Remove redudant phrase

Co-authored-by: Jeremy Stretch <jstretch@ns1.com>
2022-08-25 08:21:55 -04:00
jeremystretch
9059c09627 Refresh development docs 2022-08-18 13:40:44 -04:00