Skip to content

Phase 10: flip CI/CD to SCCN account (#331) - #354

Merged
neuromechanist merged 2 commits into
devfrom
feature/issue-331-phase10-cicd-cutover
Apr 26, 2026
Merged

neuromechanist merged 2 commits into
devfrom
feature/issue-331-phase10-cicd-cutover

Conversation

@neuromechanist

Copy link
Copy Markdown
Contributor

Summary

Phase 10 of Epic #314 — point all GitHub Actions and ops scripts at the SCCN Cloudflare account. Replaces personal-account URLs (api.osc.earth, *.shirazi-10f.workers.dev, nemar-cli pages project) with SCCN equivalents (api.nemar.org, *.sccn-org.workers.dev, nemar-docs).

Closes #331.

Changes

  • `catalog-sync.yml`: `PROD_API_URL` → `api.nemar.org`, `DEV_API_URL` → `nemar-api-dev.sccn-org.workers.dev`.
  • `test.yml`: `TEST_API_URL` → SCCN dev across 5 jobs (lint, unit-test, api-test, e2e-sandbox, e2e-upload, zenodo-sandbox).
  • `deploy-backend.yml`: `wrangler deploy` and `wrangler d1 migrations apply` now pass `-c wrangler-sccn.toml` so dev (`nemar-db-dev`) and prod (`nemar-db`) target SCCN bindings instead of `backend/wrangler.toml`'s personal-account routes.
  • `docs.yml`: Cloudflare Pages project flipped from `nemar-cli` (personal) to `nemar-docs` (SCCN, bound to docs.nemar.org).
  • `backend/src/services/github.ts`: dataset-repo workflow templates (`llm-enrichment.yml`, `version-doi.yml`) now generate webhook URLs at `api.nemar.org/webhooks/...` instead of `api.osc.earth/nemar/webhooks/...`. Affects future `nemar admin ci add` runs.
  • `scripts/hallu-sync.sh`: `API_BASE` default → `api.nemar.org` (env override still honored).

Validation

  • Backend typecheck clean (`bun run typecheck` in `backend/`).
  • CLI typecheck clean (`bun run tsc --noEmit`).
  • `wrangler@4 deploy --dry-run -c wrangler-sccn.toml` (top-level + `--env dev`) with SCCN token: bindings resolve to SCCN `nemar-db` (`009b1a44-...`), `nemar-db-dev` (`017d8f4e-...`), and matching Vectorize indexes. Worker compiles, no scope errors.

Out of Scope (follow-up before merge or right after)

  1. GitHub org webhooks on `nemarDatasets` — repo-create webhooks the org dispatches still target the personal worker. Need `gh api -X PATCH /orgs/nemarDatasets/hooks/` to flip URLs to `api.nemar.org`.
  2. Existing dataset-repo CI files — this PR only updates the templates; the ~48 `nm*` / `on*` repos already on the org carry the legacy webhook URLs in their committed workflow files. Re-roll via `nemar admin ci add` per repo. Until then, DOI publish + LLM enrichment hits the personal worker which still mutates personal-account D1 (now stale relative to SCCN). Risk window = any dataset publishing a version DOI between Phase 8 cutover and the re-roll.
  3. `backend/wrangler.toml` (personal config) intentionally preserved as the read-only buffer worker; cleanup is Phase 11 (Phase 11: Old account cleanup and deprecation #332).

Test plan

- catalog-sync.yml: prod/dev URLs to api.nemar.org and SCCN dev worker
- test.yml: TEST_API_URL to SCCN dev (5 jobs)
- deploy-backend.yml: pass -c wrangler-sccn.toml so D1 + worker target SCCN
- docs.yml: pages project nemar-cli -> nemar-docs (SCCN)
- backend/services/github.ts: dataset-repo webhook templates to api.nemar.org
- scripts/hallu-sync.sh: API_BASE default to api.nemar.org

Dry-runs (wrangler@4 with SCCN token) bind to SCCN prod and dev
D1 + Vectorize correctly. Existing dataset repos still carry legacy
webhook URLs in committed workflow files; will re-roll via
nemar admin ci add as a follow-up so DOI/enrich webhooks land on
SCCN D1 instead of the personal-account read-only buffer.
- test/e2e-sandbox.test.ts: TEST_API_URL default to SCCN dev so local
  invocations stop hitting the personal-account read-only buffer
- backend/src/index.ts: rewrite the dual-mount comment so /nemar reads
  as the legacy buffer route, not "production"
- workflow comments: strip "Phase 10 / Epic #314" annotations from
  catalog-sync, deploy-backend (x2), and docs per CLAUDE.md no-task-refs
@neuromechanist

Copy link
Copy Markdown
Contributor Author

Review fixes (commit 7185138)

Two reviewers ran (code-reviewer, comment-analyzer). Findings addressed:

Critical

  • test/e2e-sandbox.test.ts:20 — TEST_API_URL default flipped from nemar-api-dev.shirazi-10f.workers.dev to nemar-api-dev.sccn-org.workers.dev. CI was unaffected because test.yml sets the env explicitly, but local invocations were hitting the personal-account read-only buffer.
  • backend/src/index.ts:153,156 — pre-existing comment called the /nemar mount "production"; rewrote so it now reads as the legacy buffer route. The dual-mount itself is unchanged.

Project convention (CLAUDE.md "no task references in code")

Verified, no action needed

  • No leftover osc.earth / shirazi-10f URLs in active CI/CD or runtime paths.
  • wrangler-action@v3 works with wrangler 4.x and the new SCCN token scopes (Pages:Edit + Account Settings:Read).
  • wrangler d1 migrations apply nemar-db --remote -c wrangler-sccn.toml (no --env) correctly resolves the top-level binding 009b1a44-... (SCCN prod).
  • GitHub environment-scoped secret stores for development and production are empty, so the rotated repo-level CLOUDFLARE_API_TOKEN / CLOUDFLARE_ACCOUNT_ID are what gets used. No fallback risk.

Operator follow-up (out of PR scope)

  • One-time ssh hallu 'crontab -l | grep API_BASE' to confirm the cron isn't pinning the legacy URL via env override; pull latest hallu-sync.sh.

@github-actions

Copy link
Copy Markdown

📦 Package Preview

Your package is ready to test!

bun install -g nemar-cli@PR354

Version: 0.8.0-PR354.7185138
Commit: 7185138


🤖 Updated on each push.

@neuromechanist
neuromechanist merged commit fb5f5a2 into dev Apr 26, 2026
14 of 15 checks passed
@neuromechanist
neuromechanist deleted the feature/issue-331-phase10-cicd-cutover branch April 26, 2026 17:15

This branch was previously deployed

1 inactive deployment
npm — 71851382 Deployed Apr 26, 2026 by neuromechanist via publish #620
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