Skip to content

fix(deploy): don't fail a successful publish when the app URL lookup is refused - #671

Merged
netanelgilad merged 1 commit into
mainfrom
claude/inspiring-edison-55ncqj
Oct 21, 2026
Merged

netanelgilad merged 1 commit into
mainfrom
claude/inspiring-edison-55ncqj

Conversation

@netanelgilad

@netanelgilad netanelgilad commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Note

Description

base44 deploy --git-hash (and site deploy --publish) exited 1 after the commit was already live, because the step following the publish — getSiteUrl(), which calls the platform route GET /api/apps/platform/{id}/published-url — refuses a workspace API key (BASE44_API_KEY), while every app-scoped call before it accepts the same key. This PR makes that URL lookup best effort: the publish's own errors still fail the command, but a refused URL lookup now leaves PublishedDeployment.appUrl unset and the deploy reports success without the App URL line. It was seen in the first CI deploy of base44/apps-examples's TanStack example, where the server confirmed the publish had gone through.

Related Issue

None. (Making published-url accept workspace keys is a separate apper-side change; this PR stops the CLI from reporting a live deploy as failed either way.)

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Other (please describe):

Changes Made

  • core/site/api.ts: publishDeployment() now wraps getSiteUrl() in .catch(() => undefined) so a refused URL lookup can't fail an already-successful publish, with a comment explaining why.
  • core/site/schema.ts: PublishedDeployment.appUrl is now optional (appUrl?: string), and its doc comment reflects that the URL is only present when it could be looked up.
  • cli/commands/site/deploy.ts: the App URL line is printed only when published?.appUrl is set; the "Not published" hint is now gated on !published so it is not shown for a successful publish with a missing URL.
  • tests/cli/deploy.spec.ts: new case where the publish succeeds but published-url returns 401 — the deploy still succeeds and the commit is recorded as published.
  • CHANGELOG.md: entry under Fixed.

Testing

  • I have tested these changes locally
  • I have added/updated tests as needed
  • All tests pass (npm test)

The new deploy.spec case fails without the fix and passes with it. deploy, site_deploy, static_site_deployments and fullstack_deploy specs: 53 passed. bun run typecheck and bun run lint are clean.

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (if applicable)
  • My changes generate no new warnings
  • I have updated docs/ (AGENTS.md) if I made architectural changes

Additional Notes

No architectural change, so docs/ needed no update — the deployment flow described in docs/deployments.md is unchanged; only the post-publish URL lookup's failure handling differs. The other consumer of appUrl, cli/commands/project/deploy.ts, already guarded on result.appUrl before printing, so it needed no change.


🤖 Generated by Claude | 2026-10-21 13:48 UTC | 556605b

…is refused

The URL lookup after publishing goes through a platform route that refuses a
workspace API key, so `base44 deploy --git-hash` with BASE44_API_KEY exited 1
after putting the commit live. The lookup is now best effort.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Tmb4PCrrV2SLRpBjkGAgXJ
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Package Preview Available!


Install this PR's preview build with npm:

npm i @base44-preview/cli@0.2.0-pr.671.556605b

Prefer not to change any import paths? Install using npm alias so your code still imports base44:

npm i "base44@npm:@base44-preview/cli@0.2.0-pr.671.556605b"

Or add it to your package.json dependencies:

{
  "dependencies": {
    "base44": "npm:@base44-preview/cli@0.2.0-pr.671.556605b"
  }
}

Preview published to npm registry — try new features instantly!

netanelgilad pushed a commit to base44/apps-examples that referenced this pull request Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

Verified end to end with this PR's preview (@base44-preview/cli@0.2.0-pr.671.556605b). In base44/apps-examples' deploy workflow, base44 deploy -y --build --git-hash "$GITHUB_SHA" with a workspace BASE44_API_KEY now exits 0 (App deployed successfully). The same run on 0.2.0 exited 1 at Error fetching site URL. The app serves the run's commit (589542c), and the guestbook page reads and writes its entity.


Generated by Claude Code

@netanelgilad
netanelgilad merged commit 1928919 into main Oct 21, 2026
15 checks passed
@netanelgilad
netanelgilad deleted the claude/inspiring-edison-55ncqj branch October 21, 2026 13:59
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.

2 participants