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

Allow users to specify js sourcemap file patterns in datadog-ci sourcemaps upload #1374

Open
davidsauntson opened this issue Jul 11, 2024 · 0 comments
Labels
enhancement New feature or request rum Related to [dsyms, flutter-symbols, unity-symbols, react-native, sourcemaps]

Comments

@davidsauntson
Copy link

davidsauntson commented Jul 11, 2024

Feature request description

Our front-end build pipeline (rails, sprockets, webpack) produces map files with filenames like [name].js-[digest].map. This is also true of an out-of-the-box installation of a rails app created with rails new -j webpack.

These filenames aren't seen as valid map files by the getMatchingSourcemapFiles() method in upload.ts.

Solution

Add an optional glob argument to getMatchingSourcemapFiles() that is used to get the sourcemap files from the given folder. The glob pattern can be passed in from the command line for users whose frontend pipeline creates sourcemap files with a different filename.

e.g.

const getMatchingSourcemapFiles = async (fileGlobPattern = '**/*.js.map') => {
    const sourcemapFiles = glob.sync(buildPath(this.basePath, fileGlobPattern));

    ...
}

Additional context

Another option is to loosen up the existing glob pattern with something that will always match the current one, so it's backwards compatible (e.g. **/*.js*.map)

I'd be happy to prepare a PR for this.

Command

sourcemaps

@davidsauntson davidsauntson added the enhancement New feature or request label Jul 11, 2024
@github-actions github-actions bot added the rum Related to [dsyms, flutter-symbols, unity-symbols, react-native, sourcemaps] label Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request rum Related to [dsyms, flutter-symbols, unity-symbols, react-native, sourcemaps]
Projects
None yet
Development

No branches or pull requests

1 participant