-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
203 additions
and
107 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
from dataclasses import dataclass | ||
from enum import Enum | ||
|
||
from sentry.integrations.utils.metrics import EventLifecycleMetric, EventLifecycleOutcome | ||
|
||
|
||
class SCMPipelineViewType(Enum): | ||
"""A specific step in an SCM integration's pipeline that is not a static page.""" | ||
|
||
# IdentityProviderPipeline | ||
IDENTITY_PROVIDER = "IDENTITY_PROVIDER" | ||
|
||
# GitHub | ||
OAUTH_LOGIN = "OAUTH_LOGIN" | ||
GITHUB_INSTALLATION = "GITHUB_INSTALLATION" | ||
|
||
# Bitbucket | ||
VERIFY_INSTALLATION = "VERIFY_INSTALLATION" | ||
|
||
# Bitbucket Server | ||
# OAUTH_LOGIN = "OAUTH_LOGIN" | ||
OAUTH_CALLBACK = "OAUTH_CALLBACK" | ||
|
||
# Azure DevOps | ||
ACCOUNT_CONFIG = "ACCOUNT_CONFIG" | ||
|
||
def __str__(self) -> str: | ||
return self.value.lower() | ||
|
||
|
||
@dataclass | ||
class SCMPipelineViewEvent(EventLifecycleMetric): | ||
"""An instance to be recorded of a user going through an integration pipeline view (step).""" | ||
|
||
interaction_type: SCMPipelineViewType | ||
provider_key: str | ||
|
||
def get_key(self, outcome: EventLifecycleOutcome) -> str: | ||
return self.get_standard_key( | ||
domain="source_code", | ||
integration_name=self.provider_key, | ||
interaction_type=str(self.interaction_type), | ||
outcome=outcome, | ||
) |
This file contains 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