{{ message }}
refactor: drop unused abc.ABC from BaseInstrument; document config holders#100
Merged
Conversation
…lders REF-3: BaseInstrument inherited from abc.ABC but defined no abstract methods. After PR7 made the class generic and removed the # noqa: B027 suppressions, abc.ABC serves no purpose — all four methods (bootstrap, teardown, is_ready, check_dependencies) are concrete no-ops with sensible defaults. Drop the abc.ABC parent and the now- unused `import abc`. BaseBootstrapper still uses abc.ABC (it has real abstract methods: not_ready_message, _prepare_application, is_ready) and is unchanged. REF-5: Add one-line module docstrings to swagger_instrument.py and prometheus_instrument.py explaining that these files hold config and minimal base logic; framework-specific bootstrap behavior lives in the bootstrapper subclasses (FastAPISwaggerInstrument, etc.). These files were left as separate modules per the locked decision in the deferred-refactors sequencing spec. No behavior change. Closes REF-3 and REF-5 from the audit.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Two small base-layer cleanups:
BaseInstrumentinherited fromabc.ABCbut defined no abstract methods. After PR7 made the class generic and removed the# noqa: B027suppressions,abc.ABCserved no purpose — all four methods (bootstrap,teardown,is_ready,check_dependencies) are concrete no-ops with sensible defaults. Drop theabc.ABCparent and the now-unusedimport abc.BaseBootstrapperstill usesabc.ABC(it has real abstract methods:not_ready_message,_prepare_application,is_ready) and is intentionally unchanged.swagger_instrument.pyandprometheus_instrument.pyexplaining that these files hold config and minimal base logic; framework-specific bootstrap behavior lives in the bootstrapper subclasses. Kept as separate modules per the locked decision in the deferred-refactors sequencing spec.No behavior change. 5 insertions / 2 deletions.
Closes REF-3 and REF-5 from an internal audit.
Test plan
just test— 128/128.just lint— clean.isinstance(..., abc.ABC)check anywhere in the codebase relies onBaseInstrument's former ABC parent.🤖 Generated with Claude Code