You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2020/04/07 14:48:33 UTC

[GitHub] [incubator-superset] dpgaspar opened a new pull request #9484: [dashboards] Fix, update dashboard owners not propagating to charts o…

dpgaspar opened a new pull request #9484: [dashboards] Fix, update dashboard owners not propagating to charts o…
URL: https://github.com/apache/incubator-superset/pull/9484
 
 
   ### CATEGORY
   
   - [X] Bug Fix
   - [ ] Enhancement (new features, refinement)
   - [ ] Refactor
   - [ ] Add tests
   - [ ] Build / Development Environment
   - [ ] Documentation
   
   ### SUMMARY
   Regression when updating a dashboard the dashboard's charts owners are not updated.
   When changing the dashboard owners we expect that all the charts that belong to the dashboard to be updated with the same dashboard owners (and preserve their own also)
   
   Note: Will add tests to cover this regression
   
   ### TEST PLAN
   - Login with `admin`
   - Create 2 users `gamma` and `alpha`
   - Update a dashboard setting it's new owners with `gamma` and `alpha`
   - Check that all the charts that belong to the dashboard get it's owners updated with `gamma`, `alpha` and `admin`
   
   ### ADDITIONAL INFORMATION
   - [ ] Has associated issue:
   - [ ] Changes UI
   - [ ] Requires DB Migration.
   - [ ] Confirm DB Migration upgrade and downgrade tested.
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   
   ### REVIEWERS
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [incubator-superset] john-bodley commented on issue #9484: [dashboards] Fix, update dashboard owners not propagating to charts o…

Posted by GitBox <gi...@apache.org>.
john-bodley commented on issue #9484: [dashboards] Fix, update dashboard owners not propagating to charts o…
URL: https://github.com/apache/incubator-superset/pull/9484#issuecomment-613604275
 
 
   Sorry for the late message. I'm a tad perplexed why when a user updates a dashboard they need to be added as an owner of all the charts associated with the dashboard as they're not explicitly changing the underlying charts. 
   
   cc: @graceguo-supercat 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [incubator-superset] codecov-io commented on issue #9484: [dashboards] Fix, update dashboard owners not propagating to charts o…

