Skip to content

Phase 2: one-off DOI re-target script - #844

Merged
neuromechanist merged 2 commits into
feature/issue-837-epic-legacy-separationfrom
feature/issue-839-phase2-doi-retarget
Jun 27, 2026
Merged

neuromechanist merged 2 commits into
feature/issue-837-epic-legacy-separationfrom
feature/issue-839-phase2-doi-retarget

Conversation

@neuromechanist

Copy link
Copy Markdown
Contributor

Summary

Phase 2 of epic #837. Re-targets the existing EZID DOIs from the legacy nemar.org/dataexplorer/detail?dataset_id=<id> to the canonical https://nemar.org/dataset/<id> (version DOIs: ?v=v<version>), now that the Cloudflare forwarder to ww2 is live.

Per owner direction, this is not a CLI command or admin endpoint (a standing "mass-mutate 1,194 prod DOIs" capability is a footgun) — it's a guarded run-once script (scripts/retarget-dois.ts), committed as a record but not part of the deployed product.

  • Updates only the EZID _target (the doi.org resolution target). The DataCite metadata's secondary IsDescribedBy related-identifier self-heals on the next enrichment / nemar admin doi update (canonical since Phase 1).
  • Dry-run by default (no creds, no writes); --execute requires EZID_USERNAME/EZID_PASSWORD.
  • Idempotent + resumable (reads each identifier first, skips when already canonical), reversible (EZID _target is mutable), --only <id> canary, concurrency + transient-retry.
  • Pure planRetarget is unit-tested; dry-run validated against prod D1 (1,194 DOIs: 590 concept + 604 version).

The --execute run is a gated prod op (needs the EZID creds + explicit go); recommended sequence: --only nm000132 --execute canary → verify doi.org resolution → full run.

Closes #839
Part of epic #837

Test plan

  • bun test test/retarget-dois.test.ts (planRetarget: identifiers, version upper-case mint-parity, no legacy URL).
  • Biome clean; dry-run on a fixture + live read-only dry-run against prod D1.
  • --execute run is performed out-of-band with creds + owner go.

Epic #837 Phase 2. Guarded run-once ops script (NOT a CLI/endpoint) that
re-points all NEMAR EZID DOI _targets from the legacy dataexplorer URL to the
canonical https://nemar.org/dataset/<id> (forwarded to ww2). Dry-run by
default; --execute requires EZID creds; idempotent/resumable (skips DOIs
already on the canonical target); --only canaries a single dataset. Reuses the
real ezid.ts client. Dry-run validated against prod D1: 1,194 DOIs
(590 concept + 604 version). The execute run is a gated prod op.
@github-actions

github-actions Bot commented Jun 27, 2026 •

Copy link
Copy Markdown

📦 Package Preview

Your package is ready to test!

bun install -g nemar-cli@PR844

Version: 0.8.70-PR844.f8b3e3d
Commit: f8b3e3d


🤖 Updated on each push.

@neuromechanist
neuromechanist merged commit 77f308f into feature/issue-837-epic-legacy-separation Jun 27, 2026
1 check passed
@neuromechanist
neuromechanist deleted the feature/issue-839-phase2-doi-retarget branch June 27, 2026 02:15

This branch was previously deployed

1 inactive deployment
npm — f8b3e3dd Deployed Jun 27, 2026 by neuromechanist via publish #1584
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