rename migrate-existing guide to add-suga#26
Conversation
9349fe6 to
71396a0
Compare
WalkthroughUpdated documentation navigation and guide content. In docs/docs.json, the Guides dropdown’s second group now lists pages as ["guides/add-suga", "guides/database-migration", "guides/migrate-existing"], inserting "guides/add-suga". In docs/guides/add-suga.mdx, front matter fields were revised (title → "Add Suga to Your Application", sidebarTitle → "Add Suga", description wording changed to "applications"); content adjustments include a bucket declaration change in suga.yaml, Dockerfile formatting tweaks, a modified AWS S3 example using the Suga client with added error handling, a directory name update, and other minor formatting edits. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
docs/guides/add-suga.mdx (1)
237-239: Branding bug: “nitric client” → “Suga client”.Reader-facing correctness.
- // Use the nitric client to access cloud resources + // Use the Suga client to access cloud resources
🧹 Nitpick comments (7)
docs/guides/add-suga.mdx (6)
51-51: Alt text still references “Migrate”.Update for consistency with the new guide name.
-  + 
53-53: “database declaration” is inaccurate (this section defines a bucket).Fix the wording.
- This will automatically add a database declaration to your `suga.yaml`. + This will automatically add a bucket declaration to your `suga.yaml`.
91-106: Pin a stable Go base image or make it configurable.Avoid potential breakage if 1.24 isn’t available; consider a stable tag or a build-arg.
- FROM golang:1.24-alpine as builder + ARG GO_VERSION=1.23 + FROM golang:${GO_VERSION}-alpine as builderPlease verify the currently supported Go versions in CI/docs.
233-242: Handle write errors in the Suga example.Parity with the AWS sample and better DX.
- // Use the Suga client to access cloud resources - app.Files.Write("example.txt", []byte("Hello, "+name+"!")) + // Use the Suga client to access cloud resources + if err := app.Files.Write("example.txt", []byte("Hello, "+name+"!")); err != nil { + log.Printf("Failed to write file: %v", err) + w.WriteHeader(http.StatusInternalServerError) + w.Write([]byte("Error writing file")) + return + }
244-251: Add a default port to avoid empty address.Prevents server starting on “:”.
- port := os.Getenv("PORT") + port := os.Getenv("PORT") + if port == "" { + port = "8080" + } server := &http.Server{ Addr: ":" + port, Handler: router, } - fmt.Printf("Server started on port %s, however use the entrypoint port to connect to the server\n", port) + fmt.Printf("Server started on port %s (use the entrypoint port to connect)\n", port)
332-332: Unify stack directory placeholder.Use one placeholder (“12345”) throughout to reduce confusion.
- cd .suga/stacks/my-app-aws-xyz + cd .suga/stacks/my-app-aws-12345Also applies to: 296-304
docs/docs.json (1)
40-44: Nav update looks good; confirm de-duplication strategy.If “migrate-existing” is being replaced, consider removing it from the Guides list or adding a redirect instead of showing both.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
docs/docs.json(1 hunks)docs/guides/add-suga.mdx(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Build (windows-latest, amd64)
🔇 Additional comments (1)
docs/guides/add-suga.mdx (1)
2-4: Front matter rename looks good.Title/sidebar/description align with the new guide intent.
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (4)
docs/guides/add-suga.mdx (4)
56-84: YAML example: indentation consistency and permission alignment
- Indentation under targets is unusually deep; prefer 2 spaces for readability.
- Prose says grant “Write” and “Delete,” but the YAML also grants “read.” Either add “Read” to the prose or remove it here for consistency.
Suggested tidy-up of the YAML block for clarity:
-targets: - - suga/aws@1 +targets: + - suga/aws@1 name: my-app description: Your project description services: - app: - container: - docker: - dockerfile: Dockerfile - context: . - dev: - script: go run main.go + app: + container: + docker: + dockerfile: Dockerfile + context: . + dev: + script: go run main.go buckets: - files: - access: - app: - - read - - write - - delete + files: + access: + app: + - read + - write + - delete entrypoints: - ingress: - routes: - /: - name: app + ingress: + routes: + /: + name: app
95-110: Dockerfile hardening and reproducibility
- Pin Alpine to a minor (e.g., 3.20) to avoid surprise updates.
- Run as non-root in the runtime image.
-FROM golang:1.24-alpine as builder +FROM golang:1.24-alpine3.20 as builder @@ -FROM alpine:latest +FROM alpine:3.20 @@ -COPY --from=builder /app/main . +COPY --from=builder /app/main /usr/local/bin/main +RUN adduser -D -u 10001 appuser +USER 10001 -ENTRYPOINT ["/main"] +ENTRYPOINT ["/usr/local/bin/main"]
131-133: Go import path placeholder“example/suga” must match your module path (go.mod module + “/suga”). Consider a short note to replace with the project’s actual module path.
312-316: Path formatting consistencyUse the same prefix form for the stack path everywhere (either “./.suga/…” or “.suga/…”). I suggest consistently using “./.suga/…”.
Also applies to: 344-345
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
docs/guides/add-suga.mdx(12 hunks)
🔇 Additional comments (3)
docs/guides/add-suga.mdx (3)
2-4: Front matter rename/readability — looks goodClearer title/sidebar and description. Good SEO and intent.
14-16: Installation link: verify target pathConfirm the URL and anchor still reflect the latest docs IA.
242-248: Nice: unified write + basic error handlingGood example showing Suga client usage with straightforward error handling.
|
🎉 This PR is included in version 0.0.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Basic rename of guide.