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

fix(ecosystem): Track metrics for issue detail ticket creation #82436

Merged

Conversation

GabeVillalobos
Copy link
Member

Adds metric gathering and logging to ticket creation on the issue details page. These may need to be recategorized in the future as a different form of issue creation, but for now I think it's fine to track this along with our issue alert rule metrics.

@GabeVillalobos GabeVillalobos requested a review from a team December 19, 2024 23:42
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Dec 19, 2024
@GabeVillalobos GabeVillalobos marked this pull request as ready for review December 19, 2024 23:51
Copy link
Contributor

@Christinarlong Christinarlong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm 👀

return Response(exc.field_errors, status=400)
except IntegrationError as e:
lifecycle.record_failure(e)
return Response({"non_field_errors": [str(e)]}, status=400)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q: What are examples of IntegrationErrors, like is that a failure on our side ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IntegrationErrors are any errors from a provider that our integrations themselves can't classify as a "field" error.

We have some internal handling in the base IntegrationInstallation class that checks any ApiInvalidRequestError responses our integration methods raise:

def raise_error(self, exc: Exception, identity: Identity | None = None) -> NoReturn:

Which call into the implementing integration class's error_fields_from_json method:

def error_fields_from_json(self, data):

Copy link

codecov bot commented Dec 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #82436      +/-   ##
==========================================
+ Coverage   79.44%   80.44%   +1.00%     
==========================================
  Files        7299     7307       +8     
  Lines      321843   322300     +457     
  Branches    21011    21011              
==========================================
+ Hits       255678   259268    +3590     
+ Misses      65760    62627    -3133     
  Partials      405      405              

)

try:
data = installation.create_issue(request.data)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might be worth tracking with a different slug b/c i have a feeling we have different levels of success based on where the ticket is created from.

also wondering if we should have a SLO around the endpoint that allows the user to search for a ticket in the 3p in the issue details page.

Copy link
Member Author

@GabeVillalobos GabeVillalobos Dec 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I think you're right 🤔 I'll add that now. As for search SLOs, let's discuss this during office hours today.

@GabeVillalobos GabeVillalobos requested a review from a team as a code owner December 20, 2024 18:08
@GabeVillalobos GabeVillalobos merged commit 8d5d0b5 into master Dec 20, 2024
49 checks passed
@GabeVillalobos GabeVillalobos deleted the gv/fix-metrics-for-issue-detail-ticket-creation branch December 20, 2024 20:01
Copy link

sentry-io bot commented Dec 21, 2024

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ IntegrationError: Error Communicating with Jira (HTTP 400): Issue can be assigned only active or future sprints. /api/0/organizations/{organization_id_or_slug}/... View Issue
  • ‼️ IntegrationError: Error Communicating with Bitbucket (HTTP 404): Repository has no issue tracker. /api/0/organizations/{organization_id_or_slug}/... View Issue
  • ‼️ IntegrationError: Error Communicating with GitHub (HTTP 410): Issues are disabled for this repo /api/0/organizations/{organization_id_or_slug}/... View Issue
  • ‼️ IntegrationError: Error Communicating with GitLab (HTTP 503): unknown error /api/0/organizations/{organization_id_or_slug}/... View Issue
  • ‼️ IntegrationError: Error Communicating with Azure DevOps (HTTP 400): TF401320: Rule Error for field FoundVersio. Err... /api/0/organizations/{organization_id_or_slug}/... View Issue

Did you find this useful? React with a 👍 or 👎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Backend Automatically applied to PRs that change backend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants