Skip to content

Use api.staging.st0x.io for preview#111

Merged
graphite-app[bot] merged 1 commit into
mainfrom
feature/preview-api-domain
May 26, 2026
Merged

Use api.staging.st0x.io for preview#111
graphite-app[bot] merged 1 commit into
mainfrom
feature/preview-api-domain

Conversation

@findolor
Copy link
Copy Markdown
Collaborator

@findolor findolor commented May 21, 2026

Summary

  • switch the preview NixOS virtual host to api.staging.st0x.io
  • update preview docs and helper script defaults to use the same hostname
  • keep production api.st0x.io untouched

Context

The preview environment now uses api.staging.st0x.io, backed by the staging reserved IP. Production deployment and production hostname configuration are unchanged.

Validation

  • verified no remaining api.preview.st0x.io or preview.api.st0x.io references in preview config/docs/scripts
  • deployed preview successfully
  • verified https://api.staging.st0x.io/health returns HTTP 200
  • verified an authenticated /v1/tokens request against staging returns HTTP 200 with a staging-only temporary key, then deleted that key

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 21, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Standardize the preview hostname to preview.api.st0x.io across docs and scripts; add a Nix tfImport task and tfSecret wiring; add preview bootstrap SSH variable and example; update Terraform preview resources for lifecycle/user_data/depends_on; and run imports plus conditional replace in the preview CI workflow.

Changes

Preview Hostname Update & Preview Infra

Layer / File(s) Summary
NixOS virtualHost configuration
flake.nix
Preview NixOS configuration's virtualHost DNS name updated to preview.api.st0x.io and tfImport exposed in the flake packages scope.
Deployment guide DNS and smoke-test env
DEPLOY.md
Update DNS guidance and preview smoke-test API_URL example to use preview.api.st0x.io.
Operations health checks and SSH guidance
docs/ops.md
Update curl health-check examples and SSH/journalctl guidance to target preview.api.st0x.io.
Smoke test and uptime monitor script defaults
scripts/smoke.sh, scripts/uptimerobot-setup.sh
Update default/commented API_URL values and monitor creation default to https://preview.api.st0x.io.
Terraform preview bootstrap variable and example
infra/variables.tf, infra/terraform.tfvars.example
Add preview_bootstrap_ssh_public_key variable and example tfvars entry for initial droplet bootstrap SSH access.
Terraform preview resources: volume, droplet, reserved IP wiring
infra/main.tf
Add lifecycle ignores for preview volume and droplet; inject user_data YAML to set ssh_authorized_keys; add depends_on for reserved IP assignment.
Nix task: tfImport
infra/default.nix
Add tfImport rainix task and tfSecretVars/decryptVars wiring to support importing Terraform-managed preview resources with encrypted state.
CI: provision preview infra imports
.github/workflows/deploy-preview.yaml
Add recreate_host workflow input and run nix run .#tfInit plus three nix run .#tfImport calls (failures tolerated), then conditional tfPlan with -replace when requested and subsequent tfApply/tfRekey.
Preview config registry
config/preview.toml
Replace external registry_url with an inline base64-encoded registry payload.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • hardyjosh
  • JuaniRios

Poem

🐇 I hopped through docs and infra bright,
Swapped hostnames so previews work right.
Keys in cloud-init, imports take flight,
CI runs imports into the night.
Preview’s ready — hop, delight!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title states 'Use api.staging.st0x.io for preview' but the PR actually implements 'preview.api.st0x.io' - the hostname is reversed and incorrect. Change the title to 'Use preview.api.st0x.io for preview' to accurately reflect the actual hostname change implemented in the pull request.
✅ Passed checks (4 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/preview-api-domain

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Collaborator Author

findolor commented May 21, 2026


How to use the Graphite Merge Queue

Add the label add-to-gt-merge-queue to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@findolor findolor self-assigned this May 21, 2026
@findolor findolor marked this pull request as ready for review May 21, 2026 09:02
@findolor findolor force-pushed the feature/preview-api-domain branch 7 times, most recently from 6d5a8da to 19a27bf Compare May 21, 2026 10:18
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
infra/variables.tf (1)

49-53: ⚡ Quick win

Add format validation for preview_bootstrap_ssh_public_key.

This currently accepts any string; a malformed key won’t fail until much later. Add a variable validation block to fail early during plan/apply.

Suggested diff
 variable "preview_bootstrap_ssh_public_key" {
   description = "Public SSH key authorized on the preview droplet before NixOS bootstrap"
   type        = string
   default     = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPTd2zKSwHgWegi290EiK5nYp1Wp4+x2fDYqFxbd0WLN"
+
+  validation {
+    condition     = can(regex("^ssh-(ed25519|rsa)\\s+[A-Za-z0-9+/=]+(?:\\s+.+)?$", var.preview_bootstrap_ssh_public_key))
+    error_message = "preview_bootstrap_ssh_public_key must be a valid SSH public key."
+  }
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@infra/variables.tf` around lines 49 - 53, The variable
preview_bootstrap_ssh_public_key currently accepts any string; add a Terraform
variable validation block on preview_bootstrap_ssh_public_key to assert the
value matches a valid SSH public key pattern (e.g., starts with a known key type
like "ssh-ed25519", "ssh-rsa", "ecdsa-sha2-nistp256", etc., followed by the
base64 blob and optional comment) and provide a clear error_message on failure;
update the variable block in infra/variables.tf to include the validation rule
so plan/apply fails fast for malformed keys.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/deploy-preview.yaml:
- Around line 79-81: The current commands using "nix run .#tfImport -- -var
preview_enabled=true 'digitalocean_volume.preview_data[0]' ..." (and the similar
calls for digitalocean_droplet.preview_nixos[0] and
digitalocean_reserved_ip.preview_nixos[0]) swallow all errors via "|| true";
change this so the tfImport invocation runs normally and only treats the run as
successful if its stdout/stderr indicates the specific “already in
state”/“already managed” message, otherwise propagate a non‑zero exit (fail the
step). Implement this by removing the trailing "|| true", capturing the command
output/exit code for each nix run .#tfImport call, checking the output for the
known Terraform import-already-in-state text, and exit 0 only when that text is
present; for any other errors, exit non-zero so the workflow fails. Ensure the
logic applies to all three tfImport invocations referenced above.

---

Nitpick comments:
In `@infra/variables.tf`:
- Around line 49-53: The variable preview_bootstrap_ssh_public_key currently
accepts any string; add a Terraform variable validation block on
preview_bootstrap_ssh_public_key to assert the value matches a valid SSH public
key pattern (e.g., starts with a known key type like "ssh-ed25519", "ssh-rsa",
"ecdsa-sha2-nistp256", etc., followed by the base64 blob and optional comment)
and provide a clear error_message on failure; update the variable block in
infra/variables.tf to include the validation rule so plan/apply fails fast for
malformed keys.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: aa272070-0b3d-4a9b-b723-f38824a09f97

📥 Commits

Reviewing files that changed from the base of the PR and between 6580777 and 19a27bf.

📒 Files selected for processing (10)
  • .github/workflows/deploy-preview.yaml
  • DEPLOY.md
  • docs/ops.md
  • flake.nix
  • infra/default.nix
  • infra/main.tf
  • infra/terraform.tfvars.example
  • infra/variables.tf
  • scripts/smoke.sh
  • scripts/uptimerobot-setup.sh
✅ Files skipped from review due to trivial changes (4)
  • DEPLOY.md
  • docs/ops.md
  • infra/terraform.tfvars.example
  • scripts/smoke.sh

Comment thread .github/workflows/deploy-preview.yaml Outdated
@findolor findolor force-pushed the feature/preview-api-domain branch 4 times, most recently from 42a41f4 to b48bc36 Compare May 21, 2026 14:00
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
.github/workflows/deploy-preview.yaml (1)

84-86: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Don't swallow all tfImport failures with || true.

|| true masks every failure mode (bad ID, auth errors, API throttling), not only the benign "already in state" case. Capture stderr and only treat the "already managed by Terraform" message as success; otherwise fail the step.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/deploy-preview.yaml around lines 84 - 86, The workflow
currently appends "|| true" to every nix run .#tfImport invocation which masks
all failures; instead run each tfImport command and capture its stderr/stdout,
then if it exits non‑zero examine the output for the specific Terraform message
that indicates the resource is "already managed by Terraform" and treat only
that case as success (exit 0); for any other error (bad ID, auth, rate limit,
etc.) re‑exit non‑zero so the step fails. Apply this change to the tfImport
invocations (the three nix run .#tfImport lines for
digitalocean_volume.preview_data[0], digitalocean_droplet.preview_nixos[0], and
digitalocean_reserved_ip.preview_nixos[0]) so they inspect stderr for the benign
message before deciding to ignore the error.
🧹 Nitpick comments (2)
infra/terraform.tfvars.example (1)

9-10: 💤 Low value

Use a placeholder in the example tfvars rather than a real-looking key.

Examples are often copied verbatim. Shipping a real ed25519 key here makes it likely that an operator will end up with a working bootstrap key that isn't theirs, instead of being prompted to supply one. A placeholder makes the intent explicit.

Proposed change
 # Public key authorized during first preview bootstrap.
-preview_bootstrap_ssh_public_key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPTd2zKSwHgWegi290EiK5nYp1Wp4+x2fDYqFxbd0WLN"
+preview_bootstrap_ssh_public_key = "ssh-ed25519 AAAA... your-operator-key"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@infra/terraform.tfvars.example` around lines 9 - 10, Replace the real-looking
ed25519 key assigned to the Terraform variable preview_bootstrap_ssh_public_key
in the example tfvars with a clear placeholder so users are forced to supply
their own key; update the value for preview_bootstrap_ssh_public_key to a
descriptive token such as a labelled placeholder (e.g.
REPLACE_WITH_YOUR_SSH_PUBLIC_KEY) or an empty/obvious dummy value and add a
short inline comment clarifying that operators must replace it with their own
public key.
infra/variables.tf (1)

49-53: 💤 Low value

Avoid hardcoding a specific operator's public key as the variable default.

Defaulting preview_bootstrap_ssh_public_key to a specific developer's public key means the bootstrap-time access is implicitly tied to whoever holds that private key. While public keys aren't secret, baking one operator's identity into the module default is fragile: anyone provisioning fresh preview infra from this module (CI, another dev, or after rotating laptops) gets that operator's access by default instead of being forced to think about it.

Consider either dropping the default (forcing the caller to provide it) or defaulting to "" and validating against empty in the resource that consumes it.

Proposed change
 variable "preview_bootstrap_ssh_public_key" {
   description = "Public SSH key authorized on the preview droplet before NixOS bootstrap"
   type        = string
-  default     = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPTd2zKSwHgWegi290EiK5nYp1Wp4+x2fDYqFxbd0WLN"
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@infra/variables.tf` around lines 49 - 53, The variable
preview_bootstrap_ssh_public_key currently hardcodes an operator SSH key; remove
that default (or set default to an empty string "") in the variable declaration
(variable "preview_bootstrap_ssh_public_key") and require callers to supply a
key, and add validation where it’s consumed (or add a validation block on the
variable) to fail when the value is empty so provisioning cannot proceed without
an explicit SSH key.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Duplicate comments:
In @.github/workflows/deploy-preview.yaml:
- Around line 84-86: The workflow currently appends "|| true" to every nix run
.#tfImport invocation which masks all failures; instead run each tfImport
command and capture its stderr/stdout, then if it exits non‑zero examine the
output for the specific Terraform message that indicates the resource is
"already managed by Terraform" and treat only that case as success (exit 0); for
any other error (bad ID, auth, rate limit, etc.) re‑exit non‑zero so the step
fails. Apply this change to the tfImport invocations (the three nix run
.#tfImport lines for digitalocean_volume.preview_data[0],
digitalocean_droplet.preview_nixos[0], and
digitalocean_reserved_ip.preview_nixos[0]) so they inspect stderr for the benign
message before deciding to ignore the error.

---

Nitpick comments:
In `@infra/terraform.tfvars.example`:
- Around line 9-10: Replace the real-looking ed25519 key assigned to the
Terraform variable preview_bootstrap_ssh_public_key in the example tfvars with a
clear placeholder so users are forced to supply their own key; update the value
for preview_bootstrap_ssh_public_key to a descriptive token such as a labelled
placeholder (e.g. REPLACE_WITH_YOUR_SSH_PUBLIC_KEY) or an empty/obvious dummy
value and add a short inline comment clarifying that operators must replace it
with their own public key.

In `@infra/variables.tf`:
- Around line 49-53: The variable preview_bootstrap_ssh_public_key currently
hardcodes an operator SSH key; remove that default (or set default to an empty
string "") in the variable declaration (variable
"preview_bootstrap_ssh_public_key") and require callers to supply a key, and add
validation where it’s consumed (or add a validation block on the variable) to
fail when the value is empty so provisioning cannot proceed without an explicit
SSH key.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: cac36086-71a0-4761-824b-e9851e57ed88

📥 Commits

Reviewing files that changed from the base of the PR and between 19a27bf and b48bc36.

📒 Files selected for processing (10)
  • .github/workflows/deploy-preview.yaml
  • DEPLOY.md
  • docs/ops.md
  • flake.nix
  • infra/default.nix
  • infra/main.tf
  • infra/terraform.tfvars.example
  • infra/variables.tf
  • scripts/smoke.sh
  • scripts/uptimerobot-setup.sh
✅ Files skipped from review due to trivial changes (3)
  • scripts/smoke.sh
  • DEPLOY.md
  • docs/ops.md

@findolor findolor force-pushed the feature/preview-api-domain branch from b48bc36 to c2fa4be Compare May 22, 2026 07:15
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@infra/variables.tf`:
- Around line 49-53: The variable preview_bootstrap_ssh_public_key currently
contains a hardcoded default; remove the concrete default value and require
explicit provisioning of the key (e.g., set no default or default = null and
mark sensitive), and add a validation that fails fast when preview_enabled is
true but preview_bootstrap_ssh_public_key is empty — reference the variable name
preview_bootstrap_ssh_public_key and the flag preview_enabled to implement a
validation block that checks length(var.preview_bootstrap_ssh_public_key) > 0
(or var.preview_bootstrap_ssh_public_key != null &&
var.preview_bootstrap_ssh_public_key != "") and returns a clear error
instructing users to provide the key via per-environment tfvars/CI secret.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 62b2b1f1-9055-4491-be45-8da3b422e7b6

📥 Commits

Reviewing files that changed from the base of the PR and between b48bc36 and c2fa4be.

📒 Files selected for processing (10)
  • .github/workflows/deploy-preview.yaml
  • DEPLOY.md
  • docs/ops.md
  • flake.nix
  • infra/default.nix
  • infra/main.tf
  • infra/terraform.tfvars.example
  • infra/variables.tf
  • scripts/smoke.sh
  • scripts/uptimerobot-setup.sh
✅ Files skipped from review due to trivial changes (3)
  • DEPLOY.md
  • docs/ops.md
  • scripts/smoke.sh

Comment thread infra/variables.tf
Comment on lines +49 to +53
variable "preview_bootstrap_ssh_public_key" {
description = "Public SSH key authorized on the preview droplet before NixOS bootstrap"
type = string
default = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPTd2zKSwHgWegi290EiK5nYp1Wp4+x2fDYqFxbd0WLN"
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Avoid a shared bootstrap SSH key default.

Line 52 hardcodes a concrete bootstrap key as the default. That creates an insecure access default for preview host provisioning if overrides are missed.

Suggested change
 variable "preview_bootstrap_ssh_public_key" {
   description = "Public SSH key authorized on the preview droplet before NixOS bootstrap"
   type        = string
-  default     = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPTd2zKSwHgWegi290EiK5nYp1Wp4+x2fDYqFxbd0WLN"
+  default     = ""
 }

Use an explicit per-environment value (for example via encrypted tfvars/CI secret), and fail fast when preview_enabled=true but this value is empty.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
variable "preview_bootstrap_ssh_public_key" {
description = "Public SSH key authorized on the preview droplet before NixOS bootstrap"
type = string
default = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPTd2zKSwHgWegi290EiK5nYp1Wp4+x2fDYqFxbd0WLN"
}
variable "preview_bootstrap_ssh_public_key" {
description = "Public SSH key authorized on the preview droplet before NixOS bootstrap"
type = string
default = ""
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@infra/variables.tf` around lines 49 - 53, The variable
preview_bootstrap_ssh_public_key currently contains a hardcoded default; remove
the concrete default value and require explicit provisioning of the key (e.g.,
set no default or default = null and mark sensitive), and add a validation that
fails fast when preview_enabled is true but preview_bootstrap_ssh_public_key is
empty — reference the variable name preview_bootstrap_ssh_public_key and the
flag preview_enabled to implement a validation block that checks
length(var.preview_bootstrap_ssh_public_key) > 0 (or
var.preview_bootstrap_ssh_public_key != null &&
var.preview_bootstrap_ssh_public_key != "") and returns a clear error
instructing users to provide the key via per-environment tfvars/CI secret.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
config/preview.toml (1)

3-3: ⚡ Quick win

Add provenance metadata for the inline registry blob.

This value is hard to review safely in-place. Please add a short comment with source/provenance and how it is regenerated so future updates don’t drift.

♻️ Suggested minimal change
+# Inline registry payload (base64 data URL).
+# Keep provenance + regeneration steps documented here for maintainability.
 registry_url = "data:text/plain;base64,..."
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@config/preview.toml` at line 3, The inline base64 registry blob assigned to
registry_url should include provenance and regeneration instructions; update the
config/preview.toml near the registry_url entry to add a concise comment
describing the original source URL(s), the date/timestamp of generation, the
tool/command used to produce the base64 blob, and the steps to regenerate (e.g.,
fetch raw file(s) and base64-encode) so future reviewers can verify or update
the blob without guessing.
infra/main.tf (1)

70-72: ⚡ Quick win

Consider adding user_data to ignore_changes.

Since this is a bootstrap SSH key intended for initial provisioning only, changes to var.preview_bootstrap_ssh_public_key would currently trigger droplet recreation. Adding user_data to the ignore list prevents accidental recreation after NixOS bootstrap completes.

♻️ Suggested change
   lifecycle {
-    ignore_changes = [ssh_keys, volume_ids]
+    ignore_changes = [ssh_keys, volume_ids, user_data]
   }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@infra/main.tf` around lines 70 - 72, The lifecycle ignore_changes currently
lists ssh_keys and volume_ids, which causes changes to
var.preview_bootstrap_ssh_public_key to trigger droplet recreation; update the
lifecycle block in the resource that contains ignore_changes (the one with
ignore_changes = [ssh_keys, volume_ids]) to also include user_data so that
bootstrap provisioning data is ignored after NixOS bootstrap completes and
accidental recreation is prevented.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@config/preview.toml`:
- Line 3: The inline base64 registry blob assigned to registry_url should
include provenance and regeneration instructions; update the config/preview.toml
near the registry_url entry to add a concise comment describing the original
source URL(s), the date/timestamp of generation, the tool/command used to
produce the base64 blob, and the steps to regenerate (e.g., fetch raw file(s)
and base64-encode) so future reviewers can verify or update the blob without
guessing.

In `@infra/main.tf`:
- Around line 70-72: The lifecycle ignore_changes currently lists ssh_keys and
volume_ids, which causes changes to var.preview_bootstrap_ssh_public_key to
trigger droplet recreation; update the lifecycle block in the resource that
contains ignore_changes (the one with ignore_changes = [ssh_keys, volume_ids])
to also include user_data so that bootstrap provisioning data is ignored after
NixOS bootstrap completes and accidental recreation is prevented.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: abfdb228-0ce0-4551-89fa-eb90e9c372d5

📥 Commits

Reviewing files that changed from the base of the PR and between c2fa4be and 7fbd4be.

📒 Files selected for processing (11)
  • .github/workflows/deploy-preview.yaml
  • DEPLOY.md
  • config/preview.toml
  • docs/ops.md
  • flake.nix
  • infra/default.nix
  • infra/main.tf
  • infra/terraform.tfvars.example
  • infra/variables.tf
  • scripts/smoke.sh
  • scripts/uptimerobot-setup.sh
✅ Files skipped from review due to trivial changes (4)
  • scripts/smoke.sh
  • DEPLOY.md
  • docs/ops.md
  • flake.nix

@findolor findolor changed the title Use preview.api.st0x.io for preview Use api.staging.st0x.io for preview May 23, 2026
Comment thread .github/workflows/deploy-preview.yaml Outdated
Comment thread .github/workflows/deploy-preview.yaml Outdated
Comment on lines -93 to -80
if [ "${{ inputs.recreate_host }}" = "true" ]; then
nix run .#tfPlan -- -var preview_enabled=true -replace='digitalocean_droplet.preview_nixos[0]'
else
nix run .#tfPlan -- -var preview_enabled=true
fi
nix run .#tfApply
nix run .#tfRekey
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'd also pull out all of this logic into a single nix run command instead of spreading scripts over both github actions and those tfInit/Import/Plan/Apply/Rekey

Comment thread infra/default.nix
'';
};

tfImport = rainix.mkTask.${system} {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not put all the new logic here instead of taking a bunch of extra args passed via the preview github action?

@findolor findolor force-pushed the feature/preview-api-domain branch from b0b84fb to d41526b Compare May 26, 2026 13:36
@graphite-app
Copy link
Copy Markdown

graphite-app Bot commented May 26, 2026

Merge activity

## Summary

- switch the preview NixOS virtual host to `api.staging.st0x.io`
- update preview docs and helper script defaults to use the same hostname
- keep production `api.st0x.io` untouched

## Context

The preview environment now uses `api.staging.st0x.io`, backed by the staging reserved IP. Production deployment and production hostname configuration are unchanged.

## Validation

- verified no remaining `api.preview.st0x.io` or `preview.api.st0x.io` references in preview config/docs/scripts
- deployed preview successfully
- verified `https://api.staging.st0x.io/health` returns HTTP 200
- verified an authenticated `/v1/tokens` request against staging returns HTTP 200 with a staging-only temporary key, then deleted that key
@graphite-app graphite-app Bot force-pushed the feature/preview-api-domain branch from d41526b to 249f3f6 Compare May 26, 2026 15:03
@graphite-app graphite-app Bot merged commit 249f3f6 into main May 26, 2026
10 checks passed
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.

3 participants