JulianMar / nuxt-bugsnag

Bugsnag module for nuxt.js
MIT License
49 stars 18 forks source link

Release stage always shows up as production #29

Closed dionisiatara closed 2 years ago

dionisiatara commented 2 years ago

Hello! I currently have this code below where process.env.STAGE is based on our Heroku's config vars setup. However, our Bugsnag issues always show up as production listed on the release stage, even when they come from our testing or staging deployment. Could someone please help pointing me in the right direction to set it up correctly? Is this possible to do with Heroku's config vars to determine the release stage? Thank you!

['nuxt-bugsnag', {
    config: {
        apiKey: 'api_key',
        enabledReleaseStages: ['testing', 'staging', 'production'],
        notifyReleaseStages: ['testing', 'staging', 'production'],
        publishRelease: true
    },
    reporterOptions: {
        releaseStage: process.env.STAGE,
        autoAssignRelease: true
    }
}]
JulianMar commented 2 years ago

Hey, try to use the releaseStage inside the config options.

['nuxt-bugsnag', {
    config: {
        apiKey: 'api_key',
        enabledReleaseStages: ['testing', 'staging', 'production'],
        notifyReleaseStages: ['testing', 'staging', 'production'],
        publishRelease: true,
        releaseStage: process.env.STAGE, // this was moved
    }
}]
dionisiatara commented 2 years ago

Hey Julian, thank you so much for your suggestion. I just tried it and it worked! Do you mind explaining why it wasn't working previously? Are we supposed to put everything inside config options? (I was following the example and it has it set inside reporterOptions instead)

Also, per your code example above, does this mean autoAssignRelease: true that I had initially is unnecessary?

JulianMar commented 2 years ago

Hey, good to hear! The difference is the config is for passing config to the module. reporterOptions are for passing data straight to the bugsnag client. But in that case it may be overwritten by the config for the module. I will change the docs :)

AutoAssignRelease is not needed in your case, maybe that was even the issue https://docs.bugsnag.com/product/releases/#faqs