Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please provide package-lock.json with fully resolved dependencies again #6180

Closed
WilliButz opened this issue Jul 7, 2023 · 4 comments · Fixed by #9419
Closed

Please provide package-lock.json with fully resolved dependencies again #6180

WilliButz opened this issue Jul 7, 2023 · 4 comments · Fixed by #9419
Labels
bug/confirmed Confirmed bugs bug Something isn't working

Comments

@WilliButz
Copy link

Describe the bug
With release 2023.6.0 and seemingly introduced in #5761 (diff https://github.com/goauthentik/authentik/pull/5761/files#diff-3ebf69f247f3231fd796e60555489b4a1ed684e3ad4cb0ace460a2ed07d53a95)
the fields resolved and integrity were dropped from a set of dependencies in web/package-lock.json.
For example:

@@ -108,16 +106,15 @@
         },
         "node_modules/@apitools/openapi-parser": {
             "version": "0.0.30",
-            "resolved": "https://registry.npmjs.org/@apitools/openapi-parser/-/openapi-par
-            "integrity": "sha512-e8KttEjBSozuSO7IVeFTRvzqgsbxwFtGbwc1Yi/u8EgzDqtVpTOgZ5qfS
+            "license": "MIT",
             "dependencies": {
                 "swagger-client": "^3.18.5"
             }
         },
         "node_modules/@babel/code-frame": {
             "version": "7.21.4",
-            "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.21.4.
-            "integrity": "sha512-LYvhNKfwWSPpocw8GI7gpK2nq3HSDuEPC/uSYaALSJu9xjsalaaYFOq0P
+            "dev": true,
+            "license": "MIT",
             "dependencies": {
                 "@babel/highlight": "^7.18.6"
             },
@@ -127,16 +124,16 @@

I suppose this happened by accident. Related issue: npm/cli#4263

To Reproduce
N/A

Expected behavior
For the purpose of building the official code from source without having to resolve the dependencies in question and in the worst case diverging from the ones used by the project's devs, it would be great if the next release included package-lock.jsons with fully resolved dependencies again. :)

Screenshots
N/A

Logs
N/A

Version and Deployment (please complete the following information):

  • authentik version: 2023.6.0
  • Deployment: irrelevant

Additional context
N/A

@WilliButz WilliButz added the bug Something isn't working label Jul 7, 2023
@BeryJu BeryJu added the bug/confirmed Confirmed bugs label Jul 7, 2023
@jvanbruegge
Copy link
Contributor

It looks like #6107 fixed this, the current master has all resolved fields again. Checked with a git bisect and jq '.packages[] | select(has("resolved") | not)' < package-lock.json

@WilliButz
Copy link
Author

Yes, I can confirm that the latest releases provide the fully resolved lock files again 👍

@WilliButz WilliButz reopened this Apr 24, 2024
@WilliButz
Copy link
Author

It seems like this happened again with the 2024.4.0 release, see https://github.com/goauthentik/authentik/blob/version/2024.4.0/web/package-lock.json#L18889-L18926 for example.

I believe the regression was accidentally introduced in #8699, most likely obscured by GitHub not showing the large lock file diffs by default.

Link to the collapsed lock file diff: https://github.com/goauthentik/authentik/pull/8699/files#diff-3ebf69f247f3231fd796e60555489b4a1ed684e3ad4cb0ace460a2ed07d53a95

@jvanbruegge
Copy link
Contributor

I've opened a PR to fix this and add a CI job to prevent this from happening again

WilliButz added a commit to nix-community/authentik-nix that referenced this issue Sep 7, 2024
Release notes: https://docs.goauthentik.io/docs/releases/2024.8

Still includes the same hacky workaround for one of the dependencies
that was introduced in the 2024.6.1 update. See components/docs.nix for
more information.

Also, as upstream package-lock.json files do not include source hashes
and urls for a lot of dependencies, building authentik from source is
only possible after they've been resolved. This makes it kind of a
gamble to try and reproduce a build with the same set of dependencies
that the devs use. This is why the two relevant lock files are vendored
here now. See upstream issues for more information:
- goauthentik/authentik#6180
- goauthentik/authentik#11169
and the npm issue for the underlying reason:
npm/cli#4263

Flake lock file updates:

• Updated input 'flake-parts':
    'github:hercules-ci/flake-parts/8471fe90ad337a8074e957b69ca4d0089218391d' (2024-08-01)
  → 'github:hercules-ci/flake-parts/567b938d64d4b4112ee253b9274472dc3a346eb6' (2024-09-01)
• Updated input 'flake-parts/nixpkgs-lib':
    'https://github.com/NixOS/nixpkgs/archive/a5d394176e64ab29c852d03346c1fc9b0b7d33eb.tar.gz?narHash=sha256-uFf2QeW7eAHlYXuDktm9c25OxOyCoUOQmh5SZ9amE5Q%3D' (2024-08-01)
  → 'https://github.com/NixOS/nixpkgs/archive/356624c12086a18f2ea2825fed34523d60ccc4e3.tar.gz?narHash=sha256-Ss8QWLXdr2JCBPcYChJhz4xJm%2Bh/xjl4G0c0XlP6a74%3D' (2024-09-01)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/c374d94f1536013ca8e92341b540eba4c22f9c62' (2024-08-21)
  → 'github:NixOS/nixpkgs/574d1eac1c200690e27b8eb4e24887f8df7ac27c' (2024-09-06)
• Updated input 'poetry2nix':
    'github:nix-community/poetry2nix/884b66152b0c625b8220b570a31dc7acc36749a3' (2024-08-21)
  → 'github:nix-community/poetry2nix/a313fd7169ae43ecd1a2ea2f1e4899fe3edba4d2' (2024-09-05)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/confirmed Confirmed bugs bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants