Repository navigation
fix(sites): deploy handles rebuilt output, symlinks, nested bunny.jsonc, and upload and publish failures - #247
jamie-at-bunny wants to merge 2 commits into
Conversation
…nc, and upload and publish failures
🦋 Changeset detectedLatest commit: 41c7c53 The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
| const { site, offerLink } = await selectSite(coreClient, { | ||
| site: args.site, | ||
| // Site selection reads bunny.jsonc from cwd, so a nested config's name is passed in explicitly. | ||
| site: args.site ?? (cwdConfig ? undefined : siteConfig?.config.name), |
There was a problem hiding this comment.
Nested config overrides linked site
If the working directory has a linked site but no site config, discovering a nested bunny.jsonc overrides that link. Passing its sites.name as args.site makes selectSite treat it as an explicit choice and skip .bunny/site.json. The command can then publish to another site without the user choosing it.
This violates the repository's required order: explicit choice, linked site, then configured name. Use the nested name only after checking the linked site.
Context Used: AGENTS.md (source)
| } catch { | ||
| return true; // Dangling: statSync below finds nothing and it's skipped. |
There was a problem hiding this comment.
Circular links still stop deploys
A circular link such as a -> b -> a aborts the deploy instead of being skipped. realpathSync throws ELOOP, but this catch treats every error as a dangling link and returns true. The following statSync throws again because throwIfNoEntry: false does not suppress ELOOP.
Skip unresolved circular links before calling statSync, and add a test for a link chain that loops. The current test only covers a directory pointing back to an ancestor.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f53b00247e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const { site, offerLink } = await selectSite(coreClient, { | ||
| site: args.site, | ||
| // Site selection reads bunny.jsonc from cwd, so a nested config's name is passed in explicitly. | ||
| site: args.site ?? (cwdConfig ? undefined : siteConfig?.config.name), |
There was a problem hiding this comment.
Preserve linked-site precedence for nested configurations
When a deploy is launched from a monorepo root containing .bunny/site.json and the selected directory is under a nested bunny.jsonc with sites.name, passing that name through site makes selectSite() treat it as an explicit reference and bypass the linked-site lookup. This reverses the documented explicit → manifest → config precedence and can publish the nested build to the config-named production site instead of the linked site; provide the nested name as a configuration fallback after manifest resolution rather than as args.site.
Useful? React with 👍 / 👎.
| const deployId = | ||
| alreadyUploaded?.id ?? (shaTaken ? identity.contentHash : identity.id); |
There was a problem hiding this comment.
Mark hash-fallback deployments as content-derived
When a clean git SHA is already associated with different bytes, this branch changes the selected ID to identity.contentHash but leaves identity.source as "git". The newly written DeployRecord and the deploy command's JSON response therefore claim that the content-hash ID was chosen from git, and deployments list renders the original SHA as its source; carry a content-derived source through DeployTarget when this fallback is selected.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
This review was skipped because it would exceed your organization's monthly flex usage limit. Raise the limit in billing settings or wait until the next billing period resets limits.
Fixes
bunny sites deployedge cases around rebuilt output, symlinks, nested config, and failed uploads or publishes.