Skip to content

Yarn PnP Support #47

@dbasilio

Description

@dbasilio

Hello! This action doesn't seem to work correctly for yarn pnp repositories What is Yarn PnP?.

We had this working via dd-trace using the advice we got from the docs (We support both pnp and node-modules linkers so we have the user pass in the node-linker for the repo as an input)

- name: Run Tests
        env:
          NODE_OPTIONS: --max-old-space-size=6144 ${{ contains(inputs.node-linker, 'pnp') && '-r ./.pnp.cjs ' }} -r dd-trace/ci/init
          DD_CIVISIBILITY_AGENTLESS_ENABLED: true
          DD_ENV: ci
          DD_SERVICE: ${{ github.event.repository.name }}
          DD_SITE: datadoghq.com
          DD_API_KEY: ${{ secrets.dd-api-key }}
        run: yarn test:ci

I thought we could simplify this and remove the dd-trace install in each repository by switching to the action, but when I try to do this I get:

Error: Your application tried to access koalas, but it isn't declared in your dependencies; this makes the require call ambiguous and unsound.

Required package: koalas
Required by: /home/runner/work/<repo>/.datadog/lib/node_modules/dd-trace/packages/dd-trace/src/log/

The steps here looked like this:

     - name: Set up Datadog CI
        uses: datadog/test-visibility-github-action@4d09028b08a1f4431663b1de1550249cd4764051 # v2.4.1
        with:
          languages: js
          api_key: ${{ secrets.dd-api-key }}
          service: ${{ github.event.repository.name }}
      - name: Run Tests
        env:
          NODE_OPTIONS: --max-old-space-size=12288 -r ${{ env.DD_TRACE_PACKAGE }}
        run: yarn test:ci

I also tried to use the old trick of prefixing the pnp file like this:

      - name: Run Tests
        env:
          NODE_OPTIONS: --max-old-space-size=12288 ${{ contains(inputs.node-linker, 'pnp') && '-r ./.pnp.cjs' }} -r ${{ env.DD_TRACE_PACKAGE }}
        run: yarn test:ci

But hit the same error.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions