datadog-ci icon indicating copy to clipboard operation
datadog-ci copied to clipboard

datadog-ci sourcemaps ignores files ends with ".map"

Open 29decibel opened this issue 1 year ago • 3 comments

Bug description

Current Datadog sourcemap only supports files ends with .js.map. We (an Ember app) by default generated source map files without js extension, even though they are valid source maps, it's being ignored.

Our dist/assets folder:

chunk.128.a23ce5af91ea36acb761.js
chunk.128.a23ce5af91ea36acb761.map
chunk.131.4df5e3946277eefe263f.js
chunk.131.4df5e3946277eefe263f.map
chunk.143.83f16df156414da21882.css
chunk.143.83f16df156414da21882.js
chunk.143.83f16df156414da21882.map
chunk.178.93ed4b06ddb90a651caf.js
chunk.178.93ed4b06ddb90a651caf.map
chunk.210.783e83f8a31ec9d05e17.js
chunk.210.783e83f8a31ec9d05e17.map
...

Running datadog cli

  ./node_modules/.bin/datadog-ci sourcemaps upload ./dist/assets \
    --service=example-service \
    --release-version=1.0.0+cb02ea38 \
    --minified-path-prefix=/frontend/assets --dry-run

Since it's hard coded to only scan js.map, thus it can't find the sourcemaps in the folder:

Reference: https://github.com/DataDog/datadog-ci/blob/master/src/commands/sourcemaps/upload.ts#L173

  private getMatchingSourcemapFiles = async (): Promise<Sourcemap[]> => {
    const sourcemapFiles = glob.sync(buildPath(this.basePath!, '**/*js.map'))

Command summary:
⚠️ No sourcemaps detected. Did you specify the correct directory?

Describe what you expected

It should be able to pick up *.map files in the passing directory as well. Or at least allow passing additional argument to customize the source map file extension.

Steps to reproduce the issue

No response

Additional context

All

Command

sourcemaps

29decibel avatar May 15 '23 16:05 29decibel

This is an issue for us, too.

Jgordon-pencilwrench avatar Jul 25 '23 18:07 Jgordon-pencilwrench

Can we get some updates on this?

29decibel avatar Aug 22 '23 19:08 29decibel

Can we get some updates on this?

try dist/assets/ instead of ./dist/assets

Bug description

Current Datadog sourcemap only supports files ends with .js.map. We (an Ember app) by default generated source map files without js extension, even though they are valid source maps, it's being ignored.

Our dist/assets folder:

chunk.128.a23ce5af91ea36acb761.js
chunk.128.a23ce5af91ea36acb761.map
chunk.131.4df5e3946277eefe263f.js
chunk.131.4df5e3946277eefe263f.map
chunk.143.83f16df156414da21882.css
chunk.143.83f16df156414da21882.js
chunk.143.83f16df156414da21882.map
chunk.178.93ed4b06ddb90a651caf.js
chunk.178.93ed4b06ddb90a651caf.map
chunk.210.783e83f8a31ec9d05e17.js
chunk.210.783e83f8a31ec9d05e17.map
...

Running datadog cli

  ./node_modules/.bin/datadog-ci sourcemaps upload ./dist/assets \
    --service=example-service \
    --release-version=1.0.0+cb02ea38 \
    --minified-path-prefix=/frontend/assets --dry-run

Since it's hard coded to only scan js.map, thus it can't find the sourcemaps in the folder:

Reference: https://github.com/DataDog/datadog-ci/blob/master/src/commands/sourcemaps/upload.ts#L173

  private getMatchingSourcemapFiles = async (): Promise<Sourcemap[]> => {
    const sourcemapFiles = glob.sync(buildPath(this.basePath!, '**/*js.map'))
Command summary:
⚠️ No sourcemaps detected. Did you specify the correct directory?

Describe what you expected

It should be able to pick up *.map files in the passing directory as well. Or at least allow passing additional argument to customize the source map file extension.

Steps to reproduce the issue

No response

Additional context

All

Command

sourcemaps

try dist/assets/ instead of ./dist/assets

KSinichkina avatar Nov 08 '23 15:11 KSinichkina