You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "hughhhh (via GitHub)" <gi...@apache.org> on 2023/05/23 21:17:41 UTC

[GitHub] [superset] hughhhh opened a new pull request, #24196: fix: SSH Tunnel creation with dynamic form

hughhhh opened a new pull request, #24196:
URL: https://github.com/apache/superset/pull/24196

   <!---
   Please write the PR title following the conventions at https://www.conventionalcommits.org/en/v1.0.0/
   Example:
   fix(dashboard): load charts correctly
   -->
   
   ### SUMMARY
   <!--- Describe the change below, including rationale and design decisions -->
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   
   ### TESTING INSTRUCTIONS
   <!--- Required! What steps can be taken to manually verify the changes? -->
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] hughhhh merged pull request #24196: fix: SSH Tunnel creation with dynamic form

Posted by "hughhhh (via GitHub)" <gi...@apache.org>.
hughhhh merged PR #24196:
URL: https://github.com/apache/superset/pull/24196


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov[bot] commented on pull request #24196: fix: SSH Tunnel creation with dynamic form

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #24196:
URL: https://github.com/apache/superset/pull/24196#issuecomment-1560144005

   ## [Codecov](https://app.codecov.io/gh/apache/superset/pull/24196?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   > Merging [#24196](https://app.codecov.io/gh/apache/superset/pull/24196?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (ec7dc49) into [master](https://app.codecov.io/gh/apache/superset/commit/7891cea7f75a252e3f3cf83febb835645b41ea30?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (7891cea) will **decrease** coverage by `11.20%`.
   > The diff coverage is `70.94%`.
   
   > :exclamation: Current head ec7dc49 differs from pull request most recent head 1afb7cd. Consider uploading reports for the commit 1afb7cd to get more accurate results
   
   ```diff
   @@             Coverage Diff             @@
   ##           master   #24196       +/-   ##
   ===========================================
   - Coverage   68.28%   57.09%   -11.20%     
   ===========================================
     Files        1955     1957        +2     
     Lines       75493    75583       +90     
     Branches     8220     8221        +1     
   ===========================================
   - Hits        51553    43154     -8399     
   - Misses      21833    30323     +8490     
   + Partials     2107     2106        -1     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | hive | `?` | |
   | mysql | `?` | |
   | postgres | `?` | |
   | presto | `53.29% <62.22%> (+0.02%)` | :arrow_up: |
   | python | `59.62% <70.00%> (-23.23%)` | :arrow_down: |
   | sqlite | `?` | |
   | unit | `53.42% <70.00%> (+0.03%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://app.codecov.io/gh/apache/superset/pull/24196?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [superset-frontend/src/SqlLab/actions/sqlLab.js](https://app.codecov.io/gh/apache/superset/pull/24196?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9hY3Rpb25zL3NxbExhYi5qcw==) | `66.66% <ø> (+0.25%)` | :arrow_up: |
   | [...d/src/SqlLab/components/SqlEditorLeftBar/index.tsx](https://app.codecov.io/gh/apache/superset/pull/24196?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL1NxbEVkaXRvckxlZnRCYXIvaW5kZXgudHN4) | `62.12% <ø> (+0.92%)` | :arrow_up: |
   | [superset-frontend/src/SqlLab/fixtures.ts](https://app.codecov.io/gh/apache/superset/pull/24196?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9maXh0dXJlcy50cw==) | `100.00% <ø> (ø)` | |
   | [...et-frontend/src/SqlLab/reducers/getInitialState.js](https://app.codecov.io/gh/apache/superset/pull/24196?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9yZWR1Y2Vycy9nZXRJbml0aWFsU3RhdGUuanM=) | `90.62% <ø> (ø)` | |
   | [superset-frontend/src/SqlLab/reducers/sqlLab.js](https://app.codecov.io/gh/apache/superset/pull/24196?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9yZWR1Y2Vycy9zcWxMYWIuanM=) | `38.46% <ø> (+0.21%)` | :arrow_up: |
   | [superset-frontend/src/SqlLab/types.ts](https://app.codecov.io/gh/apache/superset/pull/24196?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi90eXBlcy50cw==) | `57.14% <ø> (ø)` | |
   | [...eModal/DatabaseConnectionForm/CommonParameters.tsx](https://app.codecov.io/gh/apache/superset/pull/24196?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZlYXR1cmVzL2RhdGFiYXNlcy9EYXRhYmFzZU1vZGFsL0RhdGFiYXNlQ29ubmVjdGlvbkZvcm0vQ29tbW9uUGFyYW1ldGVycy50c3g=) | `76.92% <ø> (ø)` | |
   | [...ses/DatabaseModal/DatabaseConnectionForm/index.tsx](https://app.codecov.io/gh/apache/superset/pull/24196?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZlYXR1cmVzL2RhdGFiYXNlcy9EYXRhYmFzZU1vZGFsL0RhdGFiYXNlQ29ubmVjdGlvbkZvcm0vaW5kZXgudHN4) | `81.81% <ø> (ø)` | |
   | [...end/src/features/databases/DatabaseModal/index.tsx](https://app.codecov.io/gh/apache/superset/pull/24196?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZlYXR1cmVzL2RhdGFiYXNlcy9EYXRhYmFzZU1vZGFsL2luZGV4LnRzeA==) | `43.36% <ø> (-0.28%)` | :arrow_down: |
   | [...perset-frontend/src/hooks/apiResources/queryApi.ts](https://app.codecov.io/gh/apache/superset/pull/24196?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2hvb2tzL2FwaVJlc291cmNlcy9xdWVyeUFwaS50cw==) | `100.00% <ø> (ø)` | |
   | ... and [9 more](https://app.codecov.io/gh/apache/superset/pull/24196?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | |
   
   ... and [307 files with indirect coverage changes](https://app.codecov.io/gh/apache/superset/pull/24196/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] Antonio-RiveroMartnez commented on a diff in pull request #24196: fix: SSH Tunnel creation with dynamic form

Posted by "Antonio-RiveroMartnez (via GitHub)" <gi...@apache.org>.
Antonio-RiveroMartnez commented on code in PR #24196:
URL: https://github.com/apache/superset/pull/24196#discussion_r1228450159


##########
superset-frontend/src/features/databases/DatabaseModal/index.tsx:
##########
@@ -763,15 +763,19 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
         });
       }
 
-      // make sure that button spinner animates
-      setLoading(true);
-      const errors = await getValidation(dbToUpdate, true);
-      if ((validationErrors && !isEmpty(validationErrors)) || errors) {
+      // only do validation for non ssh tunnel connections
+      console.log(dbToUpdate);

Review Comment:
   leftover



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] hughhhh commented on a diff in pull request #24196: fix: SSH Tunnel creation with dynamic form

Posted by "hughhhh (via GitHub)" <gi...@apache.org>.
hughhhh commented on code in PR #24196:
URL: https://github.com/apache/superset/pull/24196#discussion_r1238961750


##########
superset-frontend/src/features/databases/DatabaseModal/index.tsx:
##########
@@ -763,15 +763,18 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
         });
       }
 
-      // make sure that button spinner animates
-      setLoading(true);
-      const errors = await getValidation(dbToUpdate, true);
-      if ((validationErrors && !isEmpty(validationErrors)) || errors) {
+      // only do validation for non ssh tunnel connections
+      if (!dbToUpdate?.ssh_tunnel) {

Review Comment:
   for the initial implementation, we were okay with doing validation on just connect. Right now users are not able to connect at all via dynamic forms.
   
   I'm open to this fix but that's going to take longer to implement vs. fixing the issue at hand.
   
   Let me know what you think



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] sadpandajoe commented on pull request #24196: fix: SSH Tunnel creation with dynamic form

Posted by "sadpandajoe (via GitHub)" <gi...@apache.org>.
sadpandajoe commented on PR #24196:
URL: https://github.com/apache/superset/pull/24196#issuecomment-1622278421

   🏷️ preset:2023.27


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] betodealmeida commented on a diff in pull request #24196: fix: SSH Tunnel creation with dynamic form

Posted by "betodealmeida (via GitHub)" <gi...@apache.org>.
betodealmeida commented on code in PR #24196:
URL: https://github.com/apache/superset/pull/24196#discussion_r1238924024


##########
superset-frontend/src/features/databases/DatabaseModal/DatabaseConnectionForm/CommonParameters.tsx:
##########
@@ -250,3 +251,34 @@ export const forceSSLField = ({
     />
   </div>
 );
+
+export const SSHTunnelSwitch = ({
+  isEditMode,
+  changeMethods,
+  db,
+}: FieldPropTypes) =>
+  true ? (

Review Comment:
   Why the ternary operator here if the condition is always true?



##########
superset-frontend/src/features/databases/DatabaseModal/index.tsx:
##########
@@ -763,15 +763,18 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
         });
       }
 
-      // make sure that button spinner animates
-      setLoading(true);
-      const errors = await getValidation(dbToUpdate, true);
-      if ((validationErrors && !isEmpty(validationErrors)) || errors) {
+      // only do validation for non ssh tunnel connections
+      if (!dbToUpdate?.ssh_tunnel) {

Review Comment:
   @hughhhh  why can't we run the validation for SSH tunnel connections, assuming the user has provided that info?
   
   I think the logic should be: if the user has enabled SSH, we don't perform any validation until SSH credentials are entered.



##########
superset-frontend/src/views/CRUD/hooks.ts:
##########
@@ -753,6 +753,11 @@ export function useDatabaseValidation() {
         .catch(e => {
           if (typeof e.json === 'function') {
             return e.json().then(({ errors = [] }: JsonObject) => {
+              if (database?.parameters?.ssh) {

Review Comment:
   I don't think this belongs here... if we don't want to show validation errors for some reason, then we shouldn't be running the validation API calls.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org