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

Support handlers that are disabled by their configuration. #339

Merged
merged 5 commits into from
Jul 16, 2024

Conversation

jmalloc
Copy link
Member

@jmalloc jmalloc commented Jul 9, 2024

What change does this introduce?

This PR changes the engine package to skip any disabled handlers by default.

Why make this change?

Further prototyping of the disabling feature before committing to add it to the dogma interfaces.

Is there anything you are unsure about?

  • testkit already has its own concept of enabling/disabling handlers. I've opted to disallow explicitly enabling a handler that has been disable in Configure() via the Test interface, but this is allowed via the lower-level interface of the engine package.

  • I am not sure what behavior EnableHandlersLike(pattern) should have if it matches a handler that has been explicitly disabled by its configuration. The options are:

    • panic
    • don't enable the handler even though it matches (EDIT: I chose this approach for now)
    • enable the handler anyway (not really a valid option, as it would almost certainly result in some other unexpected behavior)

Ultimately, I'd like to work towards removing the need to enable/disable individual handlers in tests, but I'm not sure that's really feasible.

What issues does this relate to?

Copy link
Member

@danilvpetrov danilvpetrov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good to me, except for a commitsh reference (as opposed to a proper tag) to dogma/dogma package in go.mod.

@jmalloc jmalloc marked this pull request as ready for review July 11, 2024 00:54
@jmalloc jmalloc merged commit 09bf56b into main Jul 16, 2024
3 checks passed
@jmalloc jmalloc deleted the handler-disable branch July 16, 2024 03:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants