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

fix(modelql)!: disable implicit queries to avoid accidental performan… #1234

Conversation

slisson
Copy link
Member

@slisson slisson commented Dec 8, 2024

No description provided.

…ce issues

You should fix the unintended implicit queries or use .query explicitly.
You can also set the environment variable MODELQL_IMPLICIT_QUERIES_ENABLED=true to re-enable this
feature.
@slisson slisson enabled auto-merge December 8, 2024 12:08
Copy link
Contributor

github-actions bot commented Dec 8, 2024

Test Results

  183 files  ±0    183 suites  ±0   31m 28s ⏱️ -20s
1 040 tests +2  1 033 ✅ +2  7 💤 ±0  0 ❌ ±0 
1 050 runs  +2  1 043 ✅ +2  7 💤 ±0  0 ❌ ±0 

Results for commit b6cd91a. ± Comparison against base commit f8bbee6.

♻️ This comment has been updated with latest results.

@slisson slisson force-pushed the MODELIX-649-Consequences-of-on-demand-mode-via-model-api-instances-after-ModelQl-query-hard-to-understand-for-users branch from 57e46ee to 6ba247c Compare December 8, 2024 13:09
…ce issues

You should fix the unintended implicit queries or use .query explicitly.
You can also set the environment variable MODELQL_IMPLICIT_QUERIES_ENABLED=true to re-enable this
feature.
@slisson slisson force-pushed the MODELIX-649-Consequences-of-on-demand-mode-via-model-api-instances-after-ModelQl-query-hard-to-understand-for-users branch from 6ba247c to b6cd91a Compare December 8, 2024 13:32
Copy link
Contributor

github-actions bot commented Dec 8, 2024

JVM coverage report

Overall Project 54.02% -0.11%
Files changed 12.96%

File Coverage
ModelQLNode.jvm.kt 46.15% -53.85%
ModelQLNode.kt 23.11% -26.02%


package org.modelix.modelql.client

actual val implicitQueriesEnabled: Boolean = System.getenv("MODELQL_IMPLICIT_QUERIES_ENABLED")?.toBooleanStrictOrNull() ?: false

Check warning

Code scanning / detekt

The property implicitQueriesEnabled is missing documentation. Warning

The property implicitQueriesEnabled is missing documentation.
Copy link
Contributor

@languitar languitar left a comment

Choose a reason for hiding this comment

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

Wouldn't it be a better idea to make the choice if implicit queries are allowed or not a constructor or builder argument of the client? That way, application can decide on a suitable configuration mechanism for them to apply.

Otherwise, the new option would need to be explained in the docs.

Copy link
Contributor

@odzhychko odzhychko left a comment

Choose a reason for hiding this comment

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

The code and idea look good.
But the PR has two commits with the same message.

@odzhychko
Copy link
Contributor

Wouldn't it be a better idea to make the choice if implicit queries are allowed or not a constructor or builder argument of the client? That way, application can decide on a suitable configuration mechanism for them to apply.

Otherwise, the new option would need to be explained in the docs.

This would also allow clients to be configured differently in one application.

@slisson
Copy link
Member Author

slisson commented Dec 9, 2024

I was thinking about removing this feature completely, but didn't want to make switching to a new version unnecessarily difficult. A poor performance is still better than exceptions. Still not sure wether we should support this feature or deprecate it.

@slisson slisson closed this Dec 10, 2024
auto-merge was automatically disabled December 10, 2024 16:57

Pull request was closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants