Skip to content

Conversation

@illume
Copy link
Contributor

@illume illume commented Nov 13, 2025

There were some bugs in how it uses a package-lock.json distributed with the headlamp-plugin to speed up installs. Now it generates a valid template package-lock.json and the install works properly.

There is a circular dependency on the integrity field when including the package-lock.json inside the package. Because it refers to itself. The digest can't be generated and included in itself when it relies on itself.

So when creating a new package we make sure we get the integrity field from the npm registry and then update the package-lock.json before "npm ci" is run. This way "npm ci" has the correct integrity field and can run quickly.

Testing

  • there's CI tests for creating packages
  • A pre-release alpha was published with this in it that can be tried. It should create the package without error, and there should be packages installed.

Here it is creating a new plugin.
Screenshot 2025-11-13 at 17 35 55

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: illume

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

The pull request process is described here

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

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Nov 13, 2025
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Nov 13, 2025
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 13, 2025
There were some bugs in this, and now it generates a valid
template package-lock.json.

Except there is a circular dependency on the integrity field.
So we make sure we get the integrity field from the registry
and update the package-lock.json before npm ci is run.

If the package version is not found on the registry, then we just
do a npm install. This can happen in testing.
@illume illume marked this pull request as draft November 13, 2025 20:02
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 13, 2025
@illume illume marked this pull request as ready for review November 13, 2025 20:19
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 13, 2025
@illume illume marked this pull request as draft November 13, 2025 20:22
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 13, 2025
@illume illume marked this pull request as ready for review November 13, 2025 20:29
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 13, 2025
@illume illume added kind/bug Categorizes issue or PR as related to a bug. plugins headlamp-plugin Related to the headlamp-plugin NPM package. labels Nov 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. headlamp-plugin Related to the headlamp-plugin NPM package. kind/bug Categorizes issue or PR as related to a bug. plugins size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants