Skip to content

feat: add update-only Space deploy#4

Merged
osolmaz merged 1 commit into
mainfrom
feat/update-existing-space
Jul 6, 2026
Merged

feat: add update-only Space deploy#4
osolmaz merged 1 commit into
mainfrom
feat/update-existing-space

Conversation

@osolmaz

@osolmaz osolmaz commented Jul 6, 2026

Copy link
Copy Markdown
Member

Opened on behalf of Onur Solmaz (osolmaz). Work is in progress.

Summary

Redeploying an existing pool should not ask for all setup answers again.
This adds an update-only command that reads the existing Space settings and uploads the latest Space code.
It preserves the dataset token, signing secrets, session secrets, and import state.

What Changed

The first-time setup flow stays available for creating a pool.
Existing pools now have a shorter path for normal code deploys.

  • Added npm run update, which runs the setup CLI in update mode.
  • Added CLI parsing for update [owner/xtap-pool].
  • Added config derivation from existing Space variables.
  • Added an update deployment path that asserts the existing public Space and private dataset before uploading.
  • Documented the update command in the README.
  • Added unit tests for CLI parsing and update config defaults.

Testing

Local validation passes.
The live Hugging Face deploy itself was not run from this PR.

  • npm run test --workspace setup
  • npm run typecheck --workspace setup
  • npm run check
  • npm run build
  • git diff --check
  • npm run update -- not-a-repo rejects before any network call.

Risks

The update path intentionally fails if the existing Space or dataset has the wrong visibility.
That is safer than silently creating or updating the wrong pool.

  • If a Space is missing DATASET_REPO, update mode falls back to <space-owner>/xtap-pool-data.
  • If a Space is missing ALLOWED_USERS or POOL_ADMINS, update mode falls back to the active HF user for bootstrap access.

@osolmaz osolmaz force-pushed the feat/update-existing-space branch from d5219b2 to d405cde Compare July 6, 2026 15:32
@osolmaz

osolmaz commented Jul 6, 2026

Copy link
Copy Markdown
Member Author

Final report:

  • Added npm run update for update-only Space deploys.
  • The command defaults to <active-hf-user>/xtap-pool, accepts an explicit Space repo, reads existing Space variables, and skips the dataset token/import prompts.
  • Update mode now preserves generated signing/session secrets even if SECRETS_INITIALIZED is missing; it does not repair missing secrets silently.
  • Local validation passed:
    • npm run test --workspace setup passed: 9 files, 32 tests.
    • npm run typecheck --workspace setup passed.
    • npm run check passed: format, lint, typecheck, 24 Vitest files / 155 tests, extension tests / 66 tests, native tests / 41 tests, coverage, and slophammer dry.
    • npm run build passed for explorer, space, and setup.
    • git diff --check passed.
    • npm run update -- not-a-repo rejects before any network call.
  • codex review --base main is clean after the secret-preservation fix.
  • GitHub CI check passed on head d405cdea5321144b2e111606b5a5f2cb1787e919.

Merging autonomously as requested.

@osolmaz osolmaz merged commit 1370e8c into main Jul 6, 2026
1 check passed
@osolmaz osolmaz deleted the feat/update-existing-space branch July 6, 2026 15:48
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.

1 participant