Skip to content

[auto-update] Detect new PRO (nodespace-sync) releases too, not just free (nodespace-core) #1888

Closed

Description

@mstomar125

Context

The update checker (#1321 / #1881) reads nodespace-core's public releases/latest and the banner (#1321) surfaces it — this correctly covers the free/community app.

Gap

Pro releases are published on the private nodespace-sync repo (e.g. "NodeSpace Pro v0.1.0"; sync release.yml uploads the .pkg/.zip there). A shipped desktop app cannot query a private repo's releases API (no token it can safely carry), so a Pro user is never told when a new Pro build is available.

Options (needs a decision — touches infra/secrets)

  1. Cloud-worker proxy (recommended): add GET /pro/latest-version to the pro.nodespace.ai worker that reads nodespace-sync's latest release tag and returns just the version string. Requires a new GitHub fine-grained read-only secret (sync repo → contents/releases:read) on the worker, plus a deploy. update_check.rs branches on is_pro_build() to query this instead of/in addition to the core endpoint.
  2. Public Pro manifest: the sync release pipeline publishes a small public pro-latest.json (version only) to a public location the app can fetch directly. Release-pipeline change; no new app-readable secret.

Either keeps only a version string public (no private artifact exposure). Deferred from the #1321 auto-update-manager work because it needs the above infra/secret decision.

Acceptance

  • A Pro build detects a newer nodespace-sync release and surfaces the same non-blocking banner.
  • No private artifact or token is exposed to the client app.

Activity

  1. mstomar125 commented on Aug 1, 2026

    @mstomar125
    ContributorAuthor

    Option (A) chosen — worker proxy shipped (nodespace-cloud PR #111, merged)

    GET /pro/latest-version is live in the cloud worker: it holds a fine-grained read-only GitHub token as a secret and returns only {version, name, published_at} for the latest private nodespace-sync release — no artifacts, repo body, or token exposed. Fails safe (503 when the secret is unset → client skips). 15 tests green; wasm build + clippy clean.

    Remaining to fully close (both need you / follow-on):

    1. Deploy + secret (infra): create the fine-grained read-only GitHub token (releases:read on nodespace-sync) → wrangler secret put PRO_RELEASES_TOKEN → wrangler deploy.
    2. Client wiring (nodespace-core): update_check.rs branches on is_pro_build() to poll pro.nodespace.ai/pro/latest-version and feed the existing banner. End-to-end validation waits on step 1.
  2. mstomar125 commented on Aug 3, 2026

    @mstomar125
    ContributorAuthor

    Code-complete — client wiring merged (PR #1933)

    Both halves are in:

    Only remaining step — deploy + secret (needs the token value):

    # 1. Create a fine-grained GitHub PAT: repo = NodeSpaceAI/nodespace-sync,
    #    Contents = Read-only (covers releases). Copy the token.
    # 2. Set it as the worker secret + deploy:
    cd cloud/cloud-worker
    bunx wrangler secret put PRO_RELEASES_TOKEN      # paste the token
    cargo install worker-build 2>/dev/null; bunx wrangler deploy
    # 3. Verify (should return {"version":"…"}; 503 means the secret isn't set):
    curl -s https://pro.nodespace.ai/pro/latest-version

    Once deployed, Pro users get the update banner with no further code. Live end-to-end confirmation is the only thing waiting on the deploy. This issue can close once the secret is set + verified.

  3. mstomar125 commented on Aug 3, 2026

    @mstomar125
    ContributorAuthor

    Deployed + verified — the pro.nodespace.ai worker now serves GET /pro/latest-version

    The cloud-worker proxy (Option 1) is live. Deployed current nodespace-cloud main (2850e51, which carries the merged worker change) to the deutnet/NodeSpace Cloudflare account (87410ef2b0516857ef3f01f683fbb98b).

    • Deployed Version ID: 552f3551-7e14-401e-a368-7e7b994b0c3a
    • GET https://pro.nodespace.ai/healthz → 200 ok
    • GET https://pro.nodespace.ai/pro/latest-version →
      {"version":"v0.1.0","name":"NodeSpace Pro v0.1.0 — Stable (multi-tenant)","published_at":"2026-07-24T06:52:41Z"}
    • Bindings confirmed: PRO_RELEASES_REPO=NodeSpaceAI/nodespace-sync, secret PRO_RELEASES_TOKEN set. OAuth broker unaffected (/authorize still routes; the initial /pro/latest-version 404 was edge propagation, now cleared).

    Detection path is complete end-to-end: the endpoint returns the latest Pro (nodespace-sync) release version, and the core client wiring (update_check.rs branching on is_pro_build() to query this proxy) is merged (#1933). Closing.

    ⚠️ Follow-up — rotate the token

    PRO_RELEASES_TOKEN was set via the gh auth token stopgap (the handover's documented fallback, since a fine-grained PAT can only be minted in the GitHub web UI and this session is headless). It works — the worker only ever returns a version string and the token stays server-side in the Workers secret store — but it is a broad personal token. It should be rotated to a fine-grained read-only PAT (nodespace-sync → Contents: Read) when convenient, via bunx wrangler secret put PRO_RELEASES_TOKEN.

    Deferred to on-device (Mac)

    The final visual confirmation — the update banner actually surfacing a new Pro version inside a running Pro build — needs a desktop Pro app and defers to on-device validation. Reopen if the banner doesn't surface against the live endpoint.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions