-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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(charts): chart publishing UI #32969
base: master
Are you sure you want to change the base?
Conversation
Based on your review schedule, I'll hold off on reviewing this PR until it's marked as ready for review. If you'd like me to take a look now, comment
|
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.
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.
Review by Korbit AI
Korbit automatically attempts to detect when you fix issues in new commits.
Category | Issue | Status |
---|---|---|
Grammatical Error in UI Message ▹ view | ✅ Fix detected | |
Unused Import ▹ view | ✅ Fix detected | |
Typo in Migration Name ▹ view | 🧠 Not in scope | |
Raw SQL Execution in Migration ▹ view | ✅ Fix detected | |
Inefficient Two-Pass Table Operation ▹ view | ✅ Fix detected |
Files scanned
File Path | Reviewed |
---|---|
superset/migrations/versions/2025-03-25_21-03_bd200ee2fd0c_adding_publishing_filed_to_chart.py | ✅ |
superset-frontend/packages/superset-ui-core/src/utils/featureFlags.ts | ✅ |
superset-frontend/src/explore/components/ExploreChartPublish/index.tsx | ✅ |
superset-frontend/src/explore/components/ExploreChartHeader/index.jsx | ✅ |
superset/models/slice.py | ✅ |
superset-frontend/src/pages/ChartList/index.tsx | ✅ |
superset/charts/api.py | ✅ |
superset/charts/schemas.py | ✅ |
superset/config.py | ✅ |
Explore our documentation to understand the languages and file types we support and the files we ignore.
Need a new review? Comment
/korbit-review
on this PR and I'll review your latest changes.Korbit Guide: Usage and Customization
Interacting with Korbit
- You can manually ask Korbit to review your PR using the
/korbit-review
command in a comment at the root of your PR.- You can ask Korbit to generate a new PR description using the
/korbit-generate-pr-description
command in any comment on your PR.- Too many Korbit comments? I can resolve all my comment threads if you use the
/korbit-resolve
command in any comment on your PR.- On any given comment that Korbit raises on your pull request, you can have a discussion with Korbit by replying to the comment.
- Help train Korbit to improve your reviews by giving a 👍 or 👎 on the comments Korbit posts.
Customizing Korbit
- Check out our docs on how you can make Korbit work best for you and your team.
- Customize Korbit for your organization through the Korbit Console.
Feedback and Support
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
from sqlalchemy.dialects import postgresql |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
op.add_column( | ||
"slices", sa.Column("published", sa.Boolean(), nullable=True, default=False) | ||
) | ||
op.execute("UPDATE slices SET published=false") |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
op.add_column( | ||
"slices", sa.Column("published", sa.Boolean(), nullable=True, default=False) | ||
) | ||
op.execute("UPDATE slices SET published=false") |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
"""adding_publishing_filed_to_chart |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
const draftButtonTooltip = t( | ||
'This chart is in draft. This indicated this chart is a work in progress.', | ||
); |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
Hi @ethan-liong. Thank you for the PR. This type of change generally needs a SIP where we can discuss what are the intended use cases and implications of introducing the concept of published/unpublished charts. It's also a good idea to think about the whole feature, given that if we merge the PR as is, we'll have a new status but no immediate applicability for it. You can check #5602 for the SIP template. |
This seems like it's a great idea, but it does seem like it might need a SIP to answer any questions that come up. I'll seed the discussion with a few: |
I'm open to a SIP here, but don't think this is controversial, especially behind a feature flag. As long as it fits the implementation for dashboards, its in many ways is even more needed for Charts, given that there's an order of magnitude more charts than there are dashboards. Some clarifying questions (whether it's for the SIP or PR...)
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #32969 +/- ##
===========================================
+ Coverage 60.48% 83.34% +22.86%
===========================================
Files 1931 550 -1381
Lines 76236 39537 -36699
Branches 8568 0 -8568
===========================================
- Hits 46114 32954 -13160
+ Misses 28017 6583 -21434
+ Partials 2105 0 -2105
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
We have had this feature in our deployment of superset for 2 years now, so I may be able to answer some of these questions based on how we have handled this:
Ideally old charts should stay as draft, but maybe add a way for admins to bulk publish multiple/all charts at once?
Perhaps a chart in a published dashboard can not be unpublished unless the dashboard is also in draft. We also have checks the other way, a dashboard can only be published if all charts within is published
We use a seperate role with special publish perms, but yes only allowing owners and admins would make sense. |
Could be nice and simple if we kept it as simple as "published means the object is discoverable by others, namely in list views (namely the CRUD views and various dropdowns). Draft objects, while they don't show up in lists views, are accessible by others if they happen to have the link, or say if they happen to open a dashboard composed of draft chart". It can be tricky to cascade things from say dashboard to charts, say when you publish a dashboard, do we need to ask the user whether they want to publish the charts it's made out of? Some of them? What about if/when they add a new chart to a published dashboard, should it auto-publish the new chart? I'd say we keep it simple and allow users to publish individual object without cascading |
Thanks for the feedback. So currently this PR is just in a state where it’s UI labels. For now, it’s just to kick off the thought process as to accountability and visibility of “charts in draft”. Right now it's just a sign of “hey, im done with this chart, I think it’s in a ready state for people to look at!”. The accountability is to double down on the certification, and to work in tandem with dashboards publication status. More in the answered questions I was really just testing the waters I guess to gauge interest without fully committing to writing a SIP (It’s a little more overwhelming to me to propose a plan rather than just sorta do it and see the interest). To answer a few of those questions:
Questions I can’t answer yet:
With all that in mind and the current state of the PR, i was hoping that since it's feature flag, i could dodge the SIP, but i think for sure that the full vision of whats in mind, i think a SIP would be unavoidable. This was only intended to be the foundational work on which these features, permissions and controls would be added over time. |
My 2 cents:
|
@ethan-liong as part of SIP-152, we're introducing the concept of Viewers to Charts and Dashboards. This means, that once rolled out, Draft/Published is redundant, as read only access will be provided by assigning subjects as Viewers. See my comment #32116 (comment) , more specifically these bullets:
|
awesome! do you know which version of superset this is expected to be released in? thanks! |
I think it's probably still relevant, it's really about the owner of the chart/dashboard saying "ok I want for this dashboard I created to be discoverable by others". That user may not be an Admin so they don't really have the rights to grant access to others... |
SUMMARY
This MR introduces publishing for charts.
At a glance, it doesn't really do much besides provide a UI indicator as to whether a chart is tagged as published or not, but I figure that this might be the start of creating extra additional custom permissions on top of charts that an owner might deemed published and ready for more eyes. This is really just to get a foot in the door towards maybe creating "private" charts.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION