Skip to content

Field notes from a real deploy: stale :latest redeploys, full-URL imports, runner caveats#2

Closed
schlunsen wants to merge 1 commit into
mainfrom
field-notes-redeploy-and-import
Closed

Field notes from a real deploy: stale :latest redeploys, full-URL imports, runner caveats#2
schlunsen wants to merge 1 commit into
mainfrom
field-notes-redeploy-and-import

Conversation

@schlunsen

Copy link
Copy Markdown
Collaborator

Lessons learned deploying downhill-havoc to the lunarrails workspace on prod (app.nzero.pro), 2026-07-02. All items were hit in practice and verified.

Changes

  • Redeploy section: warn that redeploying with an unchanged :latest image reference serves the old build (k3s containerd caches the tag; the {"tag": ...} redeploy body is ignored). Documents the reliable flow: pin the manifest image to the commit-SHA tag → re-import definition → redeploy. Also documents PUT .../apps/{id}/access for temporarily flipping an app public to verify deployed content (takes effect after redeploy).
  • Definition import: prefer the full Gitea URL for repo_url. The short org/repo form failed on prod with a misleading No n0-app.json found even though the manifest was on the default branch; the full URL worked immediately. Also notes re-import updates the definition in place.
  • CI workflow: the docker save | k3s ctr images import step is now marked conditional — the lunarrails runner is containerized and has no k3s binary, so the step fails with exit 127.
  • Troubleshooting table: three new rows (short-form import error, stale version after redeploy, Actions runs misreported as failure ~12 min after the job log says "Job succeeded" — job logs are ground truth).
  • Credentials: document minting a workspace Gitea token via POST /workspaces/{ws}/gitea/token/ with the platform token.

🤖 Generated with Claude Code

…ll-URL imports, runner caveats

- Warn that redeploys don't repull an unchanged :latest tag (k3s containerd
  tag cache); document the commit-SHA pin + re-import + redeploy flow
- Prefer full Gitea URL for definition imports: short org/repo form can fail
  with a misleading 'No n0-app.json found' (seen on prod app.nzero.pro)
- Mark the 'Import into k3s' CI step as conditional: containerized runners
  have no k3s binary and fail with exit 127
- Add troubleshooting rows: stale-version-after-redeploy, short-form import
  error, and Actions runs misreported as failed after the job succeeded
- Document minting a Gitea token via POST /workspaces/{ws}/gitea/token/

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 2, 2026 11:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Documents production deployment lessons for the downhill-havoc app in the lunarrails workspace, focusing on reliable redeploy behavior, definition import quirks, and runner limitations in CI so future deployments avoid the same failure modes.

Changes:

  • Adds guidance on :latest redeploy staleness and a “pin to commit-SHA tag → re-import → redeploy” workflow.
  • Updates definition import guidance to prefer full Gitea URLs and documents re-import updating in place.
  • Clarifies CI runner limitations around k3s ctr images import and expands troubleshooting guidance (including token minting via API).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread SKILL.md
Comment on lines +1518 to +1521
1. Push code → CI builds and pushes both `:latest` and `:{commit-sha}` tags
2. Pin the image in `n0-app.json` to the full commit-SHA tag
(`localhost:5000/org/repo:<sha>`) and push
3. Re-import the definition (`POST .../apps/definitions/` with the full repo URL)
Comment thread SKILL.md
Comment on lines +1477 to +1482
**Prefer the full URL.** On some deployments (observed on prod `app.nzero.pro`) the
short form fails with a misleading `No n0-app.json found in org/repo` error even when
the manifest is present on the default branch; the full-URL form works immediately.

Re-run this same call after changing `n0-app.json` (e.g. bumping a pinned image tag) —
it updates the existing AppDefinition in place (`"created": false` in the response).
schlunsen added a commit that referenced this pull request Jul 4, 2026
* Make Gitea + deploy flow HTTPS-only via single N0 PAT (sandbox-safe)

Adds an Authentication section documenting the one-token flow: use a N0
Personal Access Token (Bearer) for all n0 API calls, and mint the Gitea
token via POST /workspaces/<id>/gitea/token/ instead of web UI, admin SSH,
or email/password login. Enforces HTTPS git remotes and forbids SSH so the
skill runs inside the Claude Desktop / Claude Code sandbox.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Field notes from downhill-havoc deploy: stale :latest on redeploy, full-URL imports, runner caveats

- Warn that redeploys don't repull an unchanged :latest tag (k3s containerd
  tag cache); document the commit-SHA pin + re-import + redeploy flow
- Prefer full Gitea URL for definition imports: short org/repo form can fail
  with a misleading 'No n0-app.json found' (seen on prod app.nzero.pro)
- Mark the 'Import into k3s' CI step as conditional: containerized runners
  have no k3s binary and fail with exit 127
- Add troubleshooting rows: stale-version-after-redeploy, short-form import
  error, and Actions runs misreported as failed after the job succeeded
- Document minting a Gitea token via POST /workspaces/{ws}/gitea/token/

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
@schlunsen

Copy link
Copy Markdown
Collaborator Author

Content merged into main via #5 (main was rewritten in #3, so this branch shared no ancestor and couldn't merge directly). The Gitea-token section kept #1's HTTPS-only guidance; the web-UI/SSH alternatives were intentionally dropped.

@schlunsen schlunsen closed this Jul 4, 2026
@schlunsen schlunsen deleted the field-notes-redeploy-and-import branch July 4, 2026 10:30
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