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

🧹 default to MQL asset context #3805

Merged
merged 2 commits into from
Apr 22, 2024
Merged

🧹 default to MQL asset context #3805

merged 2 commits into from
Apr 22, 2024

Conversation

arlimus
Copy link
Member

@arlimus arlimus commented Apr 22, 2024

We had this feature-flag since v7, aimed to make it the default in v8. Until now, it has not been mainlined.

This is changing today. Compiling with context is generally very helpful and provides nice auto-complete on embedded resources (similar to how you can access embedded fields in golang structs).

There is more work to be done, namely that we want to tie the context of the connection to the MQL execution itself. This will allow us to call fields without constantly refering to the global context in the future. (i.e. instead of docker.file.sth, once you connect to a Dockerfile you can just call sth). For this reason, we retain the feature-flag and will complete its functionality in this major release.

Note: I deactivated one level of functionality which had been degraded since v9, namely: cross-provider calling of MQL queries. We are restoring this with provider provider initialization (which hasn't been added yet). The release of v9 had removed this because providers were then individually packaged and structured and we hadn't yet had the time to migrate this functionality. Without the change in this PR, these types of calls/usages all resulted in a panic, jfyi

We had this feature-flag since v7, aimed to make it the default in v8. Until now, it has not been mainlined.

This is changing today. Compiling with context is generally very helpful
and provides nice auto-complete on embedded resources (similar to how
you can access embedded fields in golang structs).

There is more work to be done, namely that we want to tie the context of
the connection to the MQL execution itself. This will allow us to call
fields without constantly refering to the global context in the future.
(i.e. instead of `docker.file.sth`, once you connect to a Dockerfile you
can just call `sth`). For this reason, we retain the feature-flag and
will complete its functionality in this major release.
Copy link
Contributor

github-actions bot commented Apr 22, 2024

Test Results

2 977 tests  ±0   2 976 ✅ ±0   1m 40s ⏱️ +8s
  328 suites ±0       1 💤 ±0 
   23 files   ±0       0 ❌ ±0 

Results for commit 2f5d4af. ± Comparison against base commit 6459c85.

This pull request removes 3 and adds 3 tests. Note that renamed tests count towards both.
go.mondoo.com/cnquery/v11/llx ‑ TestSuccess/2024-04-19_11:15:16.875964915_+0000_UTC_m=+0.010020886
go.mondoo.com/cnquery/v11/llx ‑ TestTruthy/2024-04-19_11:15:16.875964915_+0000_UTC_m=+0.010020886
go.mondoo.com/cnquery/v11/llx ‑ TestTruthy/2024-04-19_11:15:16.875964915_+0000_UTC_m=+0.010020886#01
go.mondoo.com/cnquery/v11/llx ‑ TestSuccess/2024-04-22_07:32:12.396953855_+0000_UTC_m=+0.012410994
go.mondoo.com/cnquery/v11/llx ‑ TestTruthy/2024-04-22_07:32:12.396953855_+0000_UTC_m=+0.012410994
go.mondoo.com/cnquery/v11/llx ‑ TestTruthy/2024-04-22_07:32:12.396953855_+0000_UTC_m=+0.012410994#01

♻️ This comment has been updated with latest results.

@arlimus arlimus mentioned this pull request Apr 22, 2024
These were added in v7, but unfortunately we had to break the compatibility in v9. We will regain this ability, once cross-provider calls (in the new model) are added back.

Signed-off-by: Dominik Richter <[email protected]>
Copy link
Member

@chris-rock chris-rock left a comment

Choose a reason for hiding this comment

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

Thank you @arlimus

@arlimus arlimus merged commit 1c99b96 into main Apr 22, 2024
15 checks passed
@arlimus arlimus deleted the dom/assetcontext branch April 22, 2024 08:05
@github-actions github-actions bot locked and limited conversation to collaborators Apr 22, 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