[PR #17716] [MERGED] Closes #16971: Add system jobs #15172

Closed
opened 2025-12-30 00:20:24 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/17716
Author: @alehaa
Created: 10/9/2024
Status: Merged
Merged: 11/1/2024
Merged by: @jeremystretch

Base: featureHead: 16971-housekeeping


📝 Commits (10+)

  • 892c54f Fix check for existing jobs
  • 1f103ed Allow system jobs to be registered
  • ab3ac3c Test scheduling of system jobs
  • 39e5c0d Fix plugins scheduled job documentation
  • d7b03ee Allow plugins to register system jobs
  • 3e10d9a Rename system job metadata
  • 8a8c328 Add predefined job interval choices
  • d964b55 Remove 'system_enabled' JobRunner attribute
  • 49e0ea7 Merge branch 'feature' into 16971-housekeeping
  • 2bd45d3 Fix test

📊 Changes

10 files changed (+147 additions, -14 deletions)

View changed files

📝 docs/plugins/development/background-jobs.md (+41 -12)
📝 docs/plugins/development/data-backends.md (+1 -1)
📝 netbox/core/choices.py (+14 -0)
📝 netbox/core/management/commands/rqworker.py (+11 -0)
📝 netbox/netbox/jobs.py (+20 -1)
📝 netbox/netbox/registry.py (+1 -0)
📝 netbox/netbox/tests/dummy_plugin/__init__.py (+5 -0)
netbox/netbox/tests/dummy_plugin/jobs.py (+9 -0)
📝 netbox/netbox/tests/test_jobs.py (+36 -0)
📝 netbox/netbox/tests/test_plugins.py (+9 -0)

📄 Description

Fixes: #16971

This PR allows the NetBox core and plugins to register job runners as system jobs. These are automatically scheduled without UI interaction, just before the worker process starts. This allows job runners to be used for housekeeping and synchronization tasks in future commits.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/17716 **Author:** [@alehaa](https://github.com/alehaa) **Created:** 10/9/2024 **Status:** ✅ Merged **Merged:** 11/1/2024 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `feature` ← **Head:** `16971-housekeeping` --- ### 📝 Commits (10+) - [`892c54f`](https://github.com/netbox-community/netbox/commit/892c54f6b5ccc309cb54a37b8fe3cca659ef93d3) Fix check for existing jobs - [`1f103ed`](https://github.com/netbox-community/netbox/commit/1f103eddaccbbac0e05d001edafdfa21c5607d13) Allow system jobs to be registered - [`ab3ac3c`](https://github.com/netbox-community/netbox/commit/ab3ac3c12be9ce3463cd67055cec91cd0f272a1f) Test scheduling of system jobs - [`39e5c0d`](https://github.com/netbox-community/netbox/commit/39e5c0d24c700d251ecf5a49c2bcd068d09472b6) Fix plugins scheduled job documentation - [`d7b03ee`](https://github.com/netbox-community/netbox/commit/d7b03ee47e734a2bd61d5055494af83e4c9f8652) Allow plugins to register system jobs - [`3e10d9a`](https://github.com/netbox-community/netbox/commit/3e10d9a1da45963401962f45a21e142e888cc00f) Rename system job metadata - [`8a8c328`](https://github.com/netbox-community/netbox/commit/8a8c3287dfb611230a5779c202772ae9ebbd81eb) Add predefined job interval choices - [`d964b55`](https://github.com/netbox-community/netbox/commit/d964b5579ed170739136fbc41cd4d42245e2db2c) Remove 'system_enabled' JobRunner attribute - [`49e0ea7`](https://github.com/netbox-community/netbox/commit/49e0ea7347643d8c51609ce580f957d1de51798e) Merge branch 'feature' into 16971-housekeeping - [`2bd45d3`](https://github.com/netbox-community/netbox/commit/2bd45d334312d2a6dee114ebd9ace282c7b02719) Fix test ### 📊 Changes **10 files changed** (+147 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `docs/plugins/development/background-jobs.md` (+41 -12) 📝 `docs/plugins/development/data-backends.md` (+1 -1) 📝 `netbox/core/choices.py` (+14 -0) 📝 `netbox/core/management/commands/rqworker.py` (+11 -0) 📝 `netbox/netbox/jobs.py` (+20 -1) 📝 `netbox/netbox/registry.py` (+1 -0) 📝 `netbox/netbox/tests/dummy_plugin/__init__.py` (+5 -0) ➕ `netbox/netbox/tests/dummy_plugin/jobs.py` (+9 -0) 📝 `netbox/netbox/tests/test_jobs.py` (+36 -0) 📝 `netbox/netbox/tests/test_plugins.py` (+9 -0) </details> ### 📄 Description <!-- Thank you for your interest in contributing to NetBox! Please note that our contribution policy requires that a feature request or bug report be approved and assigned prior to opening a pull request. This helps avoid waste time and effort on a proposed change that we might not be able to accept. IF YOUR PULL REQUEST DOES NOT REFERENCE AN ISSUE WHICH HAS BEEN ASSIGNED TO YOU, IT WILL BE CLOSED AUTOMATICALLY. Please specify your assigned issue number on the line below. --> ### Fixes: #16971 <!-- Please include a summary of the proposed changes below. --> This PR allows the NetBox core and plugins to register job runners as system jobs. These are automatically scheduled without UI interaction, just before the worker process starts. This allows job runners to be used for housekeeping and synchronization tasks in future commits. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-30 00:20:24 +01:00
adam closed this issue 2025-12-30 00:20:24 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#15172