Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## [2.2.2] - 2025-07-03

- Ensure that we correctly pass the metadata the BugSnag CLI create build command (#100)

## [2.2.1] - 2025-05-27

- Ensure we expose all options in the Webpack plugin that are available in the Bugsnag CLI (#99)
Expand Down
6 changes: 4 additions & 2 deletions build-reporter-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,14 @@ class BugsnagBuildReporterPlugin {
const optionalOpts = {
autoAssignRelease: opts.build.autoAssignRelease,
builderName: opts.build.builderName,
metadata: opts.build.metadata,
metadata: Object.entries(opts.build.metadata)
.map(([key, value]) => `${key}=${value}`)
.join(','),
provider: opts.build.sourceControl.provider,
repository: opts.build.sourceControl.repository,
revision: opts.build.sourceControl.revision,
releaseStage: opts.build.releaseStage,
buildApiRootUrl: opts.build.endpoint,
buildApiRootUrl: opts.build.endpoint || opts.options.endpoint,
logLevel: opts.build.logLevel || opts.options.logLevel,
dryRun: opts.build.dryRun || opts.options.dryRun,
verbose: opts.build.verbose || opts.options.verbose,
Expand Down
3 changes: 2 additions & 1 deletion test/build-reporter-plugin.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ test('BugsnagBuildReporterPlugin', t => {
})

test('it sends upon successful build', t => {
t.plan(3)
t.plan(4)
const server = createServer((req, res) => {
let body = ''
req.on('data', (d) => { body += d })
Expand All @@ -37,6 +37,7 @@ test('it sends upon successful build', t => {
t.ok(j, 'json body was received')
t.equal(j.appVersion, '1.2.3', 'body should contain app version')
t.equal(j.apiKey, 'YOUR_API_KEY', 'body should contain api key')
t.same(j.metadata, { foo: 'bar', baz: 'qux' }, 'body should contain correct metadata')
})
})
server.listen()
Expand Down
6 changes: 5 additions & 1 deletion test/fixtures/a/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ module.exports = {
new BugsnagBuildReporterPlugin({
apiKey: 'YOUR_API_KEY',
appVersion: '1.2.3',
endpoint: `http://localhost:${process.env.PORT}`
endpoint: `http://localhost:${process.env.PORT}`,
metadata: {
foo: 'bar',
baz: 'qux'
}
})
]
}