Conversation
044e845 to
53ecaa5
Compare
| let previousDeps = {}; | ||
| try { | ||
| const relativePath = join("packages/pluggableWidgets", widget, "package.json"); | ||
| const previousContent = execSync(`git show HEAD:${relativePath}`, { |
There was a problem hiding this comment.
In CI the validator compares the working-tree package.json against git show HEAD:<same path>, which is identical, so the new-dependency set is always empty and the gate can never fail.
| // Get previous package.json from git (HEAD) | ||
| let previousDeps = {}; | ||
| try { | ||
| const relativePath = join("packages/pluggableWidgets", widget, "package.json"); |
There was a problem hiding this comment.
The git object path is built with path.join, which produces backslashes on win32, so git show fails and the empty catch leaves previousDeps as {}, marking every existing dependency as new.
| // Skip certain directories | ||
| if ( | ||
| relativePath.match(/[\\/](android|ios|windows|mac|jest|github|gradle|__.*__|docs|example.*)[\\/]/) | ||
| relativePath.match(/(^|[\\/])(android|ios|windows|mac|jest|github|gradle|__.*__|docs|example.*)([\\/]|$)/) |
There was a problem hiding this comment.
The tightened ignore pattern anchors on (^|[\\/])github, which never matches the real directory .github, and both this regex and the hasNativeCode ignore list are case-sensitive.
| - name: "Validating native dependencies" | ||
| run: pnpm run validate-native-dependencies | ||
| env: | ||
| CI_COMMIT_MESSAGE: ${{ github.event.head_commit.message || github.event.pull_request.title }} |
There was a problem hiding this comment.
The hook looks for NATIVE_DEPENDENCY_APPROVED in the commit message file, while CI reads github.event.head_commit.message (last commit of a push only) or github.event.pull_request.title.
1779aee to
0985c33
Compare
Checklist
[XX-000]: description)? ✅ ❌Feature specific
Please remove unnecessary emojis and sections and this comment before proceeding
This PR contains
What is the purpose of this PR?
...
Relevant changes
Please add a high level explanation of what was changed and how the initial problem was solved
What should be covered while testing?
...
Extra comments (optional)
Please add extra comments or delete the section if not required