Skip to content

Add upstream submodule path helpers, detection checks, and tests; update npm scripts#16

Merged
jooh merged 1 commit intoupstream_as_submodulefrom
codex/implement-upstream-submodule-cutover-step
Apr 3, 2026
Merged

Add upstream submodule path helpers, detection checks, and tests; update npm scripts#16
jooh merged 1 commit intoupstream_as_submodulefrom
codex/implement-upstream-submodule-cutover-step

Conversation

@jooh
Copy link
Copy Markdown
Owner

@jooh jooh commented Apr 3, 2026

Motivation

  • Treat upstream/ as the canonical source for vendored upstream CLI code and detect duplicate upstream-owned files outside the submodule.
  • Provide shared path helpers and automated scans to rewrite and validate references that still point at root-level upstream assets.
  • Add a fast-failing CI guard so pipeline jobs clearly fail when the upstream/ submodule is missing or uninitialized.

Description

  • Added src/spec-node/migration/upstreamPaths.ts which centralizes the upstream submodule root and exposes shared path builders/constants used by npm/test scripts.
  • Enhanced the readiness evaluator in src/spec-node/migration/upstreamSubmoduleCutoverReadiness.ts with file-scanning helpers and exported collectRootLevelUpstreamPathReferences(...) to detect root-level references that should be rewritten to upstream/....
  • Added build/check-upstream-submodule.js to verify that the upstream/ submodule exists, contains required assets, and is initialized, and exposed it as the npm script check-upstream-submodule.
  • Updated package.json test scripts to execute upstream test suites under upstream/src/test/... and added the check-upstream-submodule script.
  • Added unit tests src/test/upstreamPaths.test.ts and expanded src/test/upstreamSubmoduleCutoverReadiness.test.ts to cover duplicate detection and root-level reference scanning behavior.
  • Removed the legacy azure-pipelines.yml file as part of CI/workflow cleanup.

Testing

  • Ran the unit test suite via npm test which exercises the new path helpers and the upstream cutover readiness checks, and all tests passed.
  • Executed the new submodule guard via node build/check-upstream-submodule.js in a healthy checkout and confirmed it exits successfully when upstream/ is present and initialized.
  • Verified the added tests under src/test cover duplicate path detection and root-level reference scanning and reported no failures.

Codex Task

@jooh
Copy link
Copy Markdown
Owner Author

jooh commented Apr 3, 2026

@codex review

Copy link
Copy Markdown

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

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: 99d5899478

ℹ️ 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".

}

function collectLinePathCandidates(line: string) {
const candidateRegex = /(?:\.\/)?(?:[A-Za-z0-9_.-]+\/)+[A-Za-z0-9_.-]+/g;
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 Handle glob tokens when extracting path references

The new path-candidate regex does not include */**, so common script arguments like src/test/**/*.test.ts are truncated to src/test before validation. In practice this can hide real root-level upstream references: if src/test exists locally (as it does here), includeExistingLocalPaths suppresses the match and the scanner reports no issue even though the original command still points at a non-upstream/ path. This weakens the migration/readiness check for mocha-style globbed test commands.

Useful? React with 👍 / 👎.

@jooh
Copy link
Copy Markdown
Owner Author

jooh commented Apr 3, 2026

@fix suggestions

@jooh jooh merged commit fa7feff into upstream_as_submodule Apr 3, 2026
13 checks passed
@jooh jooh deleted the codex/implement-upstream-submodule-cutover-step branch April 3, 2026 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant