Commit Graph

78 Commits

Author SHA1 Message Date
quobix
82c9e21df1 fixed tests.
Signed-off-by: quobix <dave@quobix.com>
2023-12-01 18:11:54 -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
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
803e9337b5 updated digital ocean tests
Signed-off-by: quobix <dave@quobix.com>
2023-11-30 07:20:19 -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
quobix
5d14ef226b Adding more tests to bump coverage
Signed-off-by: quobix <dave@quobix.com>
2023-11-25 10:10:51 -05:00
quobix
495bb27ed1 stopped the spewing of logs
Signed-off-by: quobix <dave@quobix.com>
2023-11-25 10:10:51 -05:00
quobix
7d63fe3262 Added new node map capability
Signed-off-by: quobix <dave@quobix.com>
2023-11-25 10:10:51 -05:00
quobix
784954e208 Defaulting localFS to be recursive
currently it pre-indexes everything in the root. This behavior is undesirable out of the box, so it now looks recursively by default.

Signed-off-by: quobix <dave@quobix.com>
2023-11-07 11:29:24 -05:00
quobix
f134ac27b6 updated token for tests
Signed-off-by: quobix <dave@quobix.com>
2023-11-04 10:09:43 -04:00
quobix
276c3959fd Changed remote loader to use a timeout
rather than a hard block, it will wait 50ms then try again, regardless of cores, so it won’t ever block fully.

Signed-off-by: quobix <dave@quobix.com>
2023-11-01 14:29:52 -04:00
quobix
33fc552c65 Another round of coverage
will it go green? will it stay red? who knows…

Signed-off-by: quobix <dave@quobix.com>
2023-11-01 11:50:23 -04:00
quobix
3c27c43ec0 Added cache set/get for index
It’s required to be able to ensire full coverage to test things that can’t be tested without a huge amount of test rigging.

Signed-off-by: quobix <dave@quobix.com>
2023-11-01 11:38:16 -04:00
quobix
fde9ede4ac Working through more coverage
adding more tests.

Signed-off-by: quobix <dave@quobix.com>
2023-10-31 08:25:56 -04:00
quobix
7cf93e83b4 bumping coverage
Signed-off-by: quobix <dave@quobix.com>
2023-10-26 16:22:22 -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
e26897d8a1 Updated logic to handle a single core
The remote loader was blocking the only thread.

Signed-off-by: quobix <dave@quobix.com>
2023-10-24 17:54:02 -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
3bf830c2b3 Another round of cleaning.
Signed-off-by: quobix <dave@quobix.com>
2023-10-21 18:41:53 -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
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
054103b733 working through logging now and further tests
starting the circle dance now.

Signed-off-by: quobix <dave@quobix.com>
2023-10-18 17:27:56 -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
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
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
Nicholas Jackson
b6f5730a7f chore: replace use of deprecated ioutil with os 2023-10-08 12:23:48 -04:00
Tristan Cartledge
2723ed974d fix: test 2023-10-05 09:31:16 -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
Tristan Cartledge
06f6b243a8 fix: add missing path and parent node to paths index references 2023-05-30 09:20:56 -04:00
Dave Shanley
08f596058f Cleaning up some tests after ancestor lookup code added.
Signed-off-by: Dave Shanley <dave@quobix.com>
2023-05-16 17:03:02 -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
581423016f Added another test to validate #88
Code is behaving correctly, according to the design.
2023-03-06 13:18:28 -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
4901813e88 Updated test to reflect new inline schema count
Looks like we were missing a ton!
2023-02-27 11:05:18 -05:00
Dave Shanley
bc1d8c5454 fix: Issue #82
The index can now accept multiple parameters with the same name, as long as they have different `in` types.
2023-02-22 09:14:27 -05:00
Dave Shanley
c5e9dbc360 Bumping coverage on 0.6.0 2023-02-22 09:14:27 -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
1df5f44e6f Working through fix-73 and v0.6.0 2023-02-22 09:14:27 -05:00
Dave Shanley
6d77716c9a feat: add index for getting all "schema" objects #50
There is new code that looks for inline `schema` definitions and collects them, as well as a futher subset of references that are specifically `object` or `array` types. This is a breaking change because the `index.GetAllSchemas()` method now returns a slice of *Reference pointers, rather than a map of them. The original behavior of `GetAllSchemas()` has been replaced with `GetAllComponentSchemas()` which retains the signature.

Two new additional methods `GetAllInlineSchemas()` and `GetAllInlineSchemaObjects()`. The former will return everything in the spec marked with `schema` that is not a reference. The latter will return everything the former does, except filtered down by `object` or `array` types.

Also the index is now bubbled up through the document model. There isn't a simple way to get access to it, small non breaking change that attaches a reference to the index, returned by `DocumentModel`
2023-01-28 14:09:11 -05:00
Dave Shanley
6b28e414bd fix: Index incorrectly handling file references on the local file system.
This was reported in https://github.com/daveshanley/vacuum/issues/225, it's a continuation of the issue found in https://github.com/pb33f/libopenapi/issues/37. This fix allows the full import of the file (not just a path/component) to be imported.

Signed-off-by: Dave Shanley <dave@quobix.com>
2023-01-04 06:47:48 -05:00
Tristan Cartledge
8581c7fb45 fix: add test 2022-12-20 16:43:43 -05:00
Tristan Cartledge
c75a1bfaf4 fix: add paths/parent nodes to schemas as well 2022-12-16 16:09:59 -05:00
Tristan Cartledge
53789cbc1b feat: add parent nodes and paths to server index references 2022-12-16 16:09:59 -05:00
Dave Shanley
8dff96ad90 Cleaning up some coverage and a few bits. 2022-12-15 16:31:32 -05:00