Posted by GitBox <gi...@apache.org>.
codecov-io commented on issue #9484: [dashboards] Fix, update dashboard owners not propagating to charts o…
URL: https://github.com/apache/incubator-superset/pull/9484#issuecomment-611094788
 
 
   # [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9484?src=pr&el=h1) Report
   > Merging [#9484](https://codecov.io/gh/apache/incubator-superset/pull/9484?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/4485800e2118f8bc1424bdf67d2200eb5f0056ac&el=desc) will **not change** coverage by `%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/9484/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/9484?src=pr&el=tree)
   
   ```diff
   @@           Coverage Diff           @@
   ##           master    #9484   +/-   ##
   =======================================
     Coverage   58.76%   58.76%           
   =======================================
     Files         385      385           
     Lines       12237    12237           
     Branches     3020     3020           
   =======================================
     Hits         7191     7191           
     Misses       4862     4862           
     Partials      184      184           
   ```
   
   
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9484?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9484?src=pr&el=footer). Last update [4485800...d03ec41](https://codecov.io/gh/apache/incubator-superset/pull/9484?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [incubator-superset] villebro commented on a change in pull request #9484: [dashboards] Fix, update dashboard owners not propagating to charts o…

Posted by GitBox <gi...@apache.org>.
villebro commented on a change in pull request #9484: [dashboards] Fix, update dashboard owners not propagating to charts o…
URL: https://github.com/apache/incubator-superset/pull/9484#discussion_r405507106
 
 

 ##########
 File path: superset/dashboards/dao.py
 ##########
 @@ -47,6 +47,15 @@ def validate_update_slug_uniqueness(dashboard_id: int, slug: Optional[str]) -> b
             return not db.session.query(dashboard_query.exists()).scalar()
         return True
 
+    @staticmethod
+    def update_charts_owners(model: Dashboard, commit: bool = True) -> Dashboard:
+        owners = [o for o in model.owners]
 
 Review comment:
   I think it would be more lint-friendly to have `owner` in the list comprehension

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [incubator-superset] suddjian commented on a change in pull request #9484: [dashboards] Fix, update dashboard owners not propagating to charts o…

Posted by GitBox <gi...@apache.org>.
suddjian commented on a change in pull request #9484: [dashboards] Fix, update dashboard owners not propagating to charts o…
URL: https://github.com/apache/incubator-superset/pull/9484#discussion_r405716340
 
 

 ##########
 File path: superset/dashboards/dao.py
 ##########
 @@ -47,6 +47,15 @@ def validate_update_slug_uniqueness(dashboard_id: int, slug: Optional[str]) -> b
             return not db.session.query(dashboard_query.exists()).scalar()
         return True
 
+    @staticmethod
+    def update_charts_owners(model: Dashboard, commit: bool = True) -> Dashboard:
+        owners = [owner for owner in model.owners]
+        for slc in model.slices:
+            slc.owners = list(set(owners) | set(slc.owners))
+        if commit:
 
 Review comment:
   Perhaps this commit logic should be moved to a method decorator, for DRYness.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [incubator-superset] suddjian commented on a change in pull request #9484: [dashboards] Fix, update dashboard owners not propagating to charts o…

Posted by GitBox <gi...@apache.org>.
suddjian commented on a change in pull request #9484: [dashboards] Fix, update dashboard owners not propagating to charts o…
URL: https://github.com/apache/incubator-superset/pull/9484#discussion_r405716340
 
 

 ##########
 File path: superset/dashboards/dao.py
 ##########
 @@ -47,6 +47,15 @@ def validate_update_slug_uniqueness(dashboard_id: int, slug: Optional[str]) -> b
             return not db.session.query(dashboard_query.exists()).scalar()
         return True
 
+    @staticmethod
+    def update_charts_owners(model: Dashboard, commit: bool = True) -> Dashboard:
+        owners = [owner for owner in model.owners]
+        for slc in model.slices:
+            slc.owners = list(set(owners) | set(slc.owners))
+        if commit:
 
 Review comment:
   Perhaps this commit logic should be a method decorator, for DRYness.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [incubator-superset] codecov-io edited a comment on issue #9484: [dashboards] Fix, update dashboard owners not propagating to charts o…

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on issue #9484: [dashboards] Fix, update dashboard owners not propagating to charts o…
URL: https://github.com/apache/incubator-superset/pull/9484#issuecomment-611094788
 
 
   # [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9484?src=pr&el=h1) Report
   > Merging [#9484](https://codecov.io/gh/apache/incubator-superset/pull/9484?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-superset/commit/ecfc1f147db1ee56ffa1fa09730a0190bc649ce5&el=desc) will **not change** coverage by `%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-superset/pull/9484/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/incubator-superset/pull/9484?src=pr&el=tree)
   
   ```diff
   @@           Coverage Diff           @@
   ##           master    #9484   +/-   ##
   =======================================
     Coverage   58.77%   58.77%           
   =======================================
     Files         385      385           
     Lines       12239    12239           
     Branches     3022     3022           
   =======================================
     Hits         7193     7193           
     Misses       4862     4862           
     Partials      184      184           
   ```
   
   
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9484?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-superset/pull/9484?src=pr&el=footer). Last update [ecfc1f1...63c8bb0](https://codecov.io/gh/apache/incubator-superset/pull/9484?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [incubator-superset] dpgaspar merged pull request #9484: [dashboards] Fix, update dashboard owners not propagating to charts o…

Posted by GitBox <gi...@apache.org>.
dpgaspar merged pull request #9484: [dashboards] Fix, update dashboard owners not propagating to charts o…
URL: https://github.com/apache/incubator-superset/pull/9484
 
 
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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