Skip to content

[konflux-agent] Fix: replace npm dist-tags with exact versions for hermetic build#29

Open
raptorsun wants to merge 2 commits into
openshift:mainfrom
raptorsun:konflux-agent/fix-pr28-npm-dist-tags
Open

[konflux-agent] Fix: replace npm dist-tags with exact versions for hermetic build#29
raptorsun wants to merge 2 commits into
openshift:mainfrom
raptorsun:konflux-agent/fix-pr28-npm-dist-tags

Conversation

@raptorsun
Copy link
Copy Markdown
Contributor

Auto-fix by Konflux Agent

Fixes build failure in #28.

Original PR: #28
Failed PipelineRun: lightspeed-agentic-console-on-pull-request-kc4rn

Root Cause

During hermetic builds (network isolated), npm ci tries to resolve npm dist-tags ("4.21-latest") by querying the registry.npmjs.org metadata API to confirm which version the tag maps to. This network request fails in hermetic mode because the cachi2 local proxy only serves tarball downloads — not registry metadata/dist-tag resolution.

The specific error was:

npm error code ENOTFOUND
npm error network request to https://registry.npmjs.org/@openshift-console%2fdynamic-plugin-sdk failed, reason: getaddrinfo ENOTFOUND registry.npmjs.org

Both @openshift-console/dynamic-plugin-sdk and @openshift-console/dynamic-plugin-sdk-webpack were specified as "4.21-latest" (a dist-tag) in package.json. The prefetch-dependencies step succeeded correctly, but npm ci still failed because it needed to resolve the dist-tag from the registry.

Changes

  • package.json: Replace "4.21-latest""4.21.0" for both packages (verified: dist-tag 4.21-latest maps to exactly 4.21.0 in the npm registry)
  • package-lock.json: Update the root package's dependencies entries to match

The resolved package versions, integrity hashes, and tarball URLs in package-lock.json are unchanged — only the version specifier in the root entry changes from the dist-tag to the equivalent exact semver version.

Validation

  • Confirmed "4.21-latest""4.21.0" mapping via npm registry API
  • Only 2 files changed, 4 lines total (well within safe limits)
  • No semver resolution changes: 4.21.0 is the only version in the 4.21-latest dist-tag line

This PR was automatically created by konflux-agent to fix a build failure. Please review the changes and merge if correct.

vimalk78 and others added 2 commits June 1, 2026 17:19
The Enterprise Contract check fails with 3 violations: non-hermetic
build, missing source image, and missing source-build task. Enable
hermetic mode, source image building, and npm/rpm prefetch in both
push and pull-request pipeline configs.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Vimal Kumar <vimal78@gmail.com>
…rmetic build

During hermetic builds (network isolated), npm ci resolves dist-tags
by querying registry.npmjs.org metadata API, which fails when the
network is blocked. The dist-tags '4.21-latest' for both
@openshift-console packages caused npm to reach out to the registry
even though cachi2 had pre-fetched all tarballs.

Replace '4.21-latest' with the equivalent exact version '4.21.0'
(verified: dist-tag '4.21-latest' resolves to '4.21.0' in npm registry).
This allows npm ci to use the lockfile exclusively without any network
calls during hermetic Konflux builds.

Fixes: openshift#28
@openshift-ci openshift-ci Bot requested review from DavidHurta and wking June 1, 2026 13:28
@vimalk78
Copy link
Copy Markdown

vimalk78 commented Jun 1, 2026

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jun 1, 2026
@raptorsun
Copy link
Copy Markdown
Contributor Author

/approve

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Jun 1, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: raptorsun
Once this PR has been reviewed and has the lgtm label, please assign hongkailiu for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants