Commit Graph

33 Commits

Author SHA1 Message Date
quobix
099d4b324a removed untestable code 2024-04-19 06:45:19 -04:00
quobix
fcc5355a9b Addressed issue #269
Regression undone
2024-04-19 06:45:19 -04:00
quobix
7119b51336 Cleaned up coverage
Signed-off-by: quobix <dave@quobix.com>
2024-02-20 13:34:39 -05:00
quobix
2f82a69d6c A clean sweep around resolving during model builds.
Really hammering on this model using all available examples of crazy references used in crazy ways. The fixes mean I can delete the recent patch added to handle lost indexes.

I spent two days on this commit.

Signed-off-by: quobix <dave@quobix.com>
2024-02-20 13:34:39 -05:00
quobix
5ea4f2b762 Fixed last known lookup bug
All known gaps (well known in my own head) seem to have been closed now, the final TODO in this area has been cleaned up, highlighted by an issue reported by speakeasy.

Signed-off-by: quobix <dave@quobix.com>
2024-02-13 07:33:55 -05:00
quobix
974c7bbf49 Fixed issue reported in discord channel
Building out a model, the current position was getting a bit muddled with deeply nested file references.

Signed-off-by: quobix <dave@quobix.com>
2024-02-13 07:33:55 -05:00
quobix
6c8e03d36f Resolution for https://github.com/pb33f/libopenapi/issues/248
A new codepath created a double dip into the index, which skews the working path. A short circuit is required, and a new block of code catches it.

Signed-off-by: quobix <dave@quobix.com>
2024-02-09 10:10:15 -05:00
Tristan Cartledge
c2b4b662ba Merge branch 'main' into ordered-libopenapi 2023-12-04 22:38:26 +00: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
Tristan Cartledge
2b128cb465 fix: data race 2023-12-04 18:08:02 +00: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
d2b864fbfc Added decoding to alt-ref for root handling
Signed-off-by: quobix <dave@quobix.com>
2023-11-07 11:29:24 -05:00
quobix
f3094d0b14 Cleanup, sweep-up and tuneup
Signed-off-by: quobix <dave@quobix.com>
2023-11-04 09:38:33 -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
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
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
6e9db7f838 A massive test update to bring everything inlne with the new Buildable signature.
All tests in index and datamodel now pass. The rolodex fixes all the things.

Signed-off-by: quobix <dave@quobix.com>
2023-10-23 18:18:44 -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
b295e8fd5c bashing through usecases and updating tests as we go.
so many things that can go wrong. have to catch them all.

Signed-off-by: quobix <dave@quobix.com>
2023-10-19 15:18:33 -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
0fcd55ea78 More surgery on rolodex and the index
Bringing the tests back online, bit by bit.

Signed-off-by: quobix <dave@quobix.com>
2023-10-17 07:45:00 -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
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
Dave Shanley
f629c0ff58 fix for resolving looping relative references
In vacuum, a usecase was reported where an infinite loop occurred due to re-parsing the same reference over and over in a loop. It was re-creatable and it was because the loop happened before the index was ready.

This should be resolved now, at least for this use case. To be sure, I have included the specs as a new test.

https://github.com/daveshanley/vacuum/issues/268
Signed-off-by: Dave Shanley <dave@quobix.com>
2023-05-16 17:03:02 -04:00
Dave Shanley
e6626fe22e Support for relative links now in place #73
Tests all passing, runs super fast, pulls in every single DigitalOcean spec and parses it. There may be some issues deeper down in the models, but for now high level tests all pass.
2023-02-22 09:14:27 -05:00
Dave Shanley
e19b7d2bf1 Working through fix #73
Quite a bit of surgery required.
2023-02-22 09:14:27 -05:00