feat(scripts): add deployments publish for rollbacks#92
Conversation
|
@codex review |
🦋 Changeset detectedLatest commit: 856415a 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 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2e14d9ee6d
ℹ️ 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".
Greptile SummaryThis PR adds
Confidence Score: 5/5Safe to merge; the new publish command and hostname-consolidation refactor are correct, well-tested, and consistent with existing patterns. The rollback command is logically sound, the shared hostname helpers are cleanly extracted and guarded, and the tests for findAcrossPages cover the key pagination edge cases. The only new finding is a cosmetic UX gap in list.ts where the hostname fetch happens after the spinner has stopped. No files require special attention beyond the already-flagged issues in publish.ts and list.ts. Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant CLI as publish.ts
participant Compute as Compute API
participant Core as Core API
User->>CLI: bunny scripts deployments publish 42 [id]
CLI->>Compute: "GET /compute/script/{id}/releases (paginated)"
Compute-->>CLI: releases page(s)
CLI->>User: prompt: Publish release 42?
User-->>CLI: yes
CLI->>Compute: "POST /compute/script/{id}/publish/{uuid}"
Compute-->>CLI: (response unchecked)
CLI->>Compute: "GET /compute/script/{id}"
Compute-->>CLI: script (with LinkedPullZones)
CLI->>Core: "GET /pullzone/{id} (per linked zone, parallel)"
Core-->>CLI: hostnames
CLI->>User: Release 42 published. Live at: https://...
Reviews (2): Last reviewed commit: "further refactoring" | Re-trigger Greptile |
| const pubSpin = spinner("Publishing..."); | ||
| pubSpin.start(); | ||
|
|
||
| await client.POST("/compute/script/{id}/publish/{uuid}", { | ||
| params: { path: { id, uuid: release.Uuid } }, | ||
| body: {}, | ||
| }); | ||
|
|
||
| pubSpin.stop(); |
There was a problem hiding this comment.
Publish API error is silently ignored
The response from the POST /compute/script/{id}/publish/{uuid} call is never inspected. If the API returns a 4xx or 5xx error, openapi-fetch does not throw — it returns { data: undefined, error: ... }. The spinner stops normally, and the code continues to print Release X published. (or { published: true } in JSON mode), even though the rollback never happened. Consider destructuring { error } from the response and throwing a UserError when it is truthy.
No description provided.