Commit Graph

287 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
15d304da1b disabled a couple of tests
will be an effort to rewrit logic for windows specifically in these use cases
2024-01-18 15:11:39 -05:00
quobix
292d1d8bff one more swing at windows compatibility
before I lose my mind.
2024-01-18 15:11:39 -05:00
quobix
1f21f1432d build working on windows again
ping pong.
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
986ba2b2ab Cleaned up windows build after retrying on linux
Signed-off-by: quobix <dave@quobix.com>

formatted code

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
961fe76e7f fixed flaky test
Signed-off-by: quobix <dave@quobix.com>
2024-01-04 17:08:08 -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
quobix
cbdaac7374 cleaned up path handling a little
Signed-off-by: quobix <dave@quobix.com>
2024-01-04 17:08:08 -05:00
quobix
3b88510998 Added safety check for extracting refs from non-openapi files
mentioned in https://github.com/daveshanley/vacuum/issues/400

Signed-off-by: quobix <dave@quobix.com>
2023-12-19 05:31:43 -05:00
Tristan Cartledge
f86d7bc47e Merge branch 'main' into ordered-libopenapi 2023-12-15 15:39:25 +00:00
Tristan Cartledge
e4a6c6516e chore: add more test coverage 2023-12-14 17:55:51 +00:00
quobix
7917e6c285 Removed digital ocean rolodex size check from test
it keeps on changing, which it should, but updating the tests each time is dumb. Moved to a fixed size test.

Signed-off-by: quobix <dave@quobix.com>
2023-12-12 13:38:03 -05:00
quobix
1f5357ba45 Fixed deadlock causing 100% CPU spike
I have seen this issue appear online a few times, the CPU locks at 100% when throwing a bad reference.

This happened because the local ‘lock’ used by the rolodex file loader, was not releasing correctly when a
lookup occurred, that could not be found via a rolodex file lookup.

https://github.com/daveshanley/vacuum/issues/393
Signed-off-by: quobix <dave@quobix.com>
2023-12-12 13:38:03 -05:00
Tristan Cartledge
41557cebcb cleanup: add sync version of ExtractSpecInfoWithDocumentCheck 2023-12-07 12:57:46 +00:00
Tristan Cartledge
fac9a4b3b1 fix: attempted fix to infinite yaml parsing bug 2023-12-07 11:34:36 +00:00
Tristan Cartledge
53f342ba63 fix 2023-12-06 14:54:55 +00:00
Tristan Cartledge
367b64d6db fix 2023-12-06 14:36:24 +00:00
Tristan Cartledge
8b6a5ef486 fix: increase resolver max depth 2023-12-06 08:35:55 +00:00
Tristan Cartledge
c2b4b662ba Merge branch 'main' into ordered-libopenapi 2023-12-04 22:38:26 +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
Tristan Cartledge
2b128cb465 fix: data race 2023-12-04 18:08:02 +00:00
Tristan Cartledge
a1bc5275ac Merge branch 'main' into ordered-libopenapi 2023-12-03 21:09:28 +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
Tristan Cartledge
64245216b3 Merge branch 'main' into ordered-libopenapi 2023-12-03 20:43:45 +00: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
Tristan Cartledge
d669ada7b6 Merge branch 'main' into ordered-libopenapi 2023-12-02 22:23:19 +00:00
Tristan Cartledge
137db075d8 fix: for all tests 2023-12-02 16:16:40 +00:00
quobix
82c9e21df1 fixed tests.
Signed-off-by: quobix <dave@quobix.com>
2023-12-01 18:11:54 -05:00
quobix
3715938ce8 fixed resolving issue, not all refs being resolved.
This got tucked in somehow, the sequence is what is used by the resolver to replace refs. This fixes an issue in vacuum.

Signed-off-by: quobix <dave@quobix.com>
2023-12-01 18:11:54 -05:00
Tristan Cartledge
94fb310643 fix: tests 2023-12-01 18:25:15 +00: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
5c372820fc updated test values as spec changes in the wild.
Signed-off-by: quobix <dave@quobix.com>
2023-11-30 07:20:19 -05:00
quobix
71e0552279 added error check for local FS
Signed-off-by: quobix <dave@quobix.com>
2023-11-30 07:20:19 -05:00
quobix
831e5ad9c6 warn the user if there is no local file system configured =
Signed-off-by: quobix <dave@quobix.com>
2023-11-30 07:20:19 -05:00
quobix
839c7d9795 if the app freezes, we will know why.
Signed-off-by: quobix <dave@quobix.com>
2023-11-30 07:20:19 -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
803e9337b5 updated digital ocean tests
Signed-off-by: quobix <dave@quobix.com>
2023-11-30 07:20:19 -05:00
Tristan Cartledge
85928613f5 chore: fix issues with timezone differences in tests 2023-11-27 15:18:15 -05:00
quobix
8335db72e2 added coverage for fixed remote unsupported handler
Signed-off-by: quobix <dave@quobix.com>
2023-11-25 21:09:21 -05:00
quobix
a0d9204099 added logger check to remote loader
Signed-off-by: quobix <dave@quobix.com>
2023-11-25 21:09:21 -05:00
quobix
6082f3ccdc added correct error handling for unsupported remote files
Signed-off-by: quobix <dave@quobix.com>
2023-11-25 21:09:21 -05:00
quobix
95022c5a24 updated logger message to be more helpful
Signed-off-by: quobix <dave@quobix.com>
2023-11-25 21:09:21 -05:00
quobix
ff93d99fcb added humaize test
Signed-off-by: quobix <dave@quobix.com>
2023-11-25 21:09:21 -05:00
quobix
af1ee6c620 added tests for file size and total files.
Signed-off-by: quobix <dave@quobix.com>
2023-11-25 21:09:21 -05:00