Area editor: pull repo updates from the UI #67

Merged
Nimby merged 1 commit from task/66-pull-updates into main 2026-10-05 01:52:42 -04:00
Collaborator

Closes #66

Pull updates button in the editor header, plus a branch @ commit label.

  • POST /api/pull runs git pull --ff-only of the checkout's current branch from AWRY_PULL_URL (defaults to the public HTTPS repo URL, so no credentials are needed in the container). It holds the render lock while pulling, and a second concurrent pull gets a 409.
  • It never merges or overwrites. A diverged history or a conflicting local edit is refused with git's output plus plain guidance ("commit or discard those edits...", "push them first..."). Uncommitted edits to files the update doesn't touch survive the pull.
  • After an update: godot --import if any non-tools/ file changed, then origin/<branch> is moved to match (only when origin is project-awry) so host git status doesn't say "ahead", then the server execvs itself so pulled server/generator code is live. The page waits for /api/health to report the new commit, reloads, and shows the commit list (carried across the reload in sessionStorage, along with the selected area).
  • Docker: the image gains git; the entrypoint marks /repo as a git safe.directory so a UID mismatch can't block pulls.

Verified (real entrypoint against a fresh clone, pulling from a local "upstream" via AWRY_PULL_URL, driven in headless Chromium):

  • Nothing to pull: "Already up to date".
  • An upstream commit changing server.py (adds a health field), the catalog (adds Gem), and a non-tools file: the update ran, the server re-exec'd (the new health field is present), the page reloaded showing the commit list, and Gem appeared in the palette.
  • An uncommitted editor edit to an area file survived the pull; git status -sb showed no ahead/behind.
  • An upstream change to that same edited file was refused, naming the file, with the local edit intact.
  • The diverged-history and conflict guidance messages both come through pull_updates().

Needs a one-time rebuild on optibcc for git: docker compose up -d --build. After that, updates are one click.

🤖 Generated with Claude Code

Closes #66 **Pull updates** button in the editor header, plus a `branch @ commit` label. - `POST /api/pull` runs `git pull --ff-only` of the checkout's current branch from `AWRY_PULL_URL` (defaults to the public HTTPS repo URL, so no credentials are needed in the container). It holds the render lock while pulling, and a second concurrent pull gets a 409. - It never merges or overwrites. A diverged history or a conflicting local edit is refused with git's output plus plain guidance ("commit or discard those edits...", "push them first..."). Uncommitted edits to files the update doesn't touch survive the pull. - After an update: `godot --import` if any non-`tools/` file changed, then `origin/<branch>` is moved to match (only when origin is project-awry) so host `git status` doesn't say "ahead", then the server `execv`s itself so pulled server/generator code is live. The page waits for `/api/health` to report the new commit, reloads, and shows the commit list (carried across the reload in sessionStorage, along with the selected area). - Docker: the image gains `git`; the entrypoint marks `/repo` as a git `safe.directory` so a UID mismatch can't block pulls. **Verified** (real entrypoint against a fresh clone, pulling from a local "upstream" via `AWRY_PULL_URL`, driven in headless Chromium): - Nothing to pull: "Already up to date". - An upstream commit changing `server.py` (adds a health field), the catalog (adds Gem), and a non-tools file: the update ran, the server re-exec'd (the new health field is present), the page reloaded showing the commit list, and Gem appeared in the palette. - An uncommitted editor edit to an area file survived the pull; `git status -sb` showed no ahead/behind. - An upstream change to that same edited file was refused, naming the file, with the local edit intact. - The diverged-history and conflict guidance messages both come through `pull_updates()`. **Needs a one-time rebuild on optibcc** for `git`: `docker compose up -d --build`. After that, updates are one click. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
A Pull updates button fast-forwards the editor's checkout (e.g. the one
mounted into the optibcc container) from the public repo URL, so no
credentials are needed and nobody has to SSH in. It never merges or
overwrites: git's refusals for diverged history or conflicting local
edits are shown with plain-language guidance, and uncommitted editor
edits to untouched files survive the pull.

After an update the server re-imports into Godot when non-tool files
changed, then re-execs itself so pulled server/generator code takes
effect; the page waits for the new commit to report healthy and reloads.
The header shows branch @ commit. The image gains git and marks /repo as
a git safe.directory (one-time rebuild).

Closes #66

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Nimby merged commit 1a7da8c08e into main 2026-10-05 01:52:42 -04:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
scruffydude/project-awry!67
No description provided.