This repository was archived by the owner on Nov 20, 2023. It is now read-only.
feat: Add setCommits option#139
Merged
kamilogorek merged 6 commits intogetsentry:masterfrom Oct 8, 2019
dmitryrn:master
Merged
feat: Add setCommits option#139kamilogorek merged 6 commits intogetsentry:masterfrom dmitryrn:master
kamilogorek merged 6 commits intogetsentry:masterfrom
dmitryrn:master
Conversation
Contributor
Author
|
Also I realised that I also might need to use deploys. This is for the thread #71. BTW I wrote simple webpack-3 plugin: I run this Also I'll write and use similar So what do you think: do we really need such functionality in this plugin? |
Contributor
Author
|
Oh, no way! We need to add |
added 2 commits
September 26, 2019 21:54
change condition for setCommits call
Contributor
Author
|
@kamilogorek can you review this? |
Contributor
Author
|
Also I wrote and use following plugin for Sentry Deploys: I use Sentry API here instead of sentry-cli because bridge-like thing from Rust to JS does not implemented like for const assert = require('assert')
const axios = require('axios').default
class SentryDeploysPlugin {
constructor(options) {
this.options = options
}
apply(compiler) {
compiler.hooks.emit.tapAsync(
'SentryDeploysPlugin',
async (compilation, callback) => {
const {
version,
authToken,
orgSlug,
serverUrl,
} = this.options
assert(typeof version === 'string', 'option version is incorrect')
assert(typeof authToken === 'string', 'option authToken is incorrect')
assert(typeof orgSlug === 'string', 'option orgSlug is incorrect')
assert(typeof serverUrl === 'string', 'option serverUrl is incorrect')
try {
console.info('\n\n> Creating sentry deploy...')
await axios.post(`${serverUrl}api/0/organizations/${orgSlug}/releases/${version}/deploys/`, {
environment: 'production',
}, {
headers: {
Authorization: `Bearer ${authToken}`,
},
})
console.info('> Sentry deploy created successfully\n')
callback()
} catch (error) {
console.info('> Sentry deploy failed!\n')
console.error('Sentry server response: ', error.response.data)
callback(error)
}
}
)
}
}
module.exports = SentryDeploysPlugin |
kamilogorek
approved these changes
Oct 8, 2019
kamilogorek
reviewed
Oct 8, 2019
kamilogorek
reviewed
Oct 8, 2019
kamilogorek
approved these changes
Oct 8, 2019
Contributor
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I added setCommits command to be able set associated commits through this plugin as requested here #71. Without this options you forced to use sentry-cli to set associated commits directly. Please check this out.
ToDo: