Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

⭐️ support re-using MQL cache between provider connections #3274

Merged
merged 36 commits into from
Feb 14, 2024

Conversation

imilchev
Copy link
Member

Allow re-using the MQL resource cache between provider connections. Connections can now have parents. When that is the case, the MQL resource cache from the parent is used for the child connection as well.

This PR only implements sharing MQL resource cache within a single provider. Cross-provider sharing isn't possible yet

Copy link
Contributor

github-actions bot commented Feb 12, 2024

Test Results

2 745 tests  +6   2 744 ✅ +6   52s ⏱️ -1s
  186 suites ±0       1 💤 ±0 
    5 files   ±0       0 ❌ ±0 

Results for commit a40301a. ± Comparison against base commit 114413a.

This pull request removes 3 and adds 9 tests. Note that renamed tests count towards both.
go.mondoo.com/cnquery/v10/llx ‑ TestSuccess/2024-02-13_12:12:05.66459257_+0000_UTC_m=+0.009874067
go.mondoo.com/cnquery/v10/llx ‑ TestTruthy/2024-02-13_12:12:05.66459257_+0000_UTC_m=+0.009874067
go.mondoo.com/cnquery/v10/llx ‑ TestTruthy/2024-02-13_12:12:05.66459257_+0000_UTC_m=+0.009874067#01
go.mondoo.com/cnquery/v10/llx ‑ TestSuccess/2024-02-14_09:45:47.197306114_+0000_UTC_m=+0.011229263
go.mondoo.com/cnquery/v10/llx ‑ TestTruthy/2024-02-14_09:45:47.197306114_+0000_UTC_m=+0.011229263
go.mondoo.com/cnquery/v10/llx ‑ TestTruthy/2024-02-14_09:45:47.197306114_+0000_UTC_m=+0.011229263#01
go.mondoo.com/cnquery/v10/providers-sdk/v1/plugin ‑ TestAddRuntime_Parent
go.mondoo.com/cnquery/v10/providers-sdk/v1/plugin ‑ TestAddRuntime_ParentNotExist
go.mondoo.com/cnquery/v10/providers-sdk/v1/plugin ‑ TestConnection_ID
go.mondoo.com/cnquery/v10/providers-sdk/v1/plugin ‑ TestConnection_ParentID
go.mondoo.com/cnquery/v10/providers-sdk/v1/plugin ‑ TestConnection_ParentID_0
go.mondoo.com/cnquery/v10/providers-sdk/v1/plugin ‑ TestConnection_ParentID_Nil

♻️ This comment has been updated with latest results.

@imilchev imilchev force-pushed the ivan/provider-connection-sharing branch 6 times, most recently from e9f5fa9 to c3e1da6 Compare February 13, 2024 13:17
@imilchev imilchev marked this pull request as ready for review February 13, 2024 14:03
Copy link
Member

@arlimus arlimus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool addition, great job on this!! 🚀 🎉

Nice additions to the testing, nice fixes for some of the error messages, the sharing of the connection details through the plugins is on point. Updating all the providers to use this is nice to see in action. I haven't tested this across version boundaries, but since the interface is only additive we can introduce this without a major bump. Changing the syncx.Map to be a pointer for the sharing makes sense.

I really only have a small nitpick, which is using a pointer for the parentId instead of a simple value. But yeah, nitpick ;)

Signed-off-by: Ivan Milchev <[email protected]>
Signed-off-by: Ivan Milchev <[email protected]>
Signed-off-by: Ivan Milchev <[email protected]>
Signed-off-by: Ivan Milchev <[email protected]>
Signed-off-by: Ivan Milchev <[email protected]>
Signed-off-by: Ivan Milchev <[email protected]>
Signed-off-by: Ivan Milchev <[email protected]>
Signed-off-by: Ivan Milchev <[email protected]>
Signed-off-by: Ivan Milchev <[email protected]>
Signed-off-by: Ivan Milchev <[email protected]>
Signed-off-by: Ivan Milchev <[email protected]>
Signed-off-by: Ivan Milchev <[email protected]>
Signed-off-by: Ivan Milchev <[email protected]>
Signed-off-by: Ivan Milchev <[email protected]>
Signed-off-by: Ivan Milchev <[email protected]>
Signed-off-by: Ivan Milchev <[email protected]>
Signed-off-by: Ivan Milchev <[email protected]>
Signed-off-by: Ivan Milchev <[email protected]>
Signed-off-by: Ivan Milchev <[email protected]>
Signed-off-by: Ivan Milchev <[email protected]>
Signed-off-by: Ivan Milchev <[email protected]>
Signed-off-by: Ivan Milchev <[email protected]>
Signed-off-by: Ivan Milchev <[email protected]>
@imilchev imilchev force-pushed the ivan/provider-connection-sharing branch from 8644210 to 9baa375 Compare February 14, 2024 09:25
Signed-off-by: Ivan Milchev <[email protected]>
@imilchev imilchev merged commit 054b1dc into main Feb 14, 2024
14 checks passed
@imilchev imilchev deleted the ivan/provider-connection-sharing branch February 14, 2024 09:49
@github-actions github-actions bot locked and limited conversation to collaborators Feb 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants