Skip to content

Conversation

@califlower
Copy link
Contributor

Fixes a regression in the bundling behavior for circular refs with inline bundling where it wouldn't properly skip over recursive refs. Brings it closer to the original behavior.

More details in #508

Fixes #508

@codecov
Copy link

codecov bot commented Jan 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.53%. Comparing base (91fc80f) to head (b28b5cc).
⚠️ Report is 15 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #510   +/-   ##
=======================================
  Coverage   99.52%   99.53%           
=======================================
  Files         191      191           
  Lines       23466    23478   +12     
=======================================
+ Hits        23354    23368   +14     
+ Misses         69       68    -1     
+ Partials       43       42    -1     
Flag Coverage Δ
unittests 99.53% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@califlower
Copy link
Contributor Author

also fixes an issue with panics in certain ref configurations

@daveshanley
Copy link
Member

two missing lines, you can do it!

@califlower
Copy link
Contributor Author

ahhhh! okay working on it!

califlower and others added 5 commits February 3, 2026 12:55
- Check root index for external schemas (idx != rootIdx)
- Use SplitRefFragment for proper ref comparison
- Handle both fragment and file-based circular refs
- Add regression tests for both ref types
- Preserves v0.25 behavior for local circular refs
Previously, we only checked circular refs for external schemas (idx != rootIdx),
allowing local circular schemas to be partially inlined. This caused redundancy
where schemas appeared both partially inlined at usage sites AND in components.

Now we check circular refs for ALL schemas consistently, preventing partial
inlining and keeping refs clean. This produces minimal output changes (hash
updates only) while fixing the redundancy issue.

Co-Authored-By: Claude <noreply@anthropic.com>
Remove unnecessary goto label and complex nil checks. Circular reference
checking now uses simpler flow control while maintaining the same behavior:
all schemas (local and external) are checked for circular references.

- Remove goto/label construct
- Simplify rolodex nil handling
- Restore upstream code style (nope comments, double parens)
- Revert test expectations to match upstream
Re-add the HTTP URL parsing logic that handles circular references
in remotely loaded specs. This was inadvertently removed but is
necessary for detecting circular refs when remote specs reference
each other with relative paths.

Keeps the SplitRefFragment logic added to fix external circular refs.
The error from PathItem.MarshalYAMLInline() was being discarded,
causing a nil pointer panic when external path item references
with local component refs failed to render.

Properly propagate the error and handle nil rendered values.
…ror handling

- Remove unreachable nil check (NodeBuilder.Render never returns nil)
- Add test for error path when PathItem inline rendering fails
- Achieves 100% coverage for MarshalYAMLInline
@califlower
Copy link
Contributor Author

califlower commented Feb 3, 2026

@daveshanley Fixed the coverage. I don't believe that the rendered variable can be nil so I removed it the check. I think it was just the missing error handler

@daveshanley
Copy link
Member

@daveshanley Fixed the coverage. I don't believe that the rendered variable can be nil so I removed it the check. I think it was just the missing error handler

Lovely!

@daveshanley daveshanley merged commit 5656083 into pb33f:main Feb 3, 2026
4 checks passed
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.

Bundler breaks external schemas with self-references

2 participants