Skip to content

Commit 9344dda

Browse files
authored
Improve README.md and CONTRIBUTING.md (#548)
1 parent d96f79c commit 9344dda

File tree

2 files changed

+182
-26
lines changed

2 files changed

+182
-26
lines changed

CONTRIBUTING.md

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
# Contributing to Sentry SDK for Laravel
2+
3+
We welcome contributions to sentry-laravel by the community. See the [Contributing to Docs](https://docs.sentry.io/contributing/) page if you want to fix or update the documentation on the website.
4+
5+
## How to report a problem
6+
7+
Please search the [issue tracker](https://github.com/getsentry/sentry-laravel/issues) before creating a new issue (a problem or an improvement request). Please also ask in our [Sentry Community on Discord](https://discord.com/invite/Ww9hbqr) before submitting a new issue. There is a ton of great people in our Discord community ready to help you!
8+
9+
If you feel that you can fix or implement it yourself, please read a few paragraphs below to learn how to submit your changes.
10+
11+
## Submitting changes
12+
13+
- Setup the development environment.
14+
- Clone sentry-laravel and prepare necessary changes.
15+
- Add tests for your changes to `tests/`.
16+
- Run tests and make sure all of them pass.
17+
- Submit a pull request, referencing any issues it addresses.
18+
19+
We will review your pull request as soon as possible.
20+
Thank you for contributing!
21+
22+
## Development environment
23+
24+
### Clone the repo:
25+
26+
```bash
27+
git clone [email protected]:getsentry/sentry-laravel.git
28+
```
29+
30+
Make sure that you have PHP 7.2+ installed. Version 7.4 or higher is required to run style checkers. On macOS, we recommend using brew to install PHP. For Windows, we recommend an official PHP.net release.
31+
32+
### Install the dependencies:
33+
34+
Dependencies are managed through [Composer](https://getcomposer.org/):
35+
36+
```bash
37+
composer install
38+
```
39+
40+
### Running tests
41+
42+
Tests can then be run via [PHPUnit](https://phpunit.de/):
43+
44+
```bash
45+
composer test
46+
```
47+
48+
## Releasing a new version
49+
50+
(only relevant for Sentry employees)
51+
52+
Prerequisites:
53+
54+
- All the changes that should be release must be in `master` branch.
55+
- Every commit should follow the [Commit Message Format](https://develop.sentry.dev/commit-messages/#commit-message-format) convention.
56+
57+
Manual Process:
58+
59+
- Update CHANGELOG.md witht the version to be released. Example commit: https://github.com/getsentry/sentry-laravel/commit/a167e95c3c97cc5f9f315e96ef07a800aec3b440.
60+
- On GitHub in the `sentry-laravel` repository go to "Actions" select the "Release" workflow.
61+
- Click on "Run workflow" on the right side, make sure the `master` branch is selected.
62+
- Set "Version to release" input field. Here you decide if it is a major, minor or patch release. (See "Versioning Policy" below)
63+
- Click "Run Workflow"
64+
65+
This will trigger [Craft](https://github.com/getsentry/craft) to prepare everything needed for a release. (For more information see [craft prepare](https://github.com/getsentry/craft#craft-prepare-preparing-a-new-release)) At the end of this process a release issue is created in the [Publish](https://github.com/getsentry/publish) repository. (Example release issue: https://github.com/getsentry/publish/issues/815)
66+
67+
Now one of the persons with release privileges (most probably your engineering manager) will review this Issue and then add the `accepted` label to the issue.
68+
69+
There are always two persons involved in a release.
70+
71+
If you are in a hurry and the release should be out immediatly there is a Slack channel called `#proj-release-approval` where you can see your release issue and where you can ping people to please have a look immediatly.
72+
73+
When the release issue is labeled `accepted` [Craft](https://github.com/getsentry/craft) is triggered again to publish the release to all the right platforms. (See [craft publish](https://github.com/getsentry/craft#craft-publish-publishing-the-release) for more information). At the end of this process the release issue on GitHub will be closed and the release is completed! Congratulations!
74+
75+
There is a sequence diagram visualizing all this in the [README.md](https://github.com/getsentry/publish) of the `Publish` repository.
76+
77+
### Versioning Policy
78+
79+
This project follows [semver](https://semver.org/), with three additions:
80+
81+
- Semver says that major version `0` can include breaking changes at any time. Still, it is common practice to assume that only `0.x` releases (minor versions) can contain breaking changes while `0.x.y` releases (patch versions) are used for backwards-compatible changes (bugfixes and features). This project also follows that practice.
82+
83+
- All undocumented APIs are considered internal. They are not part of this contract.
84+
85+
- Certain features (e.g. integrations) may be explicitly called out as "experimental" or "unstable" in the documentation. They come with their own versioning policy described in the documentation.
86+
87+
We recommend to pin your version requirements against `1.x.*` or `1.x.y`.
88+
Either one of the following is fine:
89+
90+
```json
91+
"sentry/sentry": "^1.0",
92+
"sentry/sentry": "^1",
93+
```
94+
95+
A major release `N` implies the previous release `N-1` will no longer receive updates. We generally do not backport bugfixes to older versions unless they are security relevant. However, feel free to ask for backports of specific commits on the bugtracker.
96+
97+
## Commit message format guidelines
98+
99+
See the documentation on commit messages here:
100+
101+
https://develop.sentry.dev/commit-messages/#commit-message-format

README.md

Lines changed: 81 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,51 +4,106 @@
44
</a>
55
</p>
66

7-
# Sentry for Laravel
7+
_Bad software is everywhere, and we're tired of it. Sentry is on a mission to help developers write better software faster, so we can get back to enjoying technology. If you want to join us [<kbd>**Check out our open positions**</kbd>](https://sentry.io/careers/)_
88

9-
[![Build Status](https://secure.travis-ci.org/getsentry/sentry-laravel.png?branch=master)](http://travis-ci.org/getsentry/sentry-laravel)
10-
[![Total Downloads](https://img.shields.io/packagist/dt/sentry/sentry-laravel.svg?style=flat-square)](https://packagist.org/packages/sentry/sentry-laravel)
11-
[![Downloads per month](https://img.shields.io/packagist/dm/sentry/sentry-laravel.svg?style=flat-square)](https://packagist.org/packages/sentry/sentry-laravel)
12-
[![Latest stable version](https://img.shields.io/packagist/v/sentry/sentry-laravel.svg?style=flat-square)](https://packagist.org/packages/sentry/sentry-laravel)
13-
[![License](http://img.shields.io/packagist/l/sentry/sentry-laravel.svg?style=flat-square)](https://packagist.org/packages/sentry/sentry-laravel)
9+
# Official Sentry SDK for Laravel
1410

15-
Laravel integration for [Sentry](https://sentry.io/).
11+
[![Build Status](https://img.shields.io/github/checks-status/getsentry/sentry-laravel/master)](https://github.com/getsentry/sentry-laravel/actions)
12+
[![Composer page link -- version](https://img.shields.io/packagist/v/getsentry/sentry-lararvel.svg)](https://packagist.org/packages/sentry/sentry-laravel)
13+
[![Discord](https://img.shields.io/discord/621778831602221064)](https://discord.gg/cWnMQeA)
1614

17-
## Laravel Version Compatibility
15+
This is the official Laravel SDK for [Sentry](https://sentry.io/)
1816

19-
- Laravel `<= 4.2.x` is supported until `0.8.x`
20-
- Laravel `<= 5.7.x` on PHP `<= 7.0` is supported until `0.11.x`
21-
- Laravel `>= 5.x.x` on PHP `>= 7.1` is supported in all versions
22-
- Laravel `>= 6.x.x` on PHP `>= 7.2` is supported starting from `1.2.0`
23-
- Laravel `>= 7.x.x` on PHP `>= 7.2` is supported starting from `1.7.0`
24-
- Laravel `>= 8.x.x` on PHP `>= 7.3` is supported starting from `1.9.0`
25-
- Laravel `>= 9.x.x` on PHP `>= 8.0` is supported starting from `2.11.0`
17+
---
18+
19+
## Getting Started
2620

27-
Please note that of version `>= 2.0.0` we require PHP Version `>= 7.2` because we are using our new [PHP SDK](https://github.com/getsentry/sentry-php) underneath.
21+
The installation step below work on the latest versions of the Laravel framework (8.x and 9.x).
2822

29-
## Installation
23+
For other Laravel or Lumen versions see:
3024

3125
- [Laravel 8.x & 9.x](https://docs.sentry.io/platforms/php/guides/laravel/)
3226
- [Laravel 5.x, 6.x & 7.x](https://docs.sentry.io/platforms/php/guides/laravel/other-versions/laravel5-6-7/)
3327
- [Laravel 4.x](https://docs.sentry.io/platforms/php/guides/laravel/other-versions/laravel4/)
3428
- [Lumen](https://docs.sentry.io/platforms/php/guides/laravel/other-versions/lumen/)
3529

36-
## Contributing
30+
### Install
3731

38-
Dependencies are managed through [Composer](https://getcomposer.org/):
32+
Install the `sentry/sentry-laravel` package:
3933

34+
```bash
35+
composer require sentry/sentry-laravel
4036
```
41-
$ composer install
37+
38+
Enable capturing unhandled exception to report to Sentry by making the following change to your `App/Exceptions/Handler.php`:
39+
40+
```php {filename:App/Exceptions/Handler.php}
41+
public function register()
42+
{
43+
$this->reportable(function (Throwable $e) {
44+
if (app()->bound('sentry')) {
45+
app('sentry')->captureException($e);
46+
}
47+
});
48+
}
4249
```
4350

44-
Tests can then be run via [PHPUnit](https://phpunit.de/):
51+
> Alternatively, you can configure Sentry in your [Laravel Log Channel](https://docs.sentry.io/platforms/php/guides/laravel/usage/#log-channels), allowing you to log `info` and `debug` as well.
52+
53+
### Configure
4554

55+
Configure the Sentry DSN with this command:
56+
57+
```shell
58+
php artisan sentry:publish --dsn=___PUBLIC_DSN___
4659
```
47-
$ vendor/bin/phpunit
60+
61+
It creates the config file (`config/sentry.php`) and adds the `DSN` to your `.env` file.
62+
63+
```shell {filename:.env}
64+
SENTRY_LARAVEL_DSN=___PUBLIC_DSN___
65+
```
66+
67+
### Usage
68+
69+
```php
70+
try {
71+
$this->functionFailsForSure();
72+
} catch (\Throwable $exception) {
73+
\Sentry\captureException($exception);
74+
}
4875
```
4976

50-
## Links
77+
- To learn more about how to use the SDK [refer to our docs](https://docs.sentry.io/platforms/php/guides/laravel/)
78+
79+
## Laravel Version Compatibility
80+
81+
- Laravel `<= 4.2.x` is supported until `0.8.x`
82+
- Laravel `<= 5.7.x` on PHP `<= 7.0` is supported until `0.11.x`
83+
- Laravel `>= 5.x.x` on PHP `>= 7.1` is supported in all versions
84+
- Laravel `>= 6.x.x` on PHP `>= 7.2` is supported starting from `1.2.0`
85+
- Laravel `>= 7.x.x` on PHP `>= 7.2` is supported starting from `1.7.0`
86+
- Laravel `>= 8.x.x` on PHP `>= 7.3` is supported starting from `1.9.0`
87+
- Laravel `>= 9.x.x` on PHP `>= 8.0` is supported starting from `2.11.0`
88+
89+
Please note that of version `>= 2.0.0` we require PHP Version `>= 7.2` because we are using our new [PHP SDK](https://github.com/getsentry/sentry-php) underneath.
90+
91+
## Contributing to the SDK
92+
93+
Please refer to [CONTRIBUTING.md](CONTRIBUTING.md).
94+
95+
## Getting help/support
96+
97+
If you need help setting up or configuring the Laravel SDK (or anything else in the Sentry universe) please head over to the [Sentry Community on Discord](https://discord.com/invite/Ww9hbqr). There is a ton of great people in our Discord community ready to help you!
98+
99+
## Resources
100+
101+
- [![Documentation](https://img.shields.io/badge/documentation-sentry.io-green.svg)](https://docs.sentry.io/quickstart/)
102+
- [![Forum](https://img.shields.io/badge/forum-sentry-green.svg)](https://forum.sentry.io/c/sdks)
103+
- [![Discord](https://img.shields.io/discord/621778831602221064)](https://discord.gg/Ww9hbqr)
104+
- [![Stack Overflow](https://img.shields.io/badge/stack%20overflow-sentry-green.svg)](http://stackoverflow.com/questions/tagged/sentry)
105+
- [![Twitter Follow](https://img.shields.io/twitter/follow/getsentry?label=getsentry&style=social)](https://twitter.com/intent/follow?screen_name=getsentry)
106+
107+
## License
51108

52-
* [Documentation](https://docs.sentry.io/platforms/php/guides/laravel/)
53-
* [Bug Tracker](https://github.com/getsentry/sentry-laravel/issues)
54-
* [Code](https://github.com/getsentry/sentry-laravel)
109+
Licensed under the Apache 2.0 license, see [`LICENSE`](LICENSE)

0 commit comments

Comments
 (0)