Skip to content

Improve output and DX for sentry:test and sentry:publish commands #522

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

Merged
merged 2 commits into from
Nov 11, 2021

Conversation

stayallive
Copy link
Collaborator

@stayallive stayallive commented Nov 10, 2021

Things fixed / improved for sentry:publish:

  • Ignore commented out env variables and set new ones instead of updating a commented out variable
  • Set SENTRY_TRACES_SAMPLE_RATE to 0 if transaction should be disabled and SENTRY_TRACES_SAMPLE_RATE is present in the .env
  • Handle missing DSN when command is run non-interactively
  • When DSN is provided with the env key in front of it, strap it away no matter the env key (just use whatever comes after the first =)
  • Fix checking if .env key is set (never worked)
  • Only make changes to the .env after sentry:test is a success (or no test is performed)
  • Return a unix exit code depending on if the command succeeded or failed

Things fixed / improved for sentry:test:

  • Use a client specific for the test command so we can be a little more in control
  • Log internal SDK errors and show them as errors when sending fails
  • Try and detect Let's Encrypt root related errors and show helpful hints
  • If sending a event fails, don't try to send a transaction
  • Only show generic "DSN is broken" message if the SDK emitted no errors
  • Return a unix exit code depending on if the command succeeded or failed

And a bunch more I am probably forgetting. The inner workings have changed but the result has not and also the way they are interacted with have not changed so this should be a very transparent change and just be a glow up for some edge cases.

This should hopefully cut down on boilerplate support messages when setting up the Laravel SDK.

Fixes #521

@stayallive stayallive force-pushed the improve-command-output branch from 1dd9b7c to e57595f Compare November 10, 2021 15:13
@stayallive stayallive changed the title Improve output and DX for sentry:test and sentry:publish console commands Improve output and DX for sentry:test and sentry:publish commands Nov 10, 2021
@stayallive stayallive merged commit d43b279 into master Nov 11, 2021
@stayallive stayallive deleted the improve-command-output branch November 11, 2021 10:11
@sforward
Copy link

The added commands will not work with Laravel 6 because of the usage of self::SUCCESS and self::FAILURE.

@stayallive
Copy link
Collaborator Author

@sforward good catch, I failed to check that, I'll replace them 👍

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.

Add a specific error message for SSL errors in the test command
2 participants