From 6a98934d20399cb1e6a6c27199d7e47f38c1e41f Mon Sep 17 00:00:00 2001 From: Clea Aumont Date: Tue, 1 Dec 2026 12:19:49 -0500 Subject: [PATCH 1/4] test cicd --- dash-news/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dash-news/app.py b/dash-news/app.py index 707e4ab..5793814 100644 --- a/dash-news/app.py +++ b/dash-news/app.py @@ -145,7 +145,7 @@ def process_news_data(news_articles, current_page, articles_per_page=15): ), html.Div( [ - html.Label("Select Category:", className="dropdown-label"), + html.Label("Choose a Category:", className="dropdown-label"), dcc.Dropdown( id="category-dropdown", options=CATEGORIES, From 3b0cc14308e44443eb239be4a88f43764dde1e09 Mon Sep 17 00:00:00 2001 From: Clea Aumont Date: Tue, 1 Dec 2026 12:29:28 -0500 Subject: [PATCH 2/4] ci fix --- .github/scripts/plotly_cloud_ci.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/scripts/plotly_cloud_ci.py b/.github/scripts/plotly_cloud_ci.py index aca9c8c..3ee2fdb 100644 --- a/.github/scripts/plotly_cloud_ci.py +++ b/.github/scripts/plotly_cloud_ci.py @@ -73,7 +73,8 @@ def team_id(c) -> str: sys.exit("PLOTLY_TEAM is not set") r = c.get("/teams") r.raise_for_status() - teams = r.json() + # Shape: {"teams": [{"team": {"id", "name", ...}, "role": ...}, ...]} + teams = [m["team"] for m in r.json()["teams"]] for t in teams: if wanted.lower() in (t.get("name", "").lower(), t.get("id", "").lower()): return t["id"] From 160ac034ddf11a3ac67484a520d50a5e9d0b16ce Mon Sep 17 00:00:00 2001 From: Clea Aumont Date: Tue, 1 Dec 2026 12:36:46 -0500 Subject: [PATCH 3/4] ci fix --- .github/scripts/plotly_cloud_ci.py | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/.github/scripts/plotly_cloud_ci.py b/.github/scripts/plotly_cloud_ci.py index 3ee2fdb..6c66fa3 100644 --- a/.github/scripts/plotly_cloud_ci.py +++ b/.github/scripts/plotly_cloud_ci.py @@ -18,6 +18,7 @@ import json import os +import re import shutil import subprocess import sys @@ -102,6 +103,27 @@ def app_link(app: dict | None) -> str: return "(url unavailable)" +def url_slug(name: str) -> str: + """App name -> subdomain: lowercase, anything not [a-z0-9] becomes '-'.""" + return re.sub(r"[^a-z0-9]+", "-", name.lower()).strip("-") + + +def ensure_url(c, app: dict | None, name: str) -> dict | None: + """Point the app at .plotly.app. Warns (doesn't fail) if the + URL is taken, since subdomains are unique across all of Plotly Cloud.""" + if not app: + return app + slug = url_slug(name) + if app.get("app_url") == slug: + return app + r = c.put(f"/app/{app['id']}", json={"appUrl": slug}) + if r.is_success: + log(f"Set URL of {name} to {slug}.plotly.app") + return {**app, "app_url": slug} + log(f"warning: could not set URL of {name} to '{slug}': {r.status_code} {r.text}") + return app + + def publish(project: Path, tid: str, *, app_id: str | None = None, name: str | None = None) -> None: cmd = [ "plotly", "app", "publish", @@ -150,7 +172,7 @@ def cmd_staging(apps: list[str]) -> None: else: log(f"Creating {name}") publish(project, tid, name=name) - deployed = find_by_name(team_apps(c, tid), name) + deployed = ensure_url(c, find_by_name(team_apps(c, tid), name), name) summary(f"- **{app}** → {app_link(deployed)}") @@ -202,7 +224,7 @@ def cmd_production(apps: list[str]) -> None: log(f"Creating {name}") publish(project, tid, name=name) - deployed = find_by_name(team_apps(c, tid), name) or target + deployed = ensure_url(c, find_by_name(team_apps(c, tid), name) or target, name) summary(f"- **{app}** → {app_link(deployed)}") From 3a0e18ea697145d85f620b669841d61d1fa80a3b Mon Sep 17 00:00:00 2001 From: Clea Aumont Date: Tue, 1 Dec 2026 12:42:10 -0500 Subject: [PATCH 4/4] changes --- .github/scripts/plotly_cloud_ci.py | 21 +++++++++++++++++++-- dash-news/app.py | 4 ++-- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/.github/scripts/plotly_cloud_ci.py b/.github/scripts/plotly_cloud_ci.py index 6c66fa3..21cd95f 100644 --- a/.github/scripts/plotly_cloud_ci.py +++ b/.github/scripts/plotly_cloud_ci.py @@ -124,6 +124,19 @@ def ensure_url(c, app: dict | None, name: str) -> dict | None: return app +def ensure_visibility(c, app: dict | None, name: str, *, private: bool) -> dict | None: + """Set "Anyone with the link" access: private = No access, public = Can view. + Team-member edit rights aren't exposed by the API; set those in the app's + Sharing settings.""" + if not app or app.get("is_view_private") is private: + return app + r = c.put(f"/app/{app['id']}", json={"isViewPrivate": "private" if private else "public"}) + if r.is_success: + log(f"Set {name} to {'private' if private else 'public'}") + return {**app, "is_view_private": private} + sys.exit(f"Setting visibility of {name} failed: {r.status_code} {r.text}") + + def publish(project: Path, tid: str, *, app_id: str | None = None, name: str | None = None) -> None: cmd = [ "plotly", "app", "publish", @@ -172,7 +185,9 @@ def cmd_staging(apps: list[str]) -> None: else: log(f"Creating {name}") publish(project, tid, name=name) - deployed = ensure_url(c, find_by_name(team_apps(c, tid), name), name) + deployed = find_by_name(team_apps(c, tid), name) + deployed = ensure_visibility(c, deployed, name, private=True) + deployed = ensure_url(c, deployed, name) summary(f"- **{app}** → {app_link(deployed)}") @@ -224,7 +239,9 @@ def cmd_production(apps: list[str]) -> None: log(f"Creating {name}") publish(project, tid, name=name) - deployed = ensure_url(c, find_by_name(team_apps(c, tid), name) or target, name) + deployed = find_by_name(team_apps(c, tid), name) or target + deployed = ensure_visibility(c, deployed, name, private=False) + deployed = ensure_url(c, deployed, name) summary(f"- **{app}** → {app_link(deployed)}") diff --git a/dash-news/app.py b/dash-news/app.py index 5793814..f9d0c7a 100644 --- a/dash-news/app.py +++ b/dash-news/app.py @@ -169,11 +169,11 @@ def process_news_data(news_articles, current_page, articles_per_page=15): html.Div( [ html.Button( - "Previous", id="prev-button", className="pagination-btn" + "← Previous", id="prev-button", className="pagination-btn" ), html.Span(id="page-info", className="page-info"), html.Button( - "Next", id="next-button", className="pagination-btn" + "Next →", id="next-button", className="pagination-btn" ), ], className="pagination-container",