Commit Graph

13249 Commits

Author SHA1 Message Date
Jeremy Stretch
c51e91dddd Closes #17048: Replace all calls to get_user_model() with direct imports of User 2024-08-01 08:17:51 -04:00
Arthur Hanson
1a6406632a For #12826 add tests to RackTest filtersets for manufacturer and DeviceType 2024-08-01 13:59:20 +07:00
Arthur Hanson
77d0e9032a fix internationalization for string 2024-08-01 13:12:58 +07:00
Jeremy Stretch
28b867bde4 Documentation updates for v4.1 2024-07-31 16:26:21 -04:00
Jeremy Stretch
a49a74236b #16886: Misc cleanup 2024-07-31 16:02:20 -04:00
Jeremy Stretch
6e59db7310 #16886: Updated documentation for event types 2024-07-31 15:54:31 -04:00
Jeremy Stretch
d1e16013f0 #16886: Rename Event to EventType 2024-07-31 15:39:05 -04:00
Jeremy Stretch
5cfa2bb561 #15621: Add feature documentation for user notifications 2024-07-31 15:11:40 -04:00
Jeremy Stretch
2168a73a2d Display manufacturer & model of module type on module view 2024-07-31 14:40:05 -04:00
Jeremy Stretch
8d585031d8 Misc cleanup 2024-07-31 14:06:35 -04:00
Jeremy Stretch
da7d47d3ed Add manufacturer filter for Rack; extend RackFilterForm 2024-07-31 14:06:07 -04:00
Jeremy Stretch
047d717532 Add missing table columns 2024-07-31 14:04:51 -04:00
Jeremy Stretch
52692d49b6 #9627: Fix calculation of available VIDs 2024-07-31 12:28:19 -04:00
Arthur Hanson
a3edc0472a
17032 Convert Virtual Disk Size from GB -> MB (#17033)
* 17032 Convert Virtual Disk size from GB -> MB

* 17032 update migration

* 17032 update migration

* 17032 update migration

* 17032 update migration

* Omit redundant method

* Merge migrations

* Tweak column header

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2024-07-31 10:03:25 -04:00
Jeremy Stretch
954eadcdc5 #15908: Introduce FeatureSet dataclass for tracking release features 2024-07-30 16:39:46 -04:00
Jeremy Stretch
845888c24e #14731: Misc cleanup 2024-07-30 15:11:35 -04:00
Jeremy Stretch
a63bb6dba6 #8984: Tweak ordering of log levels; fix invalid level handling 2024-07-30 14:49:42 -04:00
Jeremy Stretch
5f87724072 #8198: Fix validation bug 2024-07-30 14:25:47 -04:00
Jeremy Stretch
dbd503bcc8 #7025: Misc cleanup 2024-07-30 13:50:42 -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
Jeremy Stretch
dde84b47da Flesh out v4.1 changelog 2024-07-29 20:58:29 -04:00
samk-acw
650898719e
Fixes #16782: Add object filtering for custom fields (#16994)
* Fixes #16782: Add object filtering for custom fields

* Add validation for related_object_filter

* Extend documentation & misc cleanup

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2024-07-29 15:45:48 -04:00
github-actions
f949aa334b Update source translation strings 2024-07-27 05:02:14 +00:00
Jeremy Stretch
a12fdd6e2d Merge branch 'develop' into feature 2024-07-26 16:39:58 -04:00
Jeremy Stretch
8bfcb1c816 PRVB 2024-07-26 16:25:32 -04:00
Jeremy Stretch
630c6fb43d Merge branch 'master' into develop 2024-07-26 16:24:55 -04:00
Jeremy Stretch
c8b4faefcb Update static assets 2024-07-26 16:20:46 -04:00
Jeremy Stretch
cbf84a6b95 Release v4.0.8 2024-07-26 16:20:46 -04:00
Jeremy Stretch
173c339993 Update import statements for Strawberry 0.236.0 2024-07-26 16:20:46 -04:00
transifex-integration[bot]
5ebdf7fc0f Updates for project NetBox (#17004)
* Translate django.po in de

100% translated source file: 'django.po'
on 'de'.

* Translate django.po in pt

100% translated source file: 'django.po'
on 'pt'.

* Translate django.po in zh

100% translated source file: 'django.po'
on 'zh'.

* Translate django.po in pl

100% translated source file: 'django.po'
on 'pl'.

* Translate django.po in ja

100% translated source file: 'django.po'
on 'ja'.

* Translate django.po in nl

100% translated source file: 'django.po'
on 'nl'.

* Translate django.po in cs

100% translated source file: 'django.po'
on 'cs'.

* Translate django.po in uk

100% translated source file: 'django.po'
on 'uk'.

---------

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2024-07-26 16:20:46 -04:00
Jonathan Senecal
0d30ab3462 Use provider_id instead of account_id in url_params 2024-07-26 16:20:46 -04:00
Jeremy Stretch
17ddbdd3b8 Changelog for #16933, #16943, #16964 2024-07-26 16:20:46 -04:00
Jeremy Stretch
cb59f6e6f7 Fixes #16964: Ensure configured password validators are enforced (#16990)
* Closes #16964: Validate password when creating a new user or updating password for an existing user

* Add serializer validation & tests

---------

Co-authored-by: Nishant Gaglani <nishantgaglani@gmail.com>
2024-07-26 16:20:46 -04:00
Jeremy Stretch
93cebae55c Remove jeffgdotorg from triage rotation 2024-07-26 16:20:46 -04:00
github-actions
2620d6067a Update source translation strings 2024-07-26 16:20:46 -04:00
Jeremy Stretch
3c9d173139 Closes #16933: Enable toggling true/false marks on BooleanColumn 2024-07-26 16:20:46 -04:00
Jeremy Stretch
181fe0a3cc Closes #16943: Expand navigation breadcrumbs on job view to include parent object 2024-07-26 16:20:46 -04:00
github-actions
70b2451209 Update source translation strings 2024-07-26 16:20:46 -04:00
Jeremy Stretch
dab07d653f Closes #16929: Add version & user details as data attributes (#16939)
* Closes #16929: Add version & user details as data attributes

* Fix typo
2024-07-26 16:20:46 -04:00
Benjamin Dale
8b2f9bf700 Update CONTRIBUTING.md
The GitHub reactions icon has been moved from the top right to the bottom left of messages in Issues - I was going insane trying to find it, so this might help someone in the future ; )
2024-07-26 16:20:46 -04:00
Jeremy Stretch
8f54724ac1 Changelog for #16402, #16536, #16624, #16819 2024-07-26 16:20:46 -04:00
Arthur Hanson
c9452db6cf 16819 highlight parent device in rack (#16881)
* 16819 highlight parent device in rack

* 16819 review changes
2024-07-26 16:20:46 -04:00
Eric Oswald
a9dadfd179 Fix incorrect import in rest-api.md 2024-07-26 16:20:46 -04:00
Thomas Fargeix
5019a67a61 Fixes 16536 - Fix filtering of device component by device role (#16553)
* Fixes 16536 - Fix filtering of device component by device role

Rename role and role_id fields to device_role and device_role_id in
DeviceComponentFilterSet

* Update tests for DeviceComponentFilterSet

* Use device_role filter name for DeviceComponentFilterSetTests

* Add test_device_role test in InventoryItemTestCase
2024-07-26 16:20:46 -04:00
Fabian Geisberger
95347cfd0f Fixes #16624: Set allow_null=True on method fields that can return None 2024-07-26 16:20:46 -04:00
Arthur Hanson
eb74393070 16402 remove links from script result table 2024-07-26 16:20:46 -04:00
github-actions
874677b359 Update source translation strings 2024-07-26 16:20:46 -04:00
Jeremy Stretch
3cde4da4a9 Changelog for #14640, #14792, #15660, #15696, #16793 2024-07-26 16:20:46 -04:00
transifex-integration[bot]
0b1b9caea4 Updates for project NetBox (#16888)
* Translate django.po in pt

100% reviewed source file: 'django.po'
on 'pt'.

* Translate django.po in es

100% translated source file: 'django.po'
on 'es'.

* Translate django.po in de

100% translated source file: 'django.po'
on 'de'.

* Translate django.po in fr

100% translated source file: 'django.po'
on 'fr'.

* Translate django.po in ru

100% translated source file: 'django.po'
on 'ru'.

* Translate django.po in ja

100% translated source file: 'django.po'
on 'ja'.

* Translate django.po in it

100% translated source file: 'django.po'
on 'it'.

* Translate django.po in cs

100% translated source file: 'django.po'
on 'cs'.

* Translate django.po in zh

100% translated source file: 'django.po'
on 'zh'.

* Translate django.po in nl

100% translated source file: 'django.po'
on 'nl'.

* Translate django.po in da

100% translated source file: 'django.po'
on 'da'.

* Translate django.po in uk

100% translated source file: 'django.po'
on 'uk'.

* Translate django.po in pl

100% translated source file: 'django.po'
on 'pl'.

* Translate django.po in tr

100% translated source file: 'django.po'
on 'tr'.

---------

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
2024-07-26 16:20:46 -04:00
Jeff Gehlbach
2969c4188c Added CS, DA, IT, NL, and PL, minus the .po and .mo starting point files (#16810)
* Added CS, DA, IT, NL, and PL, minus the .po and .mo starting point files

* Add initial PO files for new languages

* Revert updates to EN django.po

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2024-07-26 16:20:46 -04:00