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

PNPM failing with nested projects #9784

Closed
kamil-bielecki-bosch opened this issue Jan 20, 2025 · 0 comments
Closed

PNPM failing with nested projects #9784

kamil-bielecki-bosch opened this issue Jan 20, 2025 · 0 comments
Labels
analyzer About the analyzer tool bug Issues that are considered to be bugs

Comments

@kamil-bielecki-bosch
Copy link

Describe the bug

Since last refactoring/rework of analyzer's PNPM package manager some of projects cannot be scanned anymore.
There is the exception thrown during JSON parsing (output of pnpm run)
We found, that commit 0eb1eea introduced new parameters for pnpm command (--json instead of --parseable and value for --recursive parameter), that leads to generate unparseable output.

To Reproduce

There is test prepared for the issue under #9771
https://github.com/oss-review-toolkit/ort/blob/fbb3a47bb65f25c0b67c4d312cd0adb3e29960c9/plugins/package-managers/node/src/funTest/kotlin/pnpm/PnpmFunTest.kt

Error output for this test:
https://github.com/oss-review-toolkit/ort/actions/runs/12829313519/job/35775116991?pr=9771#step:7:2104

Expected behavior

Projects such as described should be analyzed without exceptions.

Console / log output

PNPM failed to resolve dependencies for path 'frontend/package.json': JsonDecodingException: Unexpected JSON token at offset 1201: Expected EOF after parsing, but had [ instead at path: $
JSON input: .....-scope"
      }
    }
  }
]

[
  {
    "name": "cypress-e2e".....
@kamil-bielecki-bosch kamil-bielecki-bosch added bug Issues that are considered to be bugs to triage Issues that need triaging labels Jan 20, 2025
@sschuberth sschuberth added analyzer About the analyzer tool and removed to triage Issues that need triaging labels Jan 20, 2025
oheger-bosch added a commit to boschglobal/oss-review-toolkit that referenced this issue Jan 29, 2025
If PNPM encounters nested projects, the out of the `list` command is
not well-formed JSON, but consists of multiple arrays. Change the
`parsePnpmList()` function to handle this format correctly.

Fixes oss-review-toolkit#9784.

Signed-off-by: Oliver Heger <[email protected]>
oheger-bosch added a commit to boschglobal/oss-review-toolkit that referenced this issue Jan 30, 2025
If PNPM encounters nested projects, the output of the `list` command
is not well-formed JSON, but consists of multiple arrays. Change the
`parsePnpmList()` function to handle this format correctly.

In `Pnpm`, only analyze the top-level project, since nested projects
will be handled by the `pnpm` command transparently.

Fixes oss-review-toolkit#9784.

Signed-off-by: Oliver Heger <[email protected]>
oheger-bosch added a commit to boschglobal/oss-review-toolkit that referenced this issue Jan 30, 2025
If PNPM encounters nested projects, the output of the `list` command
is not well-formed JSON, but consists of multiple arrays. Change the
`parsePnpmList()` function to handle this format correctly.

In `Pnpm`, only analyze the top-level project, since nested projects
will be handled by the `pnpm` command transparently.

Fixes oss-review-toolkit#9784.

Signed-off-by: Oliver Heger <[email protected]>
oheger-bosch added a commit to boschglobal/oss-review-toolkit that referenced this issue Jan 31, 2025
If PNPM encounters nested projects, the output of the `list` command
is not well-formed JSON, but consists of multiple arrays. Change the
`parsePnpmList()` function to handle this format correctly.

In `Pnpm`, only analyze the top-level project, since nested projects
will be handled by the `pnpm` command transparently.

Fixes oss-review-toolkit#9784.

Signed-off-by: Oliver Heger <[email protected]>
oheger-bosch added a commit to boschglobal/oss-review-toolkit that referenced this issue Jan 31, 2025
If PNPM encounters nested projects, the output of the `list` command
is not well-formed JSON, but consists of multiple arrays. Change the
`parsePnpmList()` function to handle this format correctly.

In `Pnpm`, only analyze the top-level project, since nested projects
will be handled by the `pnpm` command transparently.

Fixes oss-review-toolkit#9784.

Signed-off-by: Oliver Heger <[email protected]>
oheger-bosch added a commit to boschglobal/oss-review-toolkit that referenced this issue Jan 31, 2025
If PNPM encounters nested projects, the output of the `list` command
is not well-formed JSON, but consists of multiple arrays. Change the
`parsePnpmList()` function to handle this format correctly.

In `Pnpm`, only analyze the top-level project, since nested projects
will be handled by the `pnpm` command transparently.

Fixes oss-review-toolkit#9784.

Signed-off-by: Oliver Heger <[email protected]>
oheger-bosch added a commit to boschglobal/oss-review-toolkit that referenced this issue Jan 31, 2025
If PNPM encounters nested projects, the output of the `list` command
is not well-formed JSON, but consists of multiple arrays. Change the
`parsePnpmList()` function to handle this format correctly.

In `Pnpm`, only analyze the top-level project, since nested projects
will be handled by the `pnpm` command transparently.

Fixes oss-review-toolkit#9784.

Signed-off-by: Oliver Heger <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer About the analyzer tool bug Issues that are considered to be bugs
Projects
None yet
Development

No branches or pull requests

2 participants