nuxt-community / sentry-module

Sentry module for Nuxt 2
https://sentry.nuxtjs.org
MIT License
500 stars 113 forks source link

IgnoreMissing doesnt work #586

Closed fiCeVitka closed 1 year ago

fiCeVitka commented 1 year ago

Version

@nuxtjs/sentry: 7.3.0 nuxt: 2.15.8 @sentry/webpack-plugin: 1.20.1

Sentry configuration

sentry: {
    dsn: KEY,
    disabled: isLocal,
    publishRelease: {
      authToken: process.env.SENTRY_AUTH_TOKEN,
      org: process.env.SENTRY_ORG,
      project: process.env.SENTRY_PROJECT,
      setCommits: {
        auto: true,
        ignoreMissing: true
      },
      ignore: [
        'node_modules',
        '.nuxt/dist/client/img'
      ],
    },
    logMockCalls: false,
    sourceMapStyle: 'hidden-source-map',
    config: {
      environment: process.env.APP_ENV,
      release: process.env.GIT_COMMIT_SHA,
      captureUnhandledRejections: false,
    },
    clientConfig: {
      attachProps: true,
      trackComponents: true,
    },
  },

Steps to reproduce

I build project on the one commit hash twice (one on stage server and one on prod).

What is Expected?

Second build should be successful too

What is actually happening?

First build is successful, second catches build error:

ERROR in Sentry CLI Plugin: Command failed: ../node_modules/@sentry/cli/sentry-cli releases set-commits {hash} --auto --ignore-missing
error: No commits found. Change commits range, initial depth or use --ignore-empty to allow empty patch sets.
rchl commented 1 year ago

Maybe you want ignoreEmpty:

    /**
     * When the flag is set and the previous release commit was not found in the repository, will create a release
     * with the default commits count(or the one specified with `--initial-depth`) instead of failing the command.
     */
    ignoreMissing?: boolean;
    /**
     * When the flag is set, command will not fail and just exit silently if no new commits for a given release have been found.
     */
    ignoreEmpty?: boolean;
fiCeVitka commented 1 year ago

@rchl you are right, thank you! I missed this flag in docs. I'll close the issue