Commit Graph

22 Commits

Author SHA1 Message Date
quobix
70f406b6cf Added NodeMap to all low level objects.
this sync map tracks all the nodes that apply to this object.
2024-08-05 09:29:07 -04: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
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
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
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
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
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
zak905
f7a6c9dbcc add additional test for covering file referece case 2023-07-28 16:42:31 -04:00
Zakaria Amine
6b0cae741c add unit tests 2023-07-28 16:42:31 -04:00
Dave Shanley
25d8de9b0e Added more support for YAML merge nodes, anchors and aliases
And added deeper support for Aliases. Also added in local file handling through renamed `FSHandler` configuration property for the index.

Also re-ran `go fmt`

Signed-off-by: Dave Shanley <dave@quobix.com>
2023-07-16 11:45:18 -04:00
Dave Shanley
3b7cbacc44 Add support for custom io.FS remote handler in index #85
A new configuration option is available to the index, a `RemoteHandler` of type  `fs.FS`. If set, will be used as an override to all other remote fetching code.

Signed-off-by: Dave Shanley <dave@quobix.com>
2023-07-16 11:45:18 -04:00
Federico Bevione
572130c666 add test, fix RemoteURLHandler field name 2023-06-30 13:24:16 -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
24d094ca7b Corrected remote document lookup behavior
When remote documents are requested and there is no way to know the base URL, the index will now try and determine the base path from the way the spec was loaded (if it comes in remote, we use the base URL of the spec)
2023-04-22 09:50:44 -04:00
Dave Shanley
c5e9dbc360 Bumping coverage on 0.6.0 2023-02-22 09:14:27 -05:00