Skip to content

[PM Fixer] Fix yarn @yarnpkg/cli/3.6.4 compatibility - nil panic in TestNpmBuildPublishWithCIVcsProps - #3718

Open
agrasth wants to merge 1 commit into
masterfrom
pm-compat/yarn-yarnpkg-cli-3.6.4-1678910
Open

agrasth wants to merge 1 commit into
masterfrom
pm-compat/yarn-yarnpkg-cli-3.6.4-1678910

Conversation

@agrasth

@agrasth agrasth commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Summary

TestNpmBuildPublishWithCIVcsProps panicked at npm_test.go:1676 with a nil pointer dereference. The build info was successfully deployed (per the CI log), but tests.GetBuildInfo returned found=false (likely due to Artifactory index propagation lag under CI load, even with the existing retry logic). Because lines 1667–1668 used soft assert.NoError/assert.True instead of require, test execution continued past the found=false check, and the loop at line 1676 dereferenced the nil publishedBuildInfo.BuildInfo.Modules.

Fix

Changed assert.NoError → require.NoError and assert.True → require.True for the two pre-condition checks on GetBuildInfo's return values (lines 1667–1668 of npm_test.go). This is a test-only fix: when found=false or err != nil, the test now fails immediately and cleanly instead of panicking. No product behavior changed.

Compatibility impact

No exported symbols were added, removed, or changed. This is a two-line test-helper change confined to npm_test.go. All supported versions are unaffected.

Test plan

  • go build ./... — could not run: Go toolchain not installed in this environment.
  • gofmt -l . — could not run: Go toolchain not installed in this environment.
  • go vet ./... — could not run: Go toolchain not installed in this environment.
  • Existing unit tests — could not run: Go toolchain not installed in this environment.
  • The change is a two-line mechanical substitution (assert → require on both checks guarding the same nil pointer); no logic was altered.
  • The live PM integration test (full yarn/npm suite against Artifactory) could not be run in this environment.

Opened automatically by PM Compat Fixer investigating yarn @yarnpkg/cli/3.6.4.

Use require.True/require.NoError instead of assert.True/assert.NoError
when checking GetBuildInfo results. The soft assert variants allow
execution to continue when found=false, causing a nil pointer
dereference at publishedBuildInfo.BuildInfo.Modules on the next line.

Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
@agrasth agrasth added the pm-compat-fixer Opened automatically by JFrog's PM Compat Fixer agent label Sep 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


pm-compat-fixer seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

This branch is waiting to be deployed

1 waiting deployment
build-gate — 992ac781 Waiting Sep 22, 2026 by agrasth via Approval gate #1220
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pm-compat-fixer Opened automatically by JFrog's PM Compat Fixer agent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant