Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply all registered request processors when running custom scripts #18224

Closed
jeremystretch opened this issue Dec 12, 2024 · 0 comments · Fixed by #18225
Closed

Apply all registered request processors when running custom scripts #18224

jeremystretch opened this issue Dec 12, 2024 · 0 comments · Fixed by #18225
Assignees
Labels
complexity: low Requires minimal effort to implement status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application

Comments

@jeremystretch
Copy link
Member

NetBox version

v4.1.8

Feature type

Change to existing functionality

Triage priority

I volunteer to perform this work (if approved)

Proposed functionality

When a custom script is run (as a background job), currently only the event_tracking request processor is employed:

# Execute the script. If commit is True, wrap it with the event_tracking context manager to ensure we process
# change logging, event rules, etc.
with event_tracking(request) if commit else nullcontext():
self.run_script(script, request, data, commit)

All registered request processors should be applied here, not just event_tracking.

Use case

FR #18211 recently introduced the ability to dynamically register request processors (a planned feature for the plugins API). This change will ensure that any additional registered processors are run when executing custom scripts as well as when servicing requests.

Database changes

N/A

External dependencies

N/A

@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application complexity: low Requires minimal effort to implement labels Dec 12, 2024
@jeremystretch jeremystretch self-assigned this Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
complexity: low Requires minimal effort to implement status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application
Projects
None yet
1 participant