Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/publish-lab-env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ name: Publish qBraid Lab environment
# variable QBRAID_ENV_LOGO_URL https URL of a PNG logo (optional; overrides the
# pyqasm light and dark logos in bin/publish_lab_env.py)
# The steps live in bin/publish_lab_env.py and bin/lab_env_smoke_test.py.
# The run approves directly, without a publish request. That skips the per-plan
# publish quota and the email a request sends every platform admin.
# The run files a publish request and then approves it, because the server
# approves only an environment with an open request. The request counts toward
# the key owner's per-plan publish quota and notifies the platform admins.

on:
workflow_dispatch:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Types of changes:
### Removed

### Fixed
- `publish-lab-env.yml` files a publish request before it approves the environment. Since qBraid/qbraid-api#1334 the server approves only an environment with an open request, so every run failed at approve with `Environment must have status REQUESTED or PENDING to publish`. The request counts toward the API key owner's publish quota and notifies the platform admins ([#491](https://github.com/qBraid/pyqasm/pull/491), [#490](https://github.com/qBraid/pyqasm/issues/490)).

### Dependencies

Expand Down
10 changes: 6 additions & 4 deletions bin/publish_lab_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ def should_set_latest(client: Any, settings: Settings, current: Optional[str], s


def publish(settings: Settings, slug: str) -> None:
"""Approve, then add to the group as its latest. Skips steps already done."""
"""Request and approve, then add to the group as its latest. Skips steps already done."""
steps = PUBLISH_STEPS[: PUBLISH_STEPS.index(settings.stop_after) + 1]
group = settings.group
if "publish" in steps and not group:
Expand All @@ -330,9 +330,11 @@ def publish(settings: Settings, slug: str) -> None:
if status == "APPROVED":
print(f"'{slug}' is already approved.")
else:
# Approve works from any status. Skipping the publish request avoids the
# per-plan publish quota and the email that a request sends every admin.
# Approving is what publishes to the catalog: it makes the environment public.
# The server approves only an environment with an open request, so file one
# first. A request counts toward the owner's per-plan publish quota and
# notifies the platform admins. Approving is what makes the environment public.
if status not in ("REQUESTED", "PENDING"):
client.request_publish(slug)
client.approve_publish(slug)
status = review_status(client, slug)
if status != "APPROVED":
Expand Down
Loading