Skip to content

Enable the dynamic registration of context managers for request processing (i.e. event_tracking()) #18211

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

Closed
jeremystretch opened this issue Dec 11, 2024 · 0 comments · Fixed by #18212
Assignees
Labels
complexity: medium Requires a substantial but not unusual amount of 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

N/A

Proposed functionality

NetBox currently employs its event_tracking() context manager to process events triggered by a request, e.g. for change change logging. This function is invoked explicitly by the CoreMiddleware class.

Instead of calling this function directly, we can register it within NetBox's application registry, and consult the registry for all registered request processors whenever necessary, including within the middleware as well as for other purposes (such as running a background job).

Use case

This approach will enable to us to dynamically register additional request processors, such as those which may be introduced by plugins, without the need for explicit configuration. #18136 raises one such use case.

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: medium Requires a substantial but not unusual amount of effort to implement labels Dec 11, 2024
@jeremystretch jeremystretch self-assigned this Dec 11, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 13, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
complexity: medium Requires a substantial but not unusual amount of effort to implement status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant