Commit Graph

42 Commits

Author SHA1 Message Date
quobix
55a2065f8d bump coverage
removed dead code after abs path change on lookup

Signed-off-by: quobix <dave@quobix.com>
2024-01-18 15:11:39 -05:00
quobix
7026e83f7c adding in path overlap feature
discovered glitch when reworking test for pipeline

Signed-off-by: quobix <dave@quobix.com>
2024-01-18 15:11:39 -05:00
quobix
e699968768 Working through windows support 2024-01-18 15:11:39 -05:00
quobix
f4647af7b4 Added switch to resolver for preventing duplication.
vacuum runs things multiple times. which is causing skew on references.

Signed-off-by: quobix <dave@quobix.com>
2024-01-13 10:21:21 -05:00
quobix
9467282849 Added edge case to circular detection.
When a polymorphic type is used, that isn’t a ref, but contains a ref, is now picked up. Thank you vercel for this edge case. Please build better specs.

Signed-off-by: quobix <dave@quobix.com>
2024-01-04 17:08:08 -05:00
Tristan Cartledge
8b6a5ef486 fix: increase resolver max depth 2023-12-06 08:35:55 +00:00
quobix
1b079afad9 removed dead code.
Signed-off-by: quobix <dave@quobix.com>
2023-12-04 16:13:13 -05:00
quobix
909646cff1 removed debug code.
Signed-off-by: quobix <dave@quobix.com>

Move original ref resolving to end of resolving run

this prevents mid-recursion shifting of nodes.

Signed-off-by: quobix <dave@quobix.com>
2023-12-04 16:13:13 -05:00
quobix
bb41dd41a3 Fix resolver from getting muddled up with deeply recursive resolving
speakeasy have some crazy recursive tests. It highlighted an issue with nested resolving intriduced in 0.13.7 of libopenapi to resolve issue #195

This in fact created another bug that only shows up with deeply nested refs, the problem is that the resolver was stitching together references, whilst still burrowing, which means it lots it’s place when jumping around everywhere.

Signed-off-by: quobix <dave@quobix.com>
2023-12-04 16:13:13 -05:00
quobix
7a5a4bcb2d Tuned circular reference handling
stopped rolodex looking up root file, looking in components schemas for a reference also. Dropped stripe circular refs down by one. seems to be catching the duplicate now.

Signed-off-by: quobix <dave@quobix.com>
2023-12-03 15:54:20 -05:00
quobix
1e9b42a1ce catching circular references that spin out of control
This builds on the last patch, by also catching the issue in the resolver and then allowing it to bubble up to applications.
no new fixes, no new featuers, just better integration so vacuum can report the issues.

Signed-off-by: quobix <dave@quobix.com>
2023-12-03 11:06:43 -05:00
quobix
afe5c1213b Added a safety check to resolver
If the number of relatives exceeds 500  deep when resolving, libopenapi will now log a warning and escape that path from continuing. There is no reason on earth for a depth this large. It most likely indicates a circular reference that was ignored and then resolved.

Signed-off-by: quobix <dave@quobix.com>
2023-12-03 09:23:18 -05:00
quobix
190330ca9b Added in fix for stackoverflow issue
discovered while running tests, vacuum explodes with the new stripe spec. It’s a `FullDefintion` vs `Definition` misfire.

Signed-off-by: quobix <dave@quobix.com>
2023-11-30 12:59:59 -05:00
quobix
f8154c5db2 added logic to handle variations of reference lookup for resolver
Signed-off-by: quobix <dave@quobix.com>
2023-11-30 07:20:19 -05:00
quobix
e624efbf84 addressed issue #195
Resolving and indexing has changed, new code is required and this isue highlighted a glitch introduced with the addition of the rolodex when resolving.

Signed-off-by: quobix <dave@quobix.com>
2023-11-08 12:36:08 -05:00
quobix
242d41cd0d Fixed loopup for branch, only ever extracting the fulldef path, not the fragment.
Signed-off-by: quobix <dave@quobix.com>
2023-11-07 11:29:24 -05:00
quobix
54450edf6c Adding convenience methods and glitch fixes for 0.13
Testing inside vacuum is throwing up a couple of small glicthes that need adding/tuning

Signed-off-by: quobix <dave@quobix.com>
2023-11-04 16:22:48 -04:00
quobix
265d462a10 Added back in logic required by vacuum.
And added test for it.

Signed-off-by: quobix <dave@quobix.com>
2023-11-04 12:36:47 -04:00
quobix
9b92a55536 Added in full resolving for specs is virtual filesystems
added last remaining coverage

