[PR #12075] [MERGED] Closes #12068: Establish a direct relationship from jobs to objects #13902

Closed
opened 2025-12-29 23:21:27 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/12075
Author: @jeremystretch
Created: 3/28/2023
Status: Merged
Merged: 3/28/2023
Merged by: @jeremystretch

Base: featureHead: 12068-job-objects


📝 Commits (9)

  • ccb09b0 Reference database object by GFK when running scripts & reports via UI
  • 69fd138 Reference database object by GFK when running scripts & reports via API
  • d752d66 Remove old enqueue_job() method
  • 6861db2 Enable filtering jobs by object
  • 431b21b Introduce ObjectJobsView
  • e3cd40e Add tabbed views for report & script jobs
  • d1ec7ac Add object_id to JobSerializer
  • 4449003 Move generic relation to JobsMixin
  • c107931 Clean up old naming

📊 Changes

33 files changed (+583 additions, -353 deletions)

View changed files

📝 netbox/core/api/serializers.py (+2 -2)
📝 netbox/core/filtersets.py (+1 -1)
📝 netbox/core/jobs.py (+5 -6)
📝 netbox/core/models/data.py (+6 -8)
📝 netbox/core/models/jobs.py (+24 -22)
📝 netbox/core/tables/jobs.py (+9 -4)
📝 netbox/core/views.py (+2 -2)
📝 netbox/extras/api/views.py (+33 -29)
📝 netbox/extras/management/commands/runreport.py (+3 -6)
📝 netbox/extras/management/commands/runscript.py (+20 -23)
📝 netbox/extras/models/reports.py (+3 -2)
📝 netbox/extras/models/scripts.py (+3 -2)
📝 netbox/extras/reports.py (+31 -27)
📝 netbox/extras/scripts.py (+27 -28)
📝 netbox/extras/tests/test_api.py (+20 -6)
📝 netbox/extras/urls.py (+5 -2)
📝 netbox/extras/views.py (+118 -38)
📝 netbox/netbox/models/features.py (+12 -0)
📝 netbox/netbox/views/generic/feature_views.py (+56 -0)
netbox/templates/core/object_jobs.html (+15 -0)

...and 13 more files

📄 Description

Closes: #12068

  • Establish a GFK relationship on Job (object_type, object_id)
  • Rewrite the enqueue_job() method (now enqueue()) to use instances
  • Rewrite report & script workflows to work with jobs assigned to module objects
  • Add "jobs" views for data sources, scripts, and reports

🔄 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/12075 **Author:** [@jeremystretch](https://github.com/jeremystretch) **Created:** 3/28/2023 **Status:** ✅ Merged **Merged:** 3/28/2023 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `feature` ← **Head:** `12068-job-objects` --- ### 📝 Commits (9) - [`ccb09b0`](https://github.com/netbox-community/netbox/commit/ccb09b0f7b38ad5e474cebc47d60478e83454a33) Reference database object by GFK when running scripts & reports via UI - [`69fd138`](https://github.com/netbox-community/netbox/commit/69fd1385334144f6939503bc11e35e0e1e1e2947) Reference database object by GFK when running scripts & reports via API - [`d752d66`](https://github.com/netbox-community/netbox/commit/d752d664f3e23992b6166f2315b1f60a9bb49cd1) Remove old enqueue_job() method - [`6861db2`](https://github.com/netbox-community/netbox/commit/6861db28857b8d083dcefbe41d6e05365efc0332) Enable filtering jobs by object - [`431b21b`](https://github.com/netbox-community/netbox/commit/431b21b5fe53edda53acfb99daec2882c4ec9ee8) Introduce ObjectJobsView - [`e3cd40e`](https://github.com/netbox-community/netbox/commit/e3cd40e95f45864f320a095e774cef5307a5589a) Add tabbed views for report & script jobs - [`d1ec7ac`](https://github.com/netbox-community/netbox/commit/d1ec7ac19a865aace277bec9db3824492fe7f650) Add object_id to JobSerializer - [`4449003`](https://github.com/netbox-community/netbox/commit/4449003b5902bc4e23cc6bc896668483e8615d0b) Move generic relation to JobsMixin - [`c107931`](https://github.com/netbox-community/netbox/commit/c10793176f18a8daf1a49f76128ed760200ea159) Clean up old naming ### 📊 Changes **33 files changed** (+583 additions, -353 deletions) <details> <summary>View changed files</summary> 📝 `netbox/core/api/serializers.py` (+2 -2) 📝 `netbox/core/filtersets.py` (+1 -1) 📝 `netbox/core/jobs.py` (+5 -6) 📝 `netbox/core/models/data.py` (+6 -8) 📝 `netbox/core/models/jobs.py` (+24 -22) 📝 `netbox/core/tables/jobs.py` (+9 -4) 📝 `netbox/core/views.py` (+2 -2) 📝 `netbox/extras/api/views.py` (+33 -29) 📝 `netbox/extras/management/commands/runreport.py` (+3 -6) 📝 `netbox/extras/management/commands/runscript.py` (+20 -23) 📝 `netbox/extras/models/reports.py` (+3 -2) 📝 `netbox/extras/models/scripts.py` (+3 -2) 📝 `netbox/extras/reports.py` (+31 -27) 📝 `netbox/extras/scripts.py` (+27 -28) 📝 `netbox/extras/tests/test_api.py` (+20 -6) 📝 `netbox/extras/urls.py` (+5 -2) 📝 `netbox/extras/views.py` (+118 -38) 📝 `netbox/netbox/models/features.py` (+12 -0) 📝 `netbox/netbox/views/generic/feature_views.py` (+56 -0) ➕ `netbox/templates/core/object_jobs.html` (+15 -0) _...and 13 more files_ </details> ### 📄 Description ### Closes: #12068 - Establish a GFK relationship on Job (`object_type`, `object_id`) - Rewrite the `enqueue_job()` method (now `enqueue()`) to use instances - Rewrite report & script workflows to work with jobs assigned to module objects - Add "jobs" views for data sources, scripts, and reports --- <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-29 23:21:27 +01:00
adam closed this issue 2025-12-29 23:21:27 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#13902