Skip to content

Commit

Permalink
fix(publish): support my-repo@[version] versions
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ryshu committed Mar 16, 2023
1 parent 4c4c129 commit 03b9a64
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ The plugin can be configured in the [**semantic-release** configuration file](ht
| `sourcemaps` | Directory with sourcemaps. Example `dist`. Optional for upload sourcemaps |
| `urlPrefix` | URL prefix for sourcemaps. Example `~/dist`. Optional for upload sourcemaps |
| `rewrite` | Boolean to indicate rewrite sourcemaps. Default `false`. Optional for upload sourcemaps |
| `releasePrefix` | String that is passed as prefix to the sentry release. <br/> Optional to fix the problem that releases are associated with the organization instead of the project ([Read More](https://github.com/getsentry/sentry-cli/issues/482)). <br/> Ex: `releasePrefix:"web1"` would resolve **only** the sentry release to `web1-1.0.0`. <br/>**Important Notice:** when you use this feature you also have to change the release name in your sentry client app. |
| `releasePrefix` | String that is passed as prefix to the sentry release. <br/> Optional to fix the problem that releases are associated with the organization instead of the project ([Read More](https://github.com/getsentry/sentry-cli/issues/482)). <br/> Ex: `releasePrefix:"web1"` would resolve **only** the sentry release to `web1@1.0.0`. <br/>**Important Notice:** when you use this feature you also have to change the release name in your sentry client app. |

| `pathToGitFolder` | Path to `.git` folder, relative to the current working directory. Optional. Defaults to current working directory |

Expand Down
2 changes: 1 addition & 1 deletion src/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ module.exports = async (pluginConfig, ctx) => {
const commits = await parseCommits(pluginConfig, ctx)
ctx.logger.log('Commit data retrieved')
const sentryReleaseVersion = pluginConfig.releasePrefix
? `${pluginConfig.releasePrefix}-${ctx.nextRelease.version}`
? `${pluginConfig.releasePrefix}@${ctx.nextRelease.version}`
: ctx.nextRelease.version
/** @type {SentryReleaseParams} */
const releaseDate = {
Expand Down
8 changes: 4 additions & 4 deletions test/publish.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,11 @@ describe('Publish', () => {
},
],
ref: '6ba09a7c53235ee8a8fa5ee4c1ca8ca886e7fdbb',
shortVersion: 'web1-1.0.0',
shortVersion: 'web1@1.0.0',
url: null,
version: 'web1-1.0.0',
version: 'web1@1.0.0',
})
.post('/api/0/organizations/valid/releases/web1-1.0.0/deploys/')
.post('/api/0/organizations/valid/releases/web1@1.0.0/deploys/')
.reply(201, {
name: 'amazon',
url: 'https://api.example.com/',
Expand Down Expand Up @@ -254,7 +254,7 @@ describe('Publish', () => {
ctx,
)
expect(result.release.version).to.equal(
`${releasePrefix}-${ctx.nextRelease.version}`,
`${releasePrefix}@${ctx.nextRelease.version}`,
)
})

Expand Down

0 comments on commit 03b9a64

Please sign in to comment.