Add upstream submodule path helpers, detection checks, and tests; update npm scripts#16
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 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; |
There was a problem hiding this comment.
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 👍 / 👎.
|
@fix suggestions |
Motivation
upstream/as the canonical source for vendored upstream CLI code and detect duplicate upstream-owned files outside the submodule.upstream/submodule is missing or uninitialized.Description
src/spec-node/migration/upstreamPaths.tswhich centralizes the upstream submodule root and exposes shared path builders/constants used by npm/test scripts.src/spec-node/migration/upstreamSubmoduleCutoverReadiness.tswith file-scanning helpers and exportedcollectRootLevelUpstreamPathReferences(...)to detect root-level references that should be rewritten toupstream/....build/check-upstream-submodule.jsto verify that theupstream/submodule exists, contains required assets, and is initialized, and exposed it as the npm scriptcheck-upstream-submodule.package.jsontest scripts to execute upstream test suites underupstream/src/test/...and added thecheck-upstream-submodulescript.src/test/upstreamPaths.test.tsand expandedsrc/test/upstreamSubmoduleCutoverReadiness.test.tsto cover duplicate detection and root-level reference scanning behavior.azure-pipelines.ymlfile as part of CI/workflow cleanup.Testing
npm testwhich exercises the new path helpers and the upstream cutover readiness checks, and all tests passed.node build/check-upstream-submodule.jsin a healthy checkout and confirmed it exits successfully whenupstream/is present and initialized.src/testcover duplicate path detection and root-level reference scanning and reported no failures.Codex Task