You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Stop fact walks at mapped refs in one ref-follow step - #6775
Improved handling of schema references during validation and generation, including consistent cycle detection and more reliable traversal of nested references.
Auto incremental reviews are disabled on this repository.
Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
The change centralizes $ref target lookup, external-reference filtering, and visited-target tracking in _schema_refs. Schema validators and other parser traversals now use those helpers. Union-tag traversal uses immutable visited-target sets.
_schema_refs now exports helpers for unmapped reference lookup and visited-target tracking. The duplicate unvisited_ref_target helper is removed from _lightweight_types.
This is a refactor that consolidates reference lookup and cycle tracking. No actionable merge-blocking risk is evident from the supplied context.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title "Stop fact walks at mapped refs in one ref-follow step" is specific and matches the changeset. The summaries show that unmapped_ref_target in _schema_refs.py now returns None for externally …
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title "Stop fact walks at mapped refs in one ref-follow step" is specific and matches the changeset. The summaries show that unmapped_ref_target in _schema_refs.py now returns None for externally mapped references, and that the callers in _schema_validators.py, _union_tags.py, and jsonschema.py route reference resolution through it. The title names the main behavior change: mapped references stop the walk in a single step. The title uses terms from the commit message and does not describe unrelated work. Some terms, such as "fact walks" and "ref-follow step", are internal jargon, so a reader outside the parser code may need the description to follow it.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
Reasoning: This PR is an internal refactor of private parser modules. The helper unvisited_ref_target moves from the private _lightweight_types module to the private _schema_refs module. The unmapped_ref_target helper moves from _schema_validators to _schema_refs. Inline code that checked external ref mappings and visited nodes in _schema_validators, _union_tags and jsonschema is replaced with calls to the shared unmapped_ref_target helper, which keeps the same order of checks: a mapped ref is skipped, a visited node is skipped, otherwise the target is loaded. The seen_refs parameters of private union tag helpers and of the private _get_single_literal_value method change from an optional mutable set to a frozenset. All affected names are in underscore-prefixed modules or are private methods, and the analysis context lists no public Python names, CLI options, presets or experimental features affected. The behaviour diff gate reports only both-fail cells, with no accepted or violation cells, so default generated output is unchanged. There are no changes to templates, Python version support or error reporting.
This analysis was produced by the release draft workflow
This PR is now available in the latest release. See the release notes for details.
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
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 by CodeRabbit