Signed-off-by: quobix <dave@quobix.com>
2023-11-04 11:28:22 -04:00
quobix
7d8762fdd9 added more coverage and resolved param ref issue
Signed-off-by: quobix <dave@quobix.com>
2023-11-03 18:25:27 -04:00
quobix
fde5a9972d tuning ref lookups, finding some gaps.
coverage will drop no doubt

Signed-off-by: quobix <dave@quobix.com>
2023-11-03 14:06:37 -04:00
quobix
fa0b315756 Enabling deep array circular reference checking
Signed-off-by: quobix <dave@quobix.com>
2023-11-03 09:49:02 -04:00
quobix
713aeecdfa Tuning parameter exraction for circular ref handling
Lots and lots of variations. means lots of branches to check.

Signed-off-by: quobix <dave@quobix.com>
2023-11-02 15:04:47 -04:00
quobix
8bbb022daa Addressed comments from review and fixed bug with schema props
props did not have context, therefore they had no idea where they were or where to resolve from.

Signed-off-by: quobix <dave@quobix.com>
2023-11-02 10:28:29 -04:00
quobix
80b2b2d0b5 More cleaning and added docs.
We’re ready for review

Signed-off-by: quobix <dave@quobix.com>
2023-11-01 16:14:11 -04:00
quobix
ce4a60baa8 cleaning up the last few stragglers
Signed-off-by: quobix <dave@quobix.com>
2023-11-01 15:15:46 -04:00
quobix
ba8b5ac776 more coverage tuning
Signed-off-by: quobix <dave@quobix.com>
2023-10-30 15:50:33 -04:00
quobix
0cc66982f6 Adding more logic to resolver to handle mixed usecases
Signed-off-by: quobix <dave@quobix.com>
2023-10-30 15:02:00 -04:00
quobix
aca3ed66d7 Adding more use-cases for resolving remote docs
Signed-off-by: quobix <dave@quobix.com>
2023-10-30 10:43:51 -04:00
quobix
d8dfafd0a4 Working through test cases
There are still gaps to be found based on various combinations of crazy references.

Signed-off-by: quobix <dave@quobix.com>
2023-10-30 10:03:02 -04:00
quobix
a87d9236d8 bumping test coverage
more to go, more cleaning inbound also

Signed-off-by: quobix <dave@quobix.com>
2023-10-25 08:09:33 -04:00
quobix
8717b3cd33 An enormous amount of surgery on the low level model.
Every `Build()` method now requires a `context.Context`. This is so the rolodex knows where to resolve from when locating relative links. Without knowing where we are, there is no way to resolve anything. This new mechanism allows the model to recurse across as many files as required to locate references, without loosing track of where we are in the process.

Signed-off-by: quobix <dave@quobix.com>
2023-10-23 15:04:34 -04:00
quobix
28047d08d2 First sweep at cleaning up dead code
first round of a number I am sure, lots to clean.

Signed-off-by: quobix <dave@quobix.com>
2023-10-21 18:26:21 -04:00
quobix
be7e477529 index tests all pass! now time to clean.
Signed-off-by: quobix <dave@quobix.com>
2023-10-21 17:29:53 -04:00
quobix
bf270d3d2b whacking the shit out of exploded use-cases
Before everything worked, but was completely accurate, now everything works and everything is absolute and can be resolved. Phew, what a mission!

Signed-off-by: quobix <dave@quobix.com>
2023-10-21 14:14:49 -04:00
quobix
afe89454ac More fine tuning, handling resolving and edge cases now.
Signed-off-by: quobix <dave@quobix.com>
2023-10-20 17:50:51 -04:00
quobix
48c83ddb30 resolver tests all operational
time to start some cleanup.

Signed-off-by: quobix <dave@quobix.com>
2023-10-18 12:01:06 -04:00
quobix
51971762a9 Another massive surgical strike with the rolodex and index reshuffle.
Signed-off-by: quobix <dave@quobix.com>
2023-10-18 09:29:26 -04:00
quobix
cea7bb0cc8 chopping through index changes, basic design works.
seems to be holding, more tests to change.

Signed-off-by: quobix <dave@quobix.com>
2023-10-16 14:56:58 -04:00
quobix
d5f72a2a2e a first working engine of the new design.
There is a horrible amount of work to be done to clean this up, and wire in remote support. but so far, this is working as expected and is now a much cleaner design, (once everything has been cleaned up that is)

Signed-off-by: quobix <dave@quobix.com>
2023-10-16 13:36:30 -04:00
quobix
8b795c6321 working through rolodex design and using it externally via vacuum
this is some complex and messy work.

Signed-off-by: quobix <dave@quobix.com>
2023-10-15 12:34:54 -04:00
quobix
511843e4df Major surgery on the index and resolver. A complete flip in design.
Signed-off-by: quobix <dave@quobix.com>
2023-10-14 12:36:38 -04:00