-
Notifications
You must be signed in to change notification settings - Fork 0
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
Correlation id utilities (GSI 501) #74
Conversation
Update pre-commit-config for black removal
Make tweaks for ruff format changes and mypy complaints
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks nice. Personally I'd fold the CorrelationIDContext and MissingContextID errors into one, don't see a reason to keep them separate if we don't necessarily need to distinguish between unset and empty ID.
Pull Request Test Coverage Report for Build 7099687386
💛 - Coveralls |
@mephenor I've consolidated the errors then. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just some suggestions regarding the testing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes.
This adds the correlation ID utilities as outlined in the Marabou Stork epic.
This PR only adds the utilities and does not modify the behavior of the Kafka providers (that will come next).
The new stuff:
Functions
get_correlation_id()
new_correlation_id()
set_correlation_id()
validate_correlation_id()
set_context_var()
Errors
CorrelationIdContextError
InvalidCorrelationIdError
MissingCorrelationIdError
I think
MissingCorrelationIdError
could be folded into theInvalidCorrelationIdError
as it's only used inset_correlation_id
to differentiate between an empty string vs an invalid non-empty string.Other
correlation_id_var
: The ContextVar instance that is used to store/access a correlation ID for a context.