] setup_alert = { "type": "info", "text": "The Slack integration adds a new Alert Rule action to all projects. To enable automatic notifications sent to Slack you must create a rule using the slack workspace action in your project settings.", } reauthentication_alert = { "alertText": "Upgrade Slack to avoid any disruption to service. It'll be worth it, we promise.", } metadata = IntegrationMetadata( description=_(DESCRIPTION.strip()), features=FEATURES, author="The Sentry Team", noun=_("Workspace"), issue_url="https://github.com/getsentry/sentry/issues/new?title=Slack%20Integration:%20&labels=Component%3A%20Integrations", source_url="https://github.com/getsentry/sentry/tree/master/src/sentry/integrations/slack", aspects={"alerts": [setup_alert], "reauthentication_alert": reauthentication_alert}, ) class SlackIntegration(IntegrationInstallation): def get_config_data(self): return {"installationType": get_integration_type(self.model)} class SlackIntegrationProvider(IntegrationProvider): key = "slack" name = "Slack" metadata = metadata
from .repository import GitHubEnterpriseRepositoryProvider from .client import GitHubEnterpriseAppsClient DESCRIPTION = """ Define a relationship between Sentry and GitHub Enterprise. * Authorize repositories to be added for syncing commit data. * Create or link existing GitHub Enterprise issues. """ metadata = IntegrationMetadata( description=DESCRIPTION.strip(), author='The Sentry Team', noun=_('Installation'), issue_url= 'https://github.com/getsentry/sentry/issues/new?title=GitHub%20Integration:%20&labels=Component%3A%20Integrations', source_url= 'https://github.com/getsentry/sentry/tree/master/src/sentry/integrations/github_enterprise', aspects={}) API_ERRORS = { 404: 'GitHub Enterprise returned a 404 Not Found error.', 401: ERR_UNAUTHORIZED, } class GitHubEnterpriseIntegration(Integration, GitHubIssueBasic, RepositoryMixin): def get_client(self): base_url = urlparse(self.model.metadata['domain_name']).netloc
from django.utils.translation import ugettext_lazy as _ from sentry.web.helpers import render_to_response from sentry.integrations import IntegrationProvider, IntegrationMetadata from sentry.pipeline import NestedPipelineView, PipelineView from sentry.identity.pipeline import IdentityProviderPipeline from sentry.identity.vsts import VSTSIdentityProvider from sentry.utils.http import absolute_uri DESCRIPTION = """ VSTS """ metadata = IntegrationMetadata( description=DESCRIPTION.strip(), author='The Sentry Team', noun=_('Account'), issue_url='https://github.com/getsentry/sentry/issues/new?title=VSTS%20Integration:%20&labels=Component%3A%20Integrations', source_url='https://github.com/getsentry/sentry/tree/master/src/sentry/integrations/vsts', aspects={}, ) class ProjectConfigView(PipelineView): def dispatch(self, request, pipeline): if 'project' in request.POST: project_id = request.POST.get('project') projects = pipeline.fetch_state(key='projects') project = self.get_project_from_id(project_id, projects) if project is not None: pipeline.bind_state('project', project) return pipeline.next_step()
disable_dialog = { "actionText": _("Visit Vercel"), "body": _("In order to uninstall this integration, you must go" " to Vercel and uninstall there by clicking 'Remove Configuration'."), } metadata = IntegrationMetadata( description=DESCRIPTION.strip(), features=FEATURES, author="The Sentry Team", noun=_("Installation"), issue_url= "https://github.com/getsentry/sentry/issues/new?title=Vercel%20Integration:%20&labels=Component%3A%20Integrations", source_url= "https://github.com/getsentry/sentry/tree/master/src/sentry/integrations/vercel", aspects={ "externalInstall": external_install, "configure_integration": configure_integration, "disable_dialog": disable_dialog, }, ) internal_integration_overview = ( "This internal integration was auto-generated during the installation process of your Vercel" " integration. It is needed to provide the token used to create a release. If this integration is " "deleted, your Vercel integration will stop working!") class VercelIntegration(IntegrationInstallation):
} discover_unfurl_alert = { "type": "warning", "text": "Project permissions will not apply when unfurling Sentry Discover charts from within your Slack workspace.", "icon": "icon-warning-sm", "feature": "chart-unfurls", } metadata = IntegrationMetadata( description=_(DESCRIPTION.strip()), features=FEATURES, author="The Sentry Team", noun=_("Workspace"), issue_url= "https://github.com/getsentry/sentry/issues/new?assignees=&labels=Component:%20Integrations&template=bug.yml&title=Slack%20Integration%20Problem", source_url= "https://github.com/getsentry/sentry/tree/master/src/sentry/integrations/slack", aspects={"alerts": [setup_alert, discover_unfurl_alert]}, ) class SlackIntegration(IntegrationInstallation): # type: ignore def get_config_data(self) -> Mapping[str, str]: return {"installationType": get_integration_type(self.model)} def uninstall(self) -> None: """ Delete all parent-specific notification settings. For each user and team, if this is their ONLY Slack integration, set their parent-independent
""", IntegrationFeatures.ISSUE_BASIC, ), FeatureDescription( """ Link Sentry issues to existing GitLab issues """, IntegrationFeatures.ISSUE_BASIC, ), ] metadata = IntegrationMetadata( description=DESCRIPTION.strip(), features=FEATURES, author="The Sentry Team", noun=_("Installation"), issue_url="https://github.com/getsentry/sentry/issues/", source_url= "https://github.com/getsentry/sentry/tree/master/src/sentry/integrations/gitlab", aspects={}, ) class GitlabIntegration(IntegrationInstallation, GitlabIssueBasic, RepositoryMixin): repo_search = True def __init__(self, *args, **kwargs): super(GitlabIntegration, self).__init__(*args, **kwargs) self.default_identity = None def get_group_id(self):
FeatureDescription( """ Create and link Sentry issue groups directly to a GitHub issue or pull request in any of your repositories, providing a quick way to jump from Sentry bug to tracked issue or PR! """, IntegrationFeatures.ISSUE_BASIC, ), ] metadata = IntegrationMetadata( description=DESCRIPTION.strip(), features=FEATURES, author="The Sentry Team", noun=_("Installation"), issue_url= "https://github.com/getsentry/sentry/issues/new?assignees=&labels=Component:%20Integrations&template=bug_report.md&title=GitHub%Integration%20Problem", source_url= "https://github.com/getsentry/sentry/tree/master/src/sentry/integrations/github", aspects={}, ) API_ERRORS = { 404: "If this repository exists, ensure" " that your installation has permission to access this repository" " (https://github.com/settings/installations).", 401: ERR_UNAUTHORIZED, }
IntegrationFeatures.ISSUE_SYNC, ), FeatureDescription( """ Synchronize Comments on Sentry Issues directly to the linked Jira ticket. """, IntegrationFeatures.ISSUE_SYNC, ), ] metadata = IntegrationMetadata( description=_(DESCRIPTION.strip()), features=FEATURE_DESCRIPTIONS, author='The Sentry Team', noun=_('Instance'), issue_url='https://github.com/getsentry/sentry/issues/new?title=Jira%20Server%20Integration:%20&labels=Component%3A%20Integrations', source_url='https://github.com/getsentry/sentry/tree/master/src/sentry/integrations/jira_server', aspects={}, ) class InstallationForm(forms.Form): url = forms.CharField( label=_('Jira URL'), help_text=_('The base URL for your Jira Server instance, including the host and protocol.'), widget=forms.TextInput( attrs={'placeholder': 'https://jira.example.com'} ), ) verify_ssl = forms.BooleanField(
directly within your Slack workspace. * Resolve, ignore, and assign issues with minimal context switching. * Configure rule based Slack notifications to automatically be posted into the specified channel. """ alert_link = { 'text': 'Looking to send Sentry alerts to Slack? Add an **Alert Rule** for this project.', 'link': '/settings/{orgId}/{projectId}/alerts/rules/' } metadata = IntegrationMetadata( description=DESCRIPTION.strip(), author='The Sentry Team', issue_url='https://github.com/getsentry/sentry/issues/new?title=Slack%20Integration:%20&labels=Component%3A%20Integrations', source_url='https://github.com/getsentry/sentry/tree/master/src/sentry/integrations/slack', aspects={ 'alert_link': alert_link, } ) class SlackIntegration(Integration): key = 'slack' name = 'Slack' metadata = metadata identity_oauth_scopes = frozenset([ 'channels:read', 'chat:write', 'links:read',
""" external_install = { # TODO(jess): update this when we have our app listed on the # atlassian marketplace 'url': 'https://marketplace.atlassian.com/', 'buttonText': _('Jira Marketplace'), 'noticeText': _(INSTALL_NOTICE_TEXt.strip()), } metadata = IntegrationMetadata( description=_(DESCRIPTION.strip()), author='The Sentry Team', noun=_('Instance'), issue_url= 'https://github.com/getsentry/sentry/issues/new?title=Jira%20Integration:%20&labels=Component%3A%20Integrations', source_url= 'https://github.com/getsentry/sentry/tree/master/src/sentry/integrations/jira', aspects={ 'externalInstall': external_install, }, ) # hide sprint, epic link, parent and linked issues fields because they don't work # since sprint and epic link are "custom" we need to search for them by name HIDDEN_ISSUE_FIELDS = { 'keys': ['parent', 'issuelinks'], 'names': ['Sprint', 'Epic Link'], } # A list of common builtin custom field types for Jira for easy reference. JIRA_CUSTOM_FIELD_TYPES = {
"noticeText": _(INSTALL_NOTICE_TEXT), } configure_integration = {"title": _("Connect Your Projects")} create_project_instruction = _( "Don't have a project yet? Click [here]({}) to create one.") install_source_code_integration = _( "Install a [source code integration]({}) and configure your repositories.") metadata = IntegrationMetadata( description=DESCRIPTION.strip(), features=FEATURES, author="The Sentry Team", noun=_("Installation"), issue_url= "https://github.com/getsentry/sentry/issues/new?assignees=&labels=Component:%20Integrations&template=bug.yml&title=Vercel%20Integration%20Problem", source_url= "https://github.com/getsentry/sentry/tree/master/src/sentry/integrations/vercel", aspects={ "externalInstall": external_install, "configure_integration": configure_integration, }, ) internal_integration_overview = ( "This internal integration was auto-generated during the installation process of your Vercel" " integration. It is needed to provide the token used to create a release. If this integration is " "deleted, your Vercel integration will stop working!") class VercelIntegration(IntegrationInstallation): @property
* Resolve, ignore, and assign issues with minimal context switching. * Configure rule based Slack notifications to automatically be posted into a specific channel. Want any error that's happening more than 100 times a minute to be posted in `#critical-errors`? Setup a rule for it! """ setup_alert = { 'type': 'info', 'text': 'The Slack integration adds a new Alert Rule action to all projects. To enable automatic notifications sent to Slack you must create a rule using the slack workspace action in your project settings.', } metadata = IntegrationMetadata( description=_(DESCRIPTION.strip()), author='The Sentry Team', noun=_('Workspace'), issue_url='https://github.com/getsentry/sentry/issues/new?title=Slack%20Integration:%20&labels=Component%3A%20Integrations', source_url='https://github.com/getsentry/sentry/tree/master/src/sentry/integrations/slack', aspects={ 'alerts': [setup_alert], } ) class SlackIntegrationProvider(IntegrationProvider): key = 'slack' name = 'Slack' metadata = metadata features = frozenset([ IntegrationFeatures.NOTIFICATION, IntegrationFeatures.CHAT_UNFURL, ])
IntegrationFeatures.ISSUE_BASIC, ), FeatureDescription( """ Link Sentry issues to existing Bitbucket issues """, IntegrationFeatures.ISSUE_BASIC, ), ] metadata = IntegrationMetadata( description=DESCRIPTION.strip(), features=FEATURES, author='The Sentry Team', noun=_('Installation'), issue_url= 'https://github.com/getsentry/sentry/issues/new?title=Bitbucket%20Integration:%20&labels=Component%3A%20Integrations', source_url= 'https://github.com/getsentry/sentry/tree/master/src/sentry/integrations/bitbucket', aspects={}, ) scopes = ( 'account', 'email', 'issue:write', 'pullrequest', 'repository', 'repository:admin', 'team', 'webhook', )
from sentry.identity.pipeline import IdentityProviderPipeline from sentry.identity.gitlab import get_user_info from sentry.identity.gitlab.provider import GitlabIdentityProvider from sentry.integrations import IntegrationInstallation, IntegrationFeatures, IntegrationProvider, IntegrationMetadata from sentry.pipeline import NestedPipelineView, PipelineView from sentry.utils.http import absolute_uri DESCRIPTION = """ Fill me out """ metadata = IntegrationMetadata( description=DESCRIPTION.strip(), author='The Sentry Team', noun=_('Installation'), issue_url='https://github.com/getsentry/sentry/issues/', source_url= 'https://github.com/getsentry/sentry/tree/master/src/sentry/integrations/gitlab', aspects={}, ) class GitlabIntegration(IntegrationInstallation): def get_client(self): pass class InstallationForm(forms.Form): url = forms.CharField( label=_("Installation Url"), help_text=_('The "base URL" for your gitlab instance, '
pipeline.bind_state('name', request.POST['name']) return pipeline.next_step() return HttpResponse(self.TEMPLATE) DESCRIPTION = """ This is an example integration * Descriptions support _markdown rendering_. """ metadata = IntegrationMetadata( description=DESCRIPTION.strip(), author='The Sentry Team', noun='example', issue_url='https://github.com/getsentry/sentry/issues/new', source_url='https://github.com/getsentry/sentry', aspects={}, ) class ExampleIntegration(Integration, IssueSyncMixin): def create_comment(self): pass def create_issue(self, data, **kwargs): if 'assignee' not in data: raise IntegrationError('Assignee is required') return { 'key': 'APP-123', 'title': 'This is a test external issue title',
DESCRIPTION = """ This is an example integration. Descriptions support _markdown rendering_. """ FEATURES = [ FeatureDescription( "This is a feature description. Also *supports markdown*", IntegrationFeatures.ISSUE_SYNC) ] metadata = IntegrationMetadata( description=DESCRIPTION.strip(), features=FEATURES, author="The Sentry Team", noun="example", issue_url="https://github.com/getsentry/sentry/issues/new", source_url="https://github.com/getsentry/sentry", aspects={}, ) class ExampleIntegration(IntegrationInstallation, IssueSyncMixin): comment_key = "sync_comments" outbound_status_key = "sync_status_outbound" inbound_status_key = "sync_status_inbound" outbound_assignee_key = "sync_assignee_outbound" inbound_assignee_key = "sync_assignee_inbound" def get_issue_url(self, key): return u"https://example/issues/{}".format(key)
"icon-warning-sm", "text": "Your GitHub enterprise instance must be able to communicate with" " Sentry. Sentry makes outbound requests from a [static set of IP" " addresses](https://docs.sentry.io/ip-ranges/) that you may wish" " to allow in your firewall to support this integration.", } metadata = IntegrationMetadata( description=DESCRIPTION.strip(), features=FEATURES, author="The Sentry Team", noun=_("Installation"), issue_url= "https://github.com/getsentry/sentry/issues/new?title=GitHub%20Integration:%20&labels=Component%3A%20Integrations", source_url= "https://github.com/getsentry/sentry/tree/master/src/sentry/integrations/github_enterprise", aspects={ "disable_dialog": disable_dialog, "removal_dialog": removal_dialog, "alerts": [setup_alert], }, ) API_ERRORS = { 404: "If this repository exists, ensure" + " that your installation has permission to access this repository" + " (https://github.com/settings/installations).", 401: ERR_UNAUTHORIZED,
from .client import JiraApiClient alert_link = { 'text': 'Visit the **Atlassian Marketplace** to install this integration.', # TODO(jess): update this when we have our app listed on the # atlassian marketplace 'link': 'https://marketplace.atlassian.com/', } metadata = IntegrationMetadata( description='Sync Sentry and JIRA issues.', author='The Sentry Team', noun=_('Instance'), issue_url='https://github.com/getsentry/sentry/issues/new?title=JIRA%20Integration:%20&labels=Component%3A%20Integrations', source_url='https://github.com/getsentry/sentry/tree/master/src/sentry/integrations/jira', aspects={ 'alert_link': alert_link, }, ) # A list of common builtin custom field types for JIRA for easy reference. JIRA_CUSTOM_FIELD_TYPES = { 'select': 'com.atlassian.jira.plugin.system.customfieldtypes:select', 'textarea': 'com.atlassian.jira.plugin.system.customfieldtypes:textarea', 'multiuserpicker': 'com.atlassian.jira.plugin.system.customfieldtypes:multiuserpicker', 'tempo_account': 'com.tempoplugin.tempo-accounts:accounts.customfield' } class JiraIntegration(Integration, IssueSyncMixin):
removal_dialog = { 'actionText': 'Delete', 'body': 'Deleting this integration will delete all associated repositories' ' and commit data. This action cannot be undone. Are you sure you' ' want to delete your integration?', } metadata = IntegrationMetadata( description=DESCRIPTION.strip(), features=FEATURES, author='The Sentry Team', noun=_('Installation'), issue_url= 'https://github.com/getsentry/sentry/issues/new?title=GitHub%20Integration:%20&labels=Component%3A%20Integrations', source_url= 'https://github.com/getsentry/sentry/tree/master/src/sentry/integrations/github', aspects={ 'disable_dialog': disable_dialog, 'removal_dialog': removal_dialog, }, ) API_ERRORS = { 404: 'GitHub returned a 404 Not Found error. If this repository exists, ensure' ' that your installation has permission to access this repository' ' (https://github.com/settings/installations).', 401: ERR_UNAUTHORIZED, }
"warning", "icon": "icon-warning-sm", "text": "Your Jira instance must be able to communicate with Sentry." " Sentry makes outbound requests from a [static set of IP" " addresses](https://docs.sentry.io/ip-ranges/) that you may wish" " to allow in your firewall to support this integration.", } metadata = IntegrationMetadata( description=_(DESCRIPTION.strip()), features=FEATURE_DESCRIPTIONS, author="The Sentry Team", noun=_("Installation"), issue_url= "https://github.com/getsentry/sentry/issues/new?assignees=&labels=Component:%20Integrations&template=bug.yml&title=Jira%20Server%20Integration%20Problem", source_url= "https://github.com/getsentry/sentry/tree/master/src/sentry/integrations/jira_server", aspects={"alerts": [setup_alert]}, ) class InstallationForm(forms.Form): url = forms.CharField( label=_("Jira URL"), help_text= _("The base URL for your Jira Server instance, including the host and protocol." ), widget=forms.TextInput( attrs={"placeholder": "https://jira.example.com"}),
), FeatureDescription( """ Synchronize comments on Sentry Issues directly to the linked Azure DevOps workitems. """, IntegrationFeatures.ISSUE_SYNC, ), ] metadata = IntegrationMetadata( description=DESCRIPTION.strip(), features=FEATURES, author="The Sentry Team", noun=_("Installation"), issue_url= "https://github.com/getsentry/sentry/issues/new?title=VSTS%20Integration:%20&labels=Component%3A%20Integrations", source_url= "https://github.com/getsentry/sentry/tree/master/src/sentry/integrations/vsts", aspects={}, ) logger = logging.getLogger("sentry.integrations") class VstsIntegration(IntegrationInstallation, RepositoryMixin, VstsIssueSync): logger = logger comment_key = "sync_comments" outbound_status_key = "sync_status_forward" inbound_status_key = "sync_status_reverse" outbound_assignee_key = "sync_forward_assignment"
DESCRIPTION = """ This is an example integration. Descriptions support _markdown rendering_. """ FEATURES = [ FeatureDescription( "This is a feature description. Also *supports markdown*", IntegrationFeatures.ISSUE_SYNC ) ] metadata = IntegrationMetadata( description=DESCRIPTION.strip(), features=FEATURES, author="The Sentry Team", noun="example", issue_url="https://github.com/getsentry/sentry/issues/new?assignees=&labels=Component:%20Integrations&template=bug_report.md&title=Integration%20Problem", source_url="https://github.com/getsentry/sentry", aspects={}, ) class ExampleIntegration(IntegrationInstallation, IssueSyncMixin): comment_key = "sync_comments" outbound_status_key = "sync_status_outbound" inbound_status_key = "sync_status_inbound" outbound_assignee_key = "sync_assignee_outbound" inbound_assignee_key = "sync_assignee_inbound" def get_issue_url(self, key): return f"https://example/issues/{key}"
Sentry add-on, access the settings panel in your Jira instance to enable the integration for this Organization. """ external_install = { "url": "https://marketplace.atlassian.com/apps/1219432/sentry-for-jira", "buttonText": _("Jira Marketplace"), "noticeText": _(INSTALL_NOTICE_TEXT.strip()), } metadata = IntegrationMetadata( description=_(DESCRIPTION.strip()), features=FEATURE_DESCRIPTIONS, author="The Sentry Team", noun=_("Instance"), issue_url= "https://github.com/getsentry/sentry/issues/new?title=Jira%20Integration:%20&labels=Component%3A%20Integrations", source_url= "https://github.com/getsentry/sentry/tree/master/src/sentry/integrations/jira", aspects={"externalInstall": external_install}, ) # hide sprint, epic link, parent and linked issues fields because they don't work # since sprint and epic link are "custom" we need to search for them by name HIDDEN_ISSUE_FIELDS = { "keys": ["parent", "issuelinks"], "names": ["Sprint", "Epic Link"] } # A list of common builtin custom field types for Jira for easy reference. JIRA_CUSTOM_FIELD_TYPES = {
), ] setup_alert = { 'type': 'info', 'text': 'The Opsgenie integration adds a new Alert Rule action to all projects. To enable automatic alerts sent to Opsgenie you must create a rule using the opsgenie account action in your project settings.', } metadata = IntegrationMetadata( description=_(DESCRIPTION.strip()), features=FEATURES, author='Kumarappan Arumugam', noun=_('Installation'), issue_url= 'https://github.com/kumarappan-arumugam/sentry-opsgenie/issues/new?title=Opsgenie%20Integration:%20&labels=Component%3A%20Integrations', source_url= 'https://github.com/kumarappan-arumugam/sentry-opsgenie/tree/master/sentry_opsgenie', aspects={ 'alerts': [setup_alert], }) class InstallationForm(forms.Form): name = forms.CharField( label="Provide a name for the integration", # choices=[], help_text= _('It will be easier to idenify the integration on the alert rules page if you provide a name.' ), widget=forms.TextInput(