fix(warnings): scope registry diagnostics to the current generation - #400
Merged
Conversation
Registry diagnostics (discovery/empty/duplicate-operation) accumulated on the process-wide singleton and persisted until clear(), so a resolved DUPLICATE_OPERATION collision still surfaced on the next generation. Reset the duplicate-operation channel at the top of generate_openapi_spec (it is fully recomputed each pass), and add OpenAPIRegistry.clear_diagnostics / clear_duplicate_operations helpers (clear() now reuses clear_diagnostics). Discovery/empty channels remain scan-lifetime and are left untouched so the current run's scan warnings are not wiped before collection. Closes #393
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
clear(), so a resolvedDUPLICATE_OPERATIONcollision still surfaced on the next generation.generate_openapi_spec(it is fully recomputed on every pass); fixed collisions no longer resurface, real ones are re-added.OpenAPIRegistry.clear_diagnostics()/clear_duplicate_operations()helpers;clear()now reusesclear_diagnostics().Verification
make check-allgreen (coverage ≥95%).test_resolved_collision_not_carried_to_next_generationreproduces the staleDUPLICATE_OPERATIONacross two generations against the same registry and asserts it is gone.Design note
Cross-verified the lifetime model with Oracle. The concrete, verifiable staleness bug is generation-scoped (
DUPLICATE_OPERATION); the injected--isolate-appregistry path uses the sameregistry if registry is not None else _default_registryresolution, so isolated registries clear their own channel with no cross-contamination.Closes #393