Skip to content

fix(lab-env): request publication before approving the environment - #491

Merged
TheGupta2012 merged 2 commits into
mainfrom
fix/lab-env-request-before-approve
Nov 19, 2026
Merged

TheGupta2012 merged 2 commits into
mainfrom
fix/lab-env-request-before-approve

Conversation

@TheGupta2012

Copy link
Copy Markdown
Member

Why

The 1.4.0 staging run of publish-lab-env.yml failed at approve: Environment must have status REQUESTED or PENDING to publish (current: NONE). Since qBraid/qbraid-api#1334 (2026-10-27), the server approves only an environment with an open publish request. The script approved directly, so every run now fails there.

What changed

  • publish() in bin/publish_lab_env.py calls request_publish before approve_publish when the status is NONE or DENIED. An open request (REQUESTED or PENDING) is approved as before.
  • The workflow header comment now describes the request.

Tradeoffs

The request counts toward the API key owner's per-plan publish quota (Free 3, Standard 10, Pro 50, Enterprise unlimited) and notifies the platform admins. No server path approves without a request, so the run cannot avoid either. If the owner's quota is full, the request fails with a 403, and the account's tier must change on that server.

Verification

  • With a stub client, the old code fails on status NONE with the same 400 as the real run. The new code requests and then approves for NONE and DENIED, approves directly for REQUESTED and PENDING, and skips APPROVED.
  • tox -e format-check passes.
  • After merge, resuming the staging run with slug=pyqasm_s5z53j is the live check.

Closes #490

TheGupta2012 and others added 2 commits November 19, 2026 12:23
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
qbraid-api now approves only an environment with an open publish
request, so the direct approve failed with status NONE. File the request
first when the status is NONE or DENIED.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@argus-eye

argus-eye Bot commented Nov 19, 2026

Copy link
Copy Markdown

Argus review

Auto-review is off for this repo. Tick the box below to run a review on this PR.

  • Trigger Argus review

Estimated cost

  • Files changed: 3
  • Diff lines (±): 16
  • Historical avg: ~337.1k tokens · ~$1.17 · across last 18 review(s)

Tip: you can also comment @argus-eye review at any time.

@TheGupta2012
TheGupta2012 deployed to env-publish-staging November 19, 2026 06:56 — with GitHub Actions Active
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@TheGupta2012

Copy link
Copy Markdown
Member Author

Live check on staging: published

I ran publish-lab-env.yml from this branch on staging, resuming the environment that the failed 1.4.0 run uploaded: run 44475839271.

Inputs: target=staging, version=1.4.0, stop_after=publish, set_latest=true, slug=pyqasm_s5z53j.

Preflight: Group 'qbraid_0m09zy' found; current latest: qbraid_lilb76
Approve and add to the group: Approved 'pyqasm_s5z53j'.
Approve and add to the group: 'pyqasm_s5z53j' is in group 'qbraid_0m09zy'; latest: pyqasm_s5z53j.

The same environment failed on main with Environment must have status REQUESTED or PENDING to publish (current: NONE) in run 44474891548. Build, smoke test and upload were skipped this time because the slug resumed the earlier upload.

@TheGupta2012
TheGupta2012 merged commit e3a202f into main Nov 19, 2026
17 checks passed

This branch was successfully deployed

1 active deployment
env-publish-staging — 19c37f14 Deployed Nov 19, 2026 by TheGupta2012 via Build and publish on staging #8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Lab environment publish fails at approve: environment must have status REQUESTED or PENDING

2 participants