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

[Feature] Add a Sentry configuration helper #29

Merged
merged 5 commits into from
Mar 12, 2024
Merged

Conversation

titouanmathis
Copy link
Contributor

This PR adds a Sentry class to easily configure back-end and front-end integration of Sentry for WordPress.

It can be used as follows in your configuration file (wp-config.php or another):

use Studiometa\WPToolkit\Sentry\Sentry;

Sentry::configureWithDefaults( $root_dir );

The $root_dir variable is used to read the version of your project from a package.json file at the root of your project. The version is made of the package name and version properties.

The following environment variables can be used to configure Sentry:

SENTRY_DSN=""
SENTRY_JS_LOADER_SCRIPT=""
SENTRY_ENV=""
SENTRY_SAMPLE_RATE=0.0
SENTRY_TRACES_SAMPLE_RATE=0.0
SENTRY_PROFILES_SAMPLE_RATE=0.0

Copy link

codecov bot commented Mar 12, 2024

Codecov Report

Attention: Patch coverage is 22.80702% with 44 lines in your changes are missing coverage. Please review.

Project coverage is 62.81%. Comparing base (2ebb179) to head (2fba3f6).

❗ Current head 2fba3f6 differs from pull request most recent head 69b9175. Consider uploading reports for the commit 69b9175 to get more accurate results

Files Patch % Lines
src/Sentry/Sentry.php 0.00% 44 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             develop      #29      +/-   ##
=============================================
- Coverage      67.40%   62.81%   -4.59%     
- Complexity       182      194      +12     
=============================================
  Files             12       14       +2     
  Lines            497      554      +57     
=============================================
+ Hits             335      348      +13     
- Misses           162      206      +44     
Flag Coverage Δ
unittests 62.81% <22.80%> (-4.59%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@titouanmathis titouanmathis merged commit e430062 into develop Mar 12, 2024
9 checks passed
@titouanmathis titouanmathis deleted the feature/sentry branch March 12, 2024 17:20
@titouanmathis titouanmathis mentioned this pull request Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant