Commit Graph

37 Commits

Author SHA1 Message Date
quobix
e699968768 Working through windows support 2024-01-18 15:11:39 -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
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
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
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
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
8f3f568e5f Tuned some glitches with v3 doc creation.
all covered now

Signed-off-by: quobix <dave@quobix.com>
2023-10-31 15:31:19 -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
c1cf240cab Working through test coverage
This will be a bit of a slog, new code built in the hot path will need some love and attention.

Signed-off-by: quobix <dave@quobix.com>
2023-10-24 16:13:08 -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
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
1bf772ab69 All spec_index tests pass
It’s so, so much faster than before, intelligent and ready for scale. I’m excited!

Signed-off-by: quobix <dave@quobix.com>
2023-10-20 11:38:29 -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
9ee1afe1f3 digital ocean now running correctly
Sucking in all the files!

Signed-off-by: quobix <dave@quobix.com>
2023-10-18 16:52:32 -04:00
quobix
77819061fa cleaning up a little.
Signed-off-by: quobix <dave@quobix.com>
2023-10-18 12:04:04 -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
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
Tristan Cartledge
d4dabca04f fix: correctly handling of extracting enums for index 2023-10-05 09:31:16 -04:00
quobix
e58aeb7860 Ensuring tests pass with updated code.
Signed-off-by: quobix <dave@quobix.com>
2023-09-16 11:39:32 -04:00
quobix
fcc12cb7dc Properties named ‘enum’ were being indexed as enums
An edge case reported in https://github.com/daveshanley/vacuum/issues/339 shows up when enums are being indexed when they are actually a property of a schema called ‘enum’.

This has been fixed.

Signed-off-by: quobix <dave@quobix.com>
2023-09-16 11:39:32 -04:00
Tristan Cartledge
74c7a3f632 fix: improves the ability to get all inline schemas and identify inline object schemas (#154)
* fix: improves the ability to get all inline schemas and identify inline object schemas

* fix

* fix

* fix

* fix
2023-08-22 06:40:00 -04:00
Dave Shanley
f7ab737f0a Updated index to count schemas, even if they are refs.
This was brought up in chat, that the expectation is that all schemas are included, refs or not. This update fixes that for the index and adds in a new individual property to count just the references `GetAllReferenceSchemas `

Signed-off-by: Dave Shanley <dave@quobix.com>
2023-08-09 07:40:24 -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
cb5f2da4d3 Fixed race conditions in index #91
Different race conditions popped up at different times, depending on how complex the nesting of indexes was. After running tests with `-race` I've knocked out all the concurrency issues being reported and now there are no race conditions reported by the tests. This should knock out all known race conditions with some targeted mutex locks.

Non breaking change.
2023-03-08 09:26:10 -05:00
Dave Shanley
0f2ac08567 Fixed async isues with index #91
The index runs async everywhere, it's kinda impossible to know which path with resolve first, so testing is hard. Sometimes a race condition is hit, well, it was. Now that map has a mutex on it.

Also fully fixed handling files with relative links. A basepath property has been added to the index configuration to allow a local root to be set when resolving files.

Added a full checkout test for digital ocean so that full remote and full local testing is performed.
2023-03-06 13:18:28 -05:00
Dave Shanley
6d384b2732 updated: a fix for #50
properties are now checked as part of the inline schemas. paths updated also to ensure correctness.
2023-02-27 11:05:18 -05:00
Dave Shanley
4a378de02e Fix: bug in index with description handling.
Issue for description being incorrectly picked up, is because index was collecting all descriptions, even if they were labels on schemas as reported in https://github.com/daveshanley/vacuum/issues/239
2023-02-27 11:05:18 -05: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
Dave Shanley
1df5f44e6f Working through fix-73 and v0.6.0 2023-02-22 09:14:27 -05:00