Skip to content

tools: Wise Old Man name change import script#321

Merged
frolv merged 1 commit into
mainfrom
name-change-import
Jul 24, 2026
Merged

tools: Wise Old Man name change import script#321
frolv merged 1 commit into
mainfrom
name-change-import

Conversation

@frolv

@frolv frolv commented Jul 12, 2026

Copy link
Copy Markdown
Collaborator

Creates a script which looks up the full name change history for a player through the Wise Old Man APIs then submits it to the admin name change API, either in dry run or apply mode.

@codecov

codecov Bot commented Jul 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4dc7f51200

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

const { parseArgs } = require('node:util');

const { WOMClient } = require('@wise-old-man/utils');
const { normalizeRsn } = require('@blert/common');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use a runtime-available normalizer

When this documented node tools/historic-name-changes.cjs ... command is run from a clean checkout before building workspaces, this require('@blert/common') resolves to the workspace package whose main is dist/index.js, but common/dist is not committed or produced by the root postinstall. The tool therefore aborts before parsing arguments unless the operator happens to have run the common build first; either inline this small normalization helper or load a file that exists at runtime.

Useful? React with 👍 / 👎.

Comment thread tools/historic-name-changes.cjs Outdated
Comment thread tools/historic-name-changes.cjs
Comment thread tools/historic-name-changes.cjs
Comment thread tools/historic-name-changes.cjs
Creates a script which looks up the full name change history for a
player through the Wise Old Man APIs then submits it to the admin
name change API, either in dry run or apply mode.
@frolv
frolv force-pushed the name-change-import branch from 4dc7f51 to 9de74d0 Compare July 24, 2026 23:21

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9de74d08bd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +386 to +388
if (chain.length === 0) {
console.log(`No approved name changes found for "${opts.username}".`);
return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep zero-change JSON output parseable

When --json is used for a player with no approved name changes, this branch still writes a human-readable sentence to stdout and exits successfully. Callers that consistently parse JSON output will fail on this otherwise normal result; emit a JSON value in this path or send the message to stderr when JSON mode is active.

Useful? React with 👍 / 👎.

return {
oldName: nc.oldName,
newName: nc.newName,
effectiveFrom: nc.resolvedAt ?? nc.updatedAt ?? nc.createdAt,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use the rename observation time for migration boundaries

When a WOM name-change request is approved after the rename was submitted or detected, resolvedAt is the administrative resolution time rather than when the new name became effective. The server treats effectiveFrom as the exact boundary for ownership windows, so Blert challenges recorded under the new name between creation and approval can be assigned to the old-name window or evicted from the target as prior-holder data; prefer the observation/creation timestamp rather than resolvedAt for this cutoff.

Useful? React with 👍 / 👎.

@frolv
frolv merged commit 48d97f0 into main Jul 24, 2026
9 checks passed
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