You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by am...@apache.org on 2026/10/22 11:27:23 UTC
(superset) 02/03: feat(asset-approval): seed the demo's cast instead of maker/checker/viewer
This is an automated email from the ASF dual-hosted git repository.
amaannawab923 pushed a commit to branch asset-demo
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 8950441224e7fecdd0d3cfb939bd5c457e5aa9b0
Author: amaannawab923 <am...@gmail.com>
AuthorDate: Thu Oct 22 16:51:57 2026 +0530
feat(asset-approval): seed the demo's cast instead of maker/checker/viewer
QA follows the same story the demo recording tells, so the accounts should
be the same people. The seed now creates Alex Rivera (author) and Priya Shah
(second editor) as Alpha editors of the seeded dashboard, chart and dataset,
Sam Carter as the Gamma viewer with read access to the examples, and Morgan
Lee as an Admin who is an editor of nothing -- the account that shows there
is no admin bypass, which previously had to be checked as `admin`, the one
account the guide tells testers not to use. Sales Dashboard keeps exactly
one editor, now Alex.
Display names come from a table, so banners and the queue read "Alex
Rivera" rather than "Alex (QA)". The README's logins table and every step of
the happy flow use the cast; `admin` stays for setup only.
---
README.md | 111 +++++++++++++++--------------
local_extensions/asset-approval/qa/seed.py | 39 +++++++---
2 files changed, 86 insertions(+), 64 deletions(-)
diff --git a/README.md b/README.md
index f190051d8dd..7b5ad3e16e5 100644
--- a/README.md
+++ b/README.md
@@ -88,8 +88,8 @@ docker compose -p asset-approval-qa exec superset-light /app/.venv/bin/superset
docker compose -p asset-approval-qa exec superset-light /app/.venv/bin/python /app/local_extensions/asset-approval/qa/seed.py
```
-This creates the two test accounts, makes them both editors of an example
-dashboard, chart and dataset, and leaves exactly one change waiting for a
+This creates the cast (Alex, Priya, Sam and Morgan), makes Alex and Priya
+editors of an example dashboard, chart and dataset, and leaves exactly one change waiting for a
reviewer. It prints what it set up, and it is safe to re-run at any time.
---
@@ -97,35 +97,38 @@ reviewer. It prints what it set up, and it is safe to re-run at any time.
## Logins
Every account below is a local QA fixture created by `qa/seed.py` (or by
-Superset's own init, for `admin`). None of these passwords are used anywhere
-real.
+Superset's own init, for `admin`). It is the same cast as the demo
+recording. None of these passwords are used anywhere real.
-| user | password | role | editor of | use it for |
-|---|---|---|---|---|
-| `maker` | `general` | Alpha | USA Births Names, the first chart, the first dataset, Sales Dashboard (sole editor) | making changes |
-| `checker` | `general` | Alpha | USA Births Names, the first chart, the first dataset | reviewing them |
-| `viewer` | `general` | Gamma + "Viewer (data access)" | nothing | seeing what everyone else sees |
-| `admin` | `admin` | Admin | nothing | setup, and checking there is no admin bypass |
+| user | name | password | role | editor of | use it for |
+|---|---|---|---|---|---|
+| `alex` | Alex Rivera | `general` | Alpha | USA Births Names, the first chart, the first dataset, Sales Dashboard (sole editor) | the author: making changes |
+| `priya` | Priya Shah | `general` | Alpha | USA Births Names, the first chart, the first dataset | the approver: reviewing them |
+| `sam` | Sam Carter | `general` | Gamma + "Viewer (data access)" | nothing | the viewer: seeing what everyone else sees |
+| `morgan` | Morgan Lee | `general` | Admin | nothing | an admin who is not an editor: proving there is no admin bypass |
+| `admin` | Superset Admin | `admin` | Admin | nothing | setup only |
The seeded assets, all from `superset load-examples`:
| asset | editors | what it is for |
|---|---|---|
-| **USA Births Names** (dashboard) | maker, checker | the main walkthrough: a change here can be approved |
-| **Sales Dashboard** (dashboard) | maker only | the state where nobody else can approve |
-| first chart by id (**Deck.gl Grid** on a fresh load) | maker, checker | the chart walkthrough |
-| first dataset by id (**bart_lines** on a fresh load) | maker, checker | the dataset walkthrough |
+| **USA Births Names** (dashboard) | alex, priya | the main walkthrough: a change here can be approved |
+| **Sales Dashboard** (dashboard) | alex only | the state where nobody else can approve |
+| first chart by id (**Deck.gl Grid** on a fresh load) | alex, priya | the chart walkthrough |
+| first dataset by id (**bart_lines** on a fresh load) | alex, priya | the dataset walkthrough |
-**Test as `maker`, `checker` and `viewer`, not as `admin`.** Admin's blanket
-access deliberately does not count as editorship for approval, so admin sees
+**Test as `alex`, `priya`, `sam` and `morgan`, never as `admin`.**
+Admin's blanket access deliberately does not count as editorship for approval, so admin sees
a more permissive picture than a real user does. Permission and UI bugs only
show up on the non-admin accounts.
-Two editor accounts exist because an author may never approve their own
+Alex and Priya are two editors because an author may never approve their own
work: the gate looks for a *second* editor of the asset, so one account
-cannot demonstrate the flow at all. `viewer` is deliberately an editor of
-nothing: while a change sits in review its bell has no count, it has nothing
-in Approvals, and it sees the asset exactly as it was.
+cannot demonstrate the flow at all. Sam is deliberately an editor of
+nothing: while a change sits in review their bell has no count, they have
+nothing in Approvals, and they see the asset exactly as it was. Morgan is an
+admin who edits nothing, so nothing waits for them and they get no Approve
+button.
Use one browser profile (or a private window) per account, so you can switch
between them without signing out each time.
@@ -135,89 +138,89 @@ between them without signing out each time.
## The happy flow, step by step
Run `qa/seed.py` first (see [Starting over](#starting-over)). It leaves one
-change already waiting: `maker` renamed **USA Births Names** to
+change already waiting: `alex` renamed **USA Births Names** to
"USA Births Names (Q4)" and asked for review. Steps 1–3 look at that change
from each side; step 4 onwards walks a full round yourself. Each step says
what you should see; anything else is a finding.
### A. A change waits for review
-1. **As `viewer`** — open **USA Births Names**.
+1. **As `sam`** — open **USA Births Names**.
- The title is still "USA Births Names". No banner, no badge, and the bell has no count.
- Settings has no Approvals entry for you. Opening `/approvals/` directly says "Nothing needs you right now".
-2. **As `admin`** — open **USA Births Names**.
- - No review banner and no Approve button. Admin is not an editor, and there is no admin bypass.
-3. **As `checker`** — find the change.
+2. **As `morgan`** — open **USA Births Names**.
+ - No review banner and no Approve button. Morgan is an admin but not an editor, and there is no admin bypass.
+3. **As `priya`** — find the change.
- The bell shows **1**; its popover lists USA Births Names under "Needs your review".
- Home → **Pending reviews** lists it.
- **Settings → Manage → Approvals** (or the bell's "View all approvals") lists it as "Needs your review", with a **Review** button.
### B. Review it on the dashboard
-4. **As `checker`** — click **Review**. It opens the dashboard itself.
- - A banner reads "Reviewing changes from Maker (QA) · N changes", with **Show changes**, **What changed** and **Open live version**.
+4. **As `priya`** — click **Review**. It opens the dashboard itself.
+ - A banner reads "Reviewing changes from Alex Rivera · N changes", with **Show changes**, **What changed** and **Open live version**.
- The **Review changes** panel opens on its own, beside the charts. It shows the field diff (`dashboard_title`: old struck through, new in green), an "Add to the note" box, and **Request changes** / **Approve** pinned to its footer.
- **Show changes** previews the dashboard as it would look approved.
-5. **As `checker`** — press **Edit dashboard**.
- - A dialog says "Maker (QA) is changing this dashboard", with when it was saved and **View changes**. Only one change per asset can be open. Cancel.
-6. **As `checker`** — **Request changes**, type a note, send.
-7. **As `maker`** — open **USA Births Names**.
- - The banner says checker requested changes and shows the note.
+5. **As `priya`** — press **Edit dashboard**.
+ - A dialog says "Alex Rivera is changing this dashboard", with when it was saved and **View changes**. Only one change per asset can be open. Cancel.
+6. **As `priya`** — **Request changes**, type a note, send.
+7. **As `alex`** — open **USA Births Names**.
+ - The banner says Priya requested changes and shows the note.
- The bell lists it under "Returned to you".
### C. Make and send a change yourself
-8. **As `maker`** — **Edit dashboard**, change the title, **Save**.
+8. **As `alex`** — **Edit dashboard**, change the title, **Save**.
- The toast says "Changes saved. Viewers still see the live version."
- The banner reads "Viewing your changes … viewers still see the live version", with **Show changes**, **What changed** and **Request review**.
- - Check as `viewer` in the other window: still the old title.
-9. **As `maker`** — **Request review**.
- - The dialog shows "Who can approve: Checker (QA)", an optional "Ask someone specific" picker, and "Your changes lock while they wait. Editing withdraws the request."
- - Add a note and send. The banner turns to "Awaiting review … Checker (QA) can approve", and you are never offered an Approve button.
+ - Check as `sam` in the other window: still the old title.
+9. **As `alex`** — **Request review**.
+ - The dialog shows "Who can approve: Priya Shah", an optional "Ask someone specific" picker, and "Your changes lock while they wait. Editing withdraws the request."
+ - Add a note and send. The banner turns to "Awaiting review … Priya Shah can approve", and you are never offered an Approve button.
### D. Approve it
-10. **As `checker`** — open the dashboard again (bell or Approvals) and press **Approve** in the panel.
+10. **As `priya`** — open the dashboard again (bell or Approvals) and press **Approve** in the panel.
- It asks first: "Approve and publish? Viewers see these changes right away. The current version moves to version history."
- Confirm. The banner disappears and the new title is live.
-11. **As `viewer`** — reload. The new title is there now.
-12. **As `checker`** — **⋯ → View version history**. The approval is the newest entry.
+11. **As `sam`** — reload. The new title is there now.
+12. **As `priya`** — **⋯ → View version history**. The approval is the newest entry.
### E. Charts
-13. **As `maker`** — open the seeded chart in Explore, change its name, **Save**.
- - The chart shows the "viewers still see the live version" banner. **Charts** lists it with a **Changes pending** tag. As `viewer`, the chart keeps its old name.
-14. **As `maker`** — **Request review** from the chart's banner.
-15. **As `checker`** — **Settings → Manage → Approvals → Review**, then Approve. The new name goes live.
+13. **As `alex`** — open the seeded chart in Explore, change its name, **Save**.
+ - The chart shows the "viewers still see the live version" banner. **Charts** lists it with a **Changes pending** tag. As `sam`, the chart keeps its old name.
+14. **As `alex`** — **Request review** from the chart's banner.
+15. **As `priya`** — **Settings → Manage → Approvals → Review**, then Approve. The new name goes live.
### F. Datasets
-16. **As `maker`** — **Datasets → edit** the seeded dataset, change something (for example a metric label on the Metrics tab), **Save**, **Confirm**.
+16. **As `alex`** — **Datasets → edit** the seeded dataset, change something (for example a metric label on the Metrics tab), **Save**, **Confirm**.
- The toast says the changes are saved and viewers still see the live version, with a **Review changes →** link.
-17. **As `maker`** — follow **Review changes →**. It opens Approvals filtered to "Submitted by me".
+17. **As `alex`** — follow **Review changes →**. It opens Approvals filtered to "Submitted by me".
- The dataset row is a Draft with **Request review**. Send it. The row flips to "Awaiting review".
-18. **As `checker`** — **Approvals → Review** on the dataset row.
+18. **As `priya`** — **Approvals → Review** on the dataset row.
- The "Review dataset changes" dialog opens on the tab that changed (Source / Metrics / Columns).
- It shows live struck through beside proposed in green, and how many charts and dashboards use the dataset.
- **Approve**. The change goes live.
### G. Deletes wait too
-19. **As `maker`** — delete the seeded chart from the **Charts** list and confirm.
+19. **As `alex`** — delete the seeded chart from the **Charts** list and confirm.
- The toast says the delete was submitted for review and nothing has been removed. The chart is still listed.
- - Approving it as `checker` removes it; request changes to keep it.
+ - Approving it as `priya` removes it; request changes to keep it.
### H. When nobody else can approve
-20. **As `maker`** — on **Sales Dashboard** (maker is its only editor), change the title, **Save**, **Request review**.
+20. **As `alex`** — on **Sales Dashboard** (Alex is its only editor), change the title, **Save**, **Request review**.
- The dialog says "No one else can approve this dashboard. Add another editor to submit.", with an **Editors** picker and "Changing editors doesn't need approval."
-21. **As `maker`** — add **Checker (QA)** in that picker.
- - The warning clears in place and the dialog switches to "Who can approve: Checker (QA)". Send.
- - Run the seed again afterwards to make maker the only editor again.
+21. **As `alex`** — add **Priya Shah** in that picker.
+ - The warning clears in place and the dialog switches to "Who can approve: Priya Shah". Send.
+ - Run the seed again afterwards to make Alex the only editor again.
### I. The rules, from the outside
-22. **As `admin`** — **Settings → Manage → Change review** opens a read-only page.
+22. **As `morgan`** — **Settings → Manage → Change review** opens a read-only page.
- "Require review before changes go live" — "Set in the instance configuration. Changing it needs a restart."
- The four facts below it, including **Admin bypass: Not available**.
23. **Any editor, through the API** — a direct save returns **202** with "Changes saved. Viewers still see the live version.", and the live object does not change:
diff --git a/local_extensions/asset-approval/qa/seed.py b/local_extensions/asset-approval/qa/seed.py
index fd3f6825540..0d3a6c88238 100644
--- a/local_extensions/asset-approval/qa/seed.py
+++ b/local_extensions/asset-approval/qa/seed.py
@@ -24,9 +24,11 @@ with exactly one change waiting for a reviewer.
docker compose -p asset-approval-qa exec superset-light \
python /app/local_extensions/asset-approval/qa/seed.py
-Two users, because the point of maker-checker is that an author cannot
-approve their own work: the gate looks for a *second* editor of the asset,
-so one account can never demonstrate the flow.
+The cast is the one the demo recording uses. Alex and Priya are two
+editors, because the point of maker-checker is that an author cannot approve
+their own work: the gate looks for a *second* editor of the asset, so one
+account can never demonstrate the flow. Sam only views, and Morgan is an
+admin who edits nothing, which is how a tester sees there is no admin bypass.
"""
from __future__ import annotations
@@ -35,9 +37,19 @@ import sys
from superset.app import create_app
-MAKER = "maker"
-CHECKER = "checker"
-VIEWER = "viewer"
+MAKER = "alex" # the author: makes the changes
+CHECKER = "priya" # the second editor: reviews them
+VIEWER = "sam" # sees only what is live
+ADMIN = "morgan" # an admin, but an editor of nothing: no bypass
+ADMIN_ROLE = "Admin"
+
+# Display names, so banners and the queue read like the recording.
+NAMES = {
+ MAKER: ("Alex", "Rivera"),
+ CHECKER: ("Priya", "Shah"),
+ VIEWER: ("Sam", "Carter"),
+ ADMIN: ("Morgan", "Lee"),
+}
PASSWORD = "general" # noqa: S105 -- a local QA fixture, never a deployment
ROLE = "Alpha"
@@ -103,10 +115,11 @@ def ensure_user(username: str, role_name: str = ROLE):
if user := security_manager.find_user(username=username):
return user
role = security_manager.find_role(role_name)
+ first_name, last_name = NAMES.get(username, (username.capitalize(), "(QA)"))
user = security_manager.add_user(
username=username,
- first_name=username.capitalize(),
- last_name="(QA)",
+ first_name=first_name,
+ last_name=last_name,
email=f"{username}@example.invalid",
role=role,
password=PASSWORD,
@@ -184,6 +197,10 @@ def main() -> None:
viewer = ensure_user(VIEWER, VIEWER_BASE_ROLE)
grant_extra_role(viewer, VIEWER_ROLE)
+ # Admin, and deliberately an editor of nothing, so "no admin bypass"
+ # can be seen rather than taken on trust.
+ ensure_user(ADMIN, ADMIN_ROLE)
+
# Either title: an approved run leaves the dashboard carrying the
# proposed one, and resetting after walking the flow is exactly when
# this is run. Looking only for the original name would fail there,
@@ -213,7 +230,7 @@ def main() -> None:
# One asset with a single editor, so an author can reach the state
# where there is no one to send the change to and the dialog has to
- # say so. `maker` alone, because `maker` is who the walkthrough is.
+ # say so. Alex alone, because Alex is who the walkthrough is.
solo = (
db.session.query(Dashboard)
.filter_by(dashboard_title=SOLO_DASHBOARD_TITLE)
@@ -270,8 +287,10 @@ def main() -> None:
print()
print("Ready.")
- print(f" logins {MAKER} / {CHECKER} / {VIEWER} (password: {PASSWORD})")
+ logins = " / ".join((MAKER, CHECKER, VIEWER, ADMIN))
+ print(f" logins {logins} (password: {PASSWORD})")
print(f" {VIEWER:12} sees only what is live -- editor of nothing")
+ print(f" {ADMIN:12} Admin, editor of nothing -- no bypass")
print(f" no approver {SOLO_DASHBOARD_TITLE}: {MAKER} is its only editor")
print(f" waiting {queue['count']} change(s) for {CHECKER}")
if queue["count"]: