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 #52676 update sentry scope configuration to remove deprecation wa… #53398

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

saimadib
Copy link

@saimadib saimadib commented Feb 8, 2025

…rning

Fixes #52676

What

  • Addresses deprecation warning that appears in build logs when building airbyte-ci/connectors/pipelines for testing
  • Updates the Sentry SDK scope configuration to use the new recommended API
  • Removes warning: sentry_sdk.configure_scope is deprecated and will be removed in the next major version

How

  • Modified sentry_utils.py to use get_current_scope() instead of deprecated configure_scope()
  • Updated the with_step_context decorator to follow Sentry SDK's new best practices
  • Maintains existing functionality while using the new API

Review guide

  1. airbyte-ci/connectors/pipelines/pipelines/helpers/sentry_utils.py
  • Key change is replacing configure_scope() with get_current_scope()
  • Verified all existing context and tags are preserved
  • Test by running poetry run pytest . in the pipelines directory

User Impact

  • Removes deprecation warnings from build logs
  • No functional changes - all existing Sentry functionality remains the same
  • Prepares code for future Sentry SDK versions

Can this PR be safely reverted and rolled back?

  • YES 💚
  • NO ❌

@saimadib saimadib requested a review from a team as a code owner February 8, 2025 16:15
Copy link

vercel bot commented Feb 8, 2025

@saimadib is attempting to deploy a commit to the Airbyte Growth Team on Vercel.

A member of the Team first needs to authorize it.

@CLAassistant
Copy link

CLAassistant commented Feb 8, 2025

CLA assistant check
All committers have signed the CLA.

@saimadib saimadib temporarily deployed to community-ci-auto February 8, 2025 16:16 — with GitHub Actions Inactive
@saimadib saimadib changed the title FIX #52676 update sentry scope configuration to remove deprecation wa… 🐛 FIX #52676 update sentry scope configuration to remove deprecation wa… Feb 8, 2025
Copy link

@Charlesnorris509 Charlesnorris509 left a comment

Choose a reason for hiding this comment

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

Hey @saimadib I think you did great to resolve this issue but I would Add a docstring to explain the purpose of the with_command_context decorator to enhance readibility. Using a decorator to set Sentry context for pipeline commands is a good way to encapsulate this logic.

@saimadib
Copy link
Author

saimadib commented Feb 9, 2025

Hi @Charlesnorris509 , thanks for the feedback! I've updated the PR to include a docstring for the with_command_context and with_step_context decorator, which should enhance readability. Let me know your feedback!.

Copy link

@Charlesnorris509 Charlesnorris509 left a comment

Choose a reason for hiding this comment

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

The updated code looks great! The detailed docstrings make it much clearer and more structured, and the integration of Sentry for error tracking and context management is well done. The docstrings really help with readability and maintainability. Additionally I test the integration locally and it seems like you passed the 'ruff-format' test. I'll Approve the change. But i would recommend preparing some procedure for Handling missing attributes and writing unit tests would further improve the robustness and reliability of the code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

update sentry client in airbyte-ci/connectors/pipelines
4 participants