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

support my-repo@[version] versions #653

Closed
wyardley opened this issue Oct 13, 2022 · 2 comments · May be fixed by #655
Closed

support my-repo@[version] versions #653

wyardley opened this issue Oct 13, 2022 · 2 comments · May be fixed by #655

Comments

@wyardley
Copy link

From what I can see at, e.g., https://docs.sentry.io/product/cli/releases/, Sentry seems to intend for you to use reponame@version (where version is either a commit hash or semver`) vs.

repoPrefix allows generating reponame-1.2.3, but not reponame@1.2.3.

Would you accept a PR to support a different parameter to support this, or do you know of another workaround to tweak the way the plugin receives ctx.nextRelease.version?

ryshu added a commit to ryshu/semantic-release-sentry-releases that referenced this issue Mar 2, 2023
Closes eclass#653

BREAKING CHANGE: Use sentry reponame@1.2.3 name instead of reponame-1.2.3 which doesn't match any convention in Sentry
ryshu added a commit to ryshu/semantic-release-sentry-releases that referenced this issue Mar 2, 2023
Closes eclass#653

BREAKING CHANGE: Use sentry reponame@1.2.3 name instead of reponame-1.2.3 which doesn't match any convention in Sentry
ryshu referenced this issue in SpikeeLabs/semantic-release-sentry-releases Mar 16, 2023
Related to eclass#653

BREAKING CHANGE: Use sentry reponame@1.2.3 name instead of reponame-1.2.3
which doesn't match any convention in Sentry.
ryshu referenced this issue in SpikeeLabs/semantic-release-sentry-releases Mar 16, 2023
Related to eclass#653

BREAKING CHANGE: Use sentry reponame@1.2.3 name instead of reponame-1.2.3
which doesn't match any convention in Sentry.
ryshu referenced this issue in SpikeeLabs/semantic-release-sentry-releases Mar 16, 2023
Related to eclass#653

BREAKING CHANGE: Use sentry reponame@1.2.3 name instead of reponame-1.2.3
which doesn't match any convention in Sentry.
ryshu added a commit to ryshu/semantic-release-sentry-releases that referenced this issue Mar 16, 2023
Closes eclass#653

BREAKING CHANGE: Use sentry reponame@1.2.3 name instead of reponame-1.2.3 which doesn't match any convention in Sentry
@csprocket777
Copy link

Why wasn't this merged into master? Sentry wants Semver formats when reporting in releases. Why force the -?

@csprocket777
Copy link

I've gone one step further and included a generate-notes step for the plugin that will log the next sentryReleaseVersion in both dry-run and real modes for the purposes of transparency.

Here's the code: (warning, it doesn't have tests and was a quick tool for my purposes. sharing here in case it helps anyone else)

const AggregateError = require('aggregate-error')
const SemanticReleaseError = require('@semantic-release/error')
const getError = require('./get-error')


/**
 * @typedef {import('./types').Context} Context
 * @typedef {import('./types').Config} Config
 */
/**
 * @param {Config} pluginConfig -.
 * @param {Context} ctx -.
 * @returns {Promise<*>} -.
 * @example
 * generate-notes(pluginConfig, ctx)
 */
module.exports = async (pluginConfig, ctx) => {
  try {
    const sentryReleaseVersion = pluginConfig.releasePrefix
      ? `${pluginConfig.releasePrefix}@${ctx.nextRelease.version}`
      : ctx.nextRelease.version
    ctx.logger.log(`Next version tag to be sent to Sentry: ${sentryReleaseVersion}`)
  } catch (err) {
    if (err instanceof AggregateError || err instanceof SemanticReleaseError) {
      throw err
    } else {
      throw getError('ESENTRYDEPLOY', ctx)
    }
  }
}

For anyone else running into this, instead of forking this repo for the functionality described above, you could also patch it through yarn.

Here is my resulting yarn patch file:
@eclass-semantic-release-sentry-releases-npm-3.1.0-87ddca8c75.patch

You would implement it in your package.json file as a resolution:

  "resolutions": {
    "@eclass/semantic-release-sentry-releases@^3.1.0": "patch:@eclass/semantic-release-sentry-releases@npm%3A3.1.0#./.yarn/patches/@eclass-semantic-release-sentry-releases-npm-3.1.0-87ddca8c75.patch",
    "@eclass/semantic-release-sentry-releases@^3.0.0": "patch:@eclass/semantic-release-sentry-releases@npm%3A3.1.0#./.yarn/patches/@eclass-semantic-release-sentry-releases-npm-3.1.0-87ddca8c75.patch"
  },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants