-
Notifications
You must be signed in to change notification settings - Fork 257
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
feat: preventing ddl and dml statements from autosubmiting #6105
Conversation
PR is now ready for early review.
|
Preliminary feedback
https://docs.influxdata.com/enterprise_influxdb/v1/query_language/spec/#keywords The following non-excluded DQL statements work as expected:
|
Baseline Test I've checked a revised test plan against the latest distribution (wget https://download.influxdata.com/chronograf/releases/chronograf_1.10.5_amd64.deb) The test plan is based on the commands found in queryFilter.ts and suggestions in previous comment SFL = Submit on Focus Loss (Query Editor) Universal Statements: EXPLAIN, SELECT, SHOW (*) DO we want to restrict the Universal statements can be submitted arbitrarily on focus change or page reload (to restore state of previous session). Restricted statements should not be submitted arbitrarily through focus loss or on page reload. FAIL below indicates that such behavior occurred. Still the submit button should work.
(1) - DROP Statements disappear on reload PR-6105-Testing241014-standard-product.csv N.B. Should statements |
Test of Commit 8808fee Tested 2024.10.16 Local Build running on port 7777 - to avoid conflicts with product build listening on 8888
SFL = Submit on Focus Loss (Query Editor) Universal Statements: EXPLAIN, SELECT, SHOW Universal statements can be submitted arbitrarily on focus change or page reload (to restore state of previous session). Restricted statements should not be submitted arbitrarily through focus loss or on page reload. FAIL below indicates that such behavior occurred. Still the submit button should work.
Restricted Commands
(1) UPDATE does not appear as a keyword in InfluxQL, however it has been added as a placeholder in the event of future changes. Universal Commands
|
Test of Commit e904a25 Tested 2024.10.21 New Issue With restricted statements, discovered that after a restricted statement is sent successfully, the statement can then be resubmitted when another statement in another tab is sent, or when another tab is closed. See below COTB-Resub record of test of restricted statements. Use Case:
Recommendation The Test Run Details Local Build running on port 7777 - to avoid conflicts with product build listening on 8888
SFL = Submit on Focus Loss (Query Editor) Universal Statements: EXPLAIN, SELECT, SHOW Universal statements can be submitted arbitrarily on focus change or page reload (to restore state of previous session). Restricted statements should not be submitted arbitrarily through focus loss or on page reload. FAIL below indicates that such behavior occurred. Still the submit button should work.
Restricted Commands
(1) UPDATE does not appear as a keyword in InfluxQL, however it has been added as a placeholder in the event of future changes. Universal Commands
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment following manual test in general coversation. #6105 (comment)
A new minor issue was uncovered.
Fixed auto-submitting, when no change was done and also when the Refresh button is clicked. There is still a problem in the query status text in case of an excluded statement is still in the submitted form or returned to the submitted form, but an other statement is submitted. This results in "Unsubmitted" state. |
Test of Commit 630d521 Tested 2024.10.23 Previous Issue See comment from 10.21 above. Seems to work correctly now Recommendation The Test Run Details Local Build running on port 7777 - to avoid conflicts with product build listening on 8888
SFL = Submit on Focus Loss (Query Editor) Universal Statements: EXPLAIN, SELECT, SHOW Universal statements can be submitted arbitrarily on focus change or page reload (to restore state of previous session). Restricted statements should not be submitted arbitrarily through focus loss or on page reload. FAIL below indicates that such behavior occurred. Still the submit button should work.
Restricted Commands
(1) UPDATE does not appear as a keyword in InfluxQL, however it has been added as a placeholder in the event of future changes. Universal Commands
|
The correct query state when returning to the resubmitted state has been fixed. |
PR was updated with better query state management. All issues should be resolved. |
Test of Commit 630d521 Tested 2024.11.18 Recommendation The Test Run Details Local Build running on port 7777 - to avoid conflicts with product build listening on 8888
SFL = Submit on Focus Loss (Query Editor) Universal Statements: EXPLAIN, SELECT, SHOW Universal statements can be submitted arbitrarily on focus change or page reload (to restore state of previous session). Restricted statements should not be submitted arbitrarily through focus loss or on page reload. FAIL below indicates that such behavior occurred. Still the submit button should work.
Restricted Commands
(1) UPDATE does not appear as a keyword in InfluxQL, however it has been added as a placeholder in the event of future changes. Universal Commands
Addenda
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you take a look at the imports? I'm continuing reviewing the rest of the code.
I changed relative paths to absolute. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Manual tests pass. Changes make general sense. Good to go.
This pull request introduces improvement of query editor to disable auto submission dangerous queries such as
DROP
,DELETE
,ALTER
, ...