Skip to content

tests: add testbed for dev-dependencies of workspaces#564

Open
RickTimmer wants to merge 1 commit into
CycloneDX:mainfrom
RickTimmer:test/256-testbed-virtualized-workspace-dev-deps
Open

tests: add testbed for dev-dependencies of workspaces#564
RickTimmer wants to merge 1 commit into
CycloneDX:mainfrom
RickTimmer:test/256-testbed-virtualized-workspace-dev-deps

Conversation

@RickTimmer

@RickTimmer RickTimmer commented Jul 23, 2026

Copy link
Copy Markdown

Description

As requested in #563.

This PR adds some testbeds proving an issue, here we can see that after creating the bill of materials with the --production flag we still see the "is-number" package show up. This is a devDependency of a child workspace, which is caught because of a bug concerning virtualized workspaces. The reason for the virtual workspace being used is the fact that the child workspace uses a peerDependency (Intended by Yarn/Berry design).

(personally I just used grep for a quick confirmation grep -c is-number tests/_data/snapshots/prod-arg_workspace-peer-dev-dependencies.json.bin)

AI Tool Disclosure

  • My contribution does not include any AI-generated content
  • My contribution includes AI-generated content, as disclosed below:
    • AI Tools: Claude (claude.ai)
    • LLMs and versions: Claude Opus 4.8
    • Prompts: e.g Diagnosing why --prod includes transitive workspace devDependencies, Generate test-suite for this case, and fill in this PR description form

Affirmation

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@jkowalleck jkowalleck added the QA label Jul 24, 2026

@jkowalleck jkowalleck left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a README to the new test bed: tests/_data/testbeds/workspace-peer-dev-dependencies/README.md

it should hold the details of this test bed, and what it is showcasing, along with its specialties.
Also add a link to the respective ticket 563.
This README could basically be a modified version of this PR's description.

Thank you in advance.

"private": true,
"name": "demo-workspace-peer-dev-dependencies",
"version": "0.0.1",
"description": "demo: regression test transitive dev dependency omission with --prod flag in virtual workspace",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a remark that this is about dev-dependnecies of workspaces.

@jkowalleck

Copy link
Copy Markdown
Member

some snapshots seam outdated
https://github.com/CycloneDX/cyclonedx-node-yarn/actions/runs/30039749554/job/89430772060?pr=564#step:8:258

'      <name>demo-workspace-peer-dev-dependencies-child</name>\n' +
+   '      <version>0.0.0</version>\n' +
-   '      <version>0.0.0-use.local</version>\n' +
    '      <description>demo: child for regression test transitive dev dependency omission with --prod flag in virtual workspace</description>\n' +
+   '      <purl>pkg:npm/demo-workspace-peer-dev-dependencies-child@0.0.0</purl>\n' +
-   '      <purl>pkg:npm/demo-workspace-peer-dev-dependencies-child@0.0.0-use.local</purl>\n' +
    '    </component>\n' +

@jkowalleck jkowalleck changed the title test: add testbed covering dev dependencies of virtualized workspaces… tests: add testbed for dev-dependencies of workspaces Jul 24, 2026
@RickTimmer
RickTimmer force-pushed the test/256-testbed-virtualized-workspace-dev-deps branch from 1f8b702 to 03de305 Compare July 27, 2026 12:21
@RickTimmer
RickTimmer requested a review from jkowalleck July 27, 2026 12:23
@RickTimmer

Copy link
Copy Markdown
Author

Hi, thanks for having a look again. I took care of your remarks, have another look. After it's been merged I'll rebase my fix branch. Let me know if you'd prefer to first see the CI fail based on the diff in the snapshots, or whether just the diff in the snapshots is fine. Kind regards

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants