Skip to content

[3408 by Claude Opus 5.5] Automate the hosted UI (app.propr.dev) deployment for releases. Check current upstream main first. - #3409

Merged
integry merged 3 commits into
mainfrom
3408/claude-opus-5-5-automate-the-hosted-ui-ap-20261031-2319-309
Nov 1, 2026
Merged

integry merged 3 commits into
mainfrom
3408/claude-opus-5-5-automate-the-hosted-ui-ap-20261031-2319-309

Conversation

@propr-dev

@propr-dev propr-dev Bot commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

AI Implementation Summary

Closes #3408

Branch: 3408/claude-opus-5-5-automate-the-hosted-ui-ap-20261031-2319-309
Commits: ✅ Changes committed (de990f6)


AI Processing Completed

Execution Details:

Summary:
The release workflow now deploys app.propr.dev automatically after the GitHub release is published. Nothing was deployed, tagged or published; the job has only been checked offline, never run against Cloudflare. The branch was already at current upstream main (043d9e122), so nothing needed rebasing.

The new job is deploy-hosted-ui in .github/workflows/docker-images.yml:

  • When it runs: after publish-github-release succeeds, with the same condition, so it covers tag pushes and the manual release path. If an earlier release job fails or is skipped, the deploy is skipped too.
  • Where the secrets live: the job runs in the hosted-ui-production environment with read-only repo access. The two Cloudflare secrets are passed only to the credential-check step and the deploy step.
  • Missing secrets: the job prints a "Hosted UI deploy skipped" notice, writes a summary and finishes green, so the already-published release isn't marked failed. A failed deploy or failed check does fail the job, and the summary explains how to re-run or deploy by hand.
  • Build and deploy: it checks out the exact release ref (same expression as the other release jobs). It confirms package.json has the released version, then runs npm ci, npm run build -w propr-ui and wrangler deploy --config wrangler.hosted-ui.toml. Wrangler isn't in any lockfile, so CI pins it to [email protected].
  • Check after deploy: scripts/verify-hosted-ui-release.mjs reads the entry script that index.html actually loads and checks it contains the version string, e.g. "0.9.0". It tries up to 6 times, 20 seconds apart. A real build produces two index-*.js files and only the one index.html loads has the version, so guessing by filename wouldn't work.

npm run deploy:hosted-ui is unchanged.

Tests and lint

  • test/hostedUiReleaseDeploy.test.mjs has 11 tests and all pass. They cover the conditions you listed, the skip behaviour (by running the credential-check shell) and the retry logic. I confirmed the test fails if the token is added to another job.
  • The two existing suites that read this workflow still pass (48 tests), and ESLint is clean.
  • actionlint is clean. The repo doesn't run zizmor, but I ran it anyway: it reports the same 25 findings before and after, all in existing jobs, so the new job adds none.
  • The docs site builds with no broken links.

Docs and changelog: the new page is docs/docs/operations/hosted-ui-release.md, added to the sidebar and linked from deployment.md. It covers creating the token and setting up the environment. The token needs only two permissions, per Cloudflare's Workers authorization docs and custom domains docs:

  • Account > Workers Scripts: Edit, granted for all Workers in the account, because custom domains can't be granted per Worker.
  • Zone > Workers Routes: Edit, limited to propr.dev.

It needs no DNS edit permission. I added an [Unreleased] entry to CHANGELOG.md.

Before the first automated release:

  • First deploy: this token can update the existing propr-hosted-ui Worker but can't create one. If the Worker is ever deleted, someone has to deploy it once by hand.
  • Environment ref rules: if hosted-ui-production only allows v*.*.* tags, a manual release started from main will fail on the environment rule instead of skipping. The docs say to add main if you start manual releases from there.

There are no previews because nothing in this change shows up in the UI.

Detailed Logs:

  • Conversation: 126 messages
  • Session: bddd3443-c04d-40fc-ac36-51b625feb2c9

Log files stored at:

  • conversation: /usr/src/app/logs/executions/issue-3408-2026-10-31T23-27-32-884Z-conversation.json
  • output: /usr/src/app/logs/executions/issue-3408-2026-10-31T23-27-32-884Z-output.txt
Latest Conversation Messages
ASSISTANT: [content unavailable]

ASSISTANT: The release workflow now deploys app.propr.dev automatically after the GitHub release is published. Nothing was deployed, tagged or published; the job has only been checked offline, never run against ...


This PR was created automatically by ProPR after processing issue #3408.


💡 Need changes?

Comment on this PR to request refinements — the AI agent monitors comments and will update the implementation based on your feedback. Keep iterating until you're satisfied!

…e GitHub release is published. Nothing was deployed, tagged or published; the job has only been checked offline, never run against Cloudflare. The branch was already at current upstream main (`043d9e122`), so nothing needed rebasing.

The new job is `deploy-hosted-ui` in `.github/workflows/docker-images.yml`:
- When it runs: after `publish-github-release` succeeds, with the same condition, so it covers tag pushes and the manual release path. If an earlier release job fails or is skipped, the deploy is skipped too.
- Where the secrets live: the job runs in the `hosted-ui-production` environment with read-only repo access. The two Cloudflare secrets are passed only to the credential-check step and the deploy step.
- Missing secrets: the job prints a "Hosted UI deploy skipped" notice, writes a summary and finishes green, so the already-published release isn't marked failed. A failed deploy or failed check does fail the job, and the summary explains how to re-run or deploy by hand.
- Build and deploy: it checks out the exact release ref (same expression as the other release jobs). It confirms `package.json` has the released version, then runs `npm ci`, `npm run build -w propr-ui` and `wrangler deploy --config wrangler.hosted-ui.toml`. Wrangler isn't in any lockfile, so CI pins it to `[email protected]`.
- Check after deploy: `scripts/verify-hosted-ui-release.mjs` reads the entry script that `index.html` actually loads and checks it contains the version string, e.g. `"0.9.0"`. It tries up to 6 times, 20 seconds apart. A real build produces two `index-*.js` files and only the one `index.html` loads has the version, so guessing by filename wouldn't work.

`npm run deploy:hosted-ui` is unchanged.

Tests and lint
- `test/hostedUiReleaseDeploy.test.mjs` has 11 tests and all pass. They cover the conditions you listed, the skip behaviour (by running the credential-check shell) and the retry logic. I confirmed the test fails if the token is added to another job.
- The two existing suites that read this workflow still pass (48 tests), and ESLint is clean.
- actionlint is clean. The repo doesn't run zizmor, but I ran it anyway: it reports the same 25 findings before and after, all in existing jobs, so the new job adds none.
- The docs site builds with no broken links.

Docs and changelog: the new page is `docs/docs/operations/hosted-ui-release.md`, added to the sidebar and linked from `deployment.md`. It covers creating the token and setting up the environment. The token needs only two permissions, per [Cloudflare's Workers authorization docs](https://developers.cloudflare.com/workers/authorization/workers/) and [custom domains docs](https://developers.cloudflare.com/workers/configuration/routing/custom-domains/):
- Account > Workers Scripts: Edit, granted for all Workers in the account, because custom domains can't be granted per Worker.
- Zone > Workers Routes: Edit, limited to `propr.dev`.

It needs no DNS edit permission. I added an `[Unreleased]` entry to `CHANGELOG.md`.

Before the first automated release:
- First deploy: this token can update the existing `propr-hosted-ui` Worker but can't create one. If the Worker is ever deleted, someone has to deploy it once by hand.
- Environment ref rules: if `hosted-ui-production` only allows `v*.*.*` tags, a manual release started from `main` will fail on the environment rule instead of skipping. The docs say to add `main` if you start manual releases from there.

There are no previews because nothing in this change shows up in the UI.
…ion environment

Creates the environment limited to v* tags and main, and stores the
Cloudflare API token and account ID as environment secrets from hidden
prompts. Already used to provision integry/propr.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@integry

integry commented Nov 1, 2026

Copy link
Copy Markdown
Owner

Added scripts/setup-hosted-ui-environment.sh. It's the script that already provisioned hosted-ui-production on integry/propr: v* tags + main only, with secrets CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID. Please reference it from the docs the PR adds.

/review

@propr-dev

propr-dev Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 9dfccf0

Summary of Changes

I added references to scripts/setup-hosted-ui-environment.sh in the docs this PR adds, and in its changelog entry.

Docs changes

  • docs/docs/operations/hosted-ui-release.md, "Add the token to the GitHub environment":
    • The section now starts with the script. It says this is what provisioned hosted-ui-production on integry/propr and that it needs gh with admin rights.
    • It gives example commands: the default run, --reviewer, and --repo/--env.
    • It describes what the script does: it limits the environment to v* tags and main, stores CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID from hidden prompts or from already-exported variables, and is safe to re-run.
    • The manual steps are kept as a fallback.
  • Corrected a mismatch with the real setup: the manual steps said to allow only v*.*.* tags and to add main only if needed. They now say v* and main, which is what the environment actually has. Without the main rule, a manual release started from main would fail on the environment rule instead of deploying. That was the open risk in the original summary, and it no longer applies.
  • "Re-run after a skipped deploy": this paragraph now points to the script for adding the secrets.
  • CHANGELOG.md: the [Unreleased] entry now mentions the script.

The 11 tests in test/hostedUiReleaseDeploy.test.mjs still pass. I didn't rebuild the docs site. I only added code spans and a code block, no new links.

Review of the script
The syntax check (bash -n) passes. I couldn't run the script itself because that would need admin access to the repository. Three things worth knowing:

  1. Re-running without --reviewer might remove an existing reviewer. When the flag isn't passed, the script updates the environment without a reviewer list. I haven't checked whether GitHub keeps the existing required reviewers in that case or clears them. If you ever ran it with --reviewer, check the environment page after any later run without it. The docs only say that existing allowed-ref rules are kept, which the script does handle.
  2. v* is broader than the workflow's v*.*.* trigger. This is harmless: only the release job uses this environment, and that job still only runs for v*.*.* tags or a manual release.
  3. Small cosmetic issues: --repo or --env with no value fails with bash's "unbound variable" message instead of a usage error. --help prints the header with the leading # on each line.

No previews, because nothing here is visible in the UI.


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @integry
  • Time: 3m 2s
  • Tokens: 309,409 (305,115 in / 4,294 out)
  • Cost: $0.32

Undo Changes • View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR
Processing comment ID: 6551054378✓

…sh` in the docs this PR adds, and in its changelog entry.

I added references to `scripts/setup-hosted-ui-environment.sh` in the docs this PR adds, and in its changelog entry.

**Docs changes**
- **`docs/docs/operations/hosted-ui-release.md`, "Add the token to the GitHub environment":**
  - The section now starts with the script. It says this is what provisioned `hosted-ui-production` on integry/propr and that it needs `gh` with admin rights.
  - It gives example commands: the default run, `--reviewer`, and `--repo`/`--env`.
  - It describes what the script does: it limits the environment to `v*` tags and `main`, stores `CLOUDFLARE_API_TOKEN` and `CLOUDFLARE_ACCOUNT_ID` from hidden prompts or from already-exported variables, and is safe to re-run.
  - The manual steps are kept as a fallback.
- **Corrected a mismatch with the real setup:** the manual steps said to allow only `v*.*.*` tags and to add `main` only if needed. They now say `v*` and `main`, which is what the environment actually has. Without the `main` rule, a manual release started from `main` would fail on the environment rule instead of deploying. That was the open risk in the original summary, and it no longer applies.
- **"Re-run after a skipped deploy":** this paragraph now points to the script for adding the secrets.
- **`CHANGELOG.md`:** the `[Unreleased]` entry now mentions the script.

The 11 tests in `test/hostedUiReleaseDeploy.test.mjs` still pass. I didn't rebuild the docs site. I only added code spans and a code block, no new links.

**Review of the script**
The syntax check (`bash -n`) passes. I couldn't run the script itself because that would need admin access to the repository. Three things worth knowing:
1. **Re-running without `--reviewer` might remove an existing reviewer.** When the flag isn't passed, the script updates the environment without a reviewer list. I haven't checked whether GitHub keeps the existing required reviewers in that case or clears them. If you ever ran it with `--reviewer`, check the environment page after any later run without it. The docs only say that existing allowed-ref rules are kept, which the script does handle.
2. **`v*` is broader than the workflow's `v*.*.*` trigger.** This is harmless: only the release job uses this environment, and that job still only runs for `v*.*.*` tags or a manual release.
3. **Small cosmetic issues:** `--repo` or `--env` with no value fails with bash's "unbound variable" message instead of a usage error. `--help` prints the header with the leading `#` on each line.

No previews, because nothing here is visible in the UI.

PR: #3409
Comment by: @integry (ID: 6551054378)
Model: Claude Opus 5.5
@integry

integry commented Nov 1, 2026

Copy link
Copy Markdown
Owner

/review

@propr-dev

propr-dev Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @integry

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

Ready to merge within the visible scope, conditional on the pending Validate Changes check passing. The supplied status shows no failed checks.

✅ Correct release gating — Deployment depends on successful release publication and uses the release tag for both automatic and manual runs.

✅ Scoped credentials and recovery — Cloudflare credentials are confined to the deployment steps, missing credentials produce a clear notice, and failures include recovery guidance.

✅ Requested documentation included — The operations guide references the provisioning script and explains environment setup, verification, and manual deployment.

This was a static review; no commands were run. The original issue text is explicitly truncated, so compliance with omitted requirements could not be assessed.

Merge blockers

No merge blockers.

Suggestions

These are optional follow-ups and are not sent to /fix.

S1: 🟢 Bound individual verification requests

In scripts/verify-hosted-ui-release.mjs:44, consider adding an explicit fetch timeout. The retry count bounds completed attempts, but a stalled request can delay verification until the workflow timeout. This would improve failure diagnostics and recovery speed; the existing job timeout already bounds CI execution.

S2: 🟢 Clarify retained deployment policies

The operations guide says the setup script “limits” access to v* and main, while scripts/setup-hosted-ui-environment.sh deliberately preserves existing deployment policies. Clarify that these are the only policies on a newly created environment, and that existing additional policies remain. This is an optional documentation clarification consistent with the script’s stated preservation behavior.

Score

The implementation covers the visible objective with focused workflow and verifier tests, and the requested documentation follow-up is complete. No merge-blocking defect was established; deployment behavior was reviewed statically rather than exercised against Cloudflare.

Score: 8/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 23s
  • Tokens: 48,144 (47,494 in / 650 out)
  • Cost: $0.40

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix S1 S2

🤖 Review by ProPR

@integry
integry merged commit 23cabf8 into main Nov 1, 2026
44 checks passed
integry added a commit that referenced this pull request Nov 1, 2026
…sted-ui-release-20261101-1053-g99

[3417 by Claude Opus 5.5] Fix the hosted UI release deploy (app.propr.dev) added in #3409. Check current upstream main first.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Automate the hosted UI (app.propr.dev) deployment for releases. Check current upstream main first.

2 participants