Skip to content

Commit c4c6020

Browse files
authored
Bring README and CONTRIBUTING in line with SDKs (#620)
Closes #498.
1 parent 6c5703a commit c4c6020

File tree

2 files changed

+133
-52
lines changed

2 files changed

+133
-52
lines changed

CONTRIBUTING.md

Lines changed: 83 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,108 @@
1-
## Contributing
1+
# Contributing to the Sentry SDK for Elixir
22

3-
Contributions to Sentry Elixir are encouraged and welcome from everyone.
3+
We welcome contributions to `sentry-elixir` 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.
44

5-
Before submitting code, please run the test suite, format code according to Elixir's
6-
code formatter and [Credo](https://github.com/rrrene/credo). This can be done with
7-
`mix test`, `mix format` and `mix credo`.
5+
## How to Report a Problem
86

9-
The build server will also run [dialyzer](http://erlang.org/doc/man/dialyzer.html)
10-
using [dialyxir](https://github.com/jeremyjh/dialyxir) to check the typespecs, but this can be onerous
11-
to install and run. It is okay to submit changes without running it, but can
12-
be run with `mix dialyzer` if you would like to run them yourself.
7+
Please search the [issue tracker][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!
138

14-
Once all checks are passing, you are ready to [open a pull request](https://help.github.com/articles/using-pull-requests/).
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.
1510

16-
### Reviewing changes
11+
## Submitting Changes
1712

18-
Once a pull request is sent, the changes will be reviewed.
13+
* Set up the development environment.
14+
* Clone `sentry-elixir` and prepare necessary changes.
15+
* Add tests for your changes to `test/`.
16+
* Run tests and make sure all of them pass.
17+
* Submit a pull request, referencing any issues it addresses.
1918

20-
If any changes are necessary, maintainers will leave comments requesting changes
21-
to the code. This does not guarantee a pull request will be accepted, as it will
22-
be reviewed following each change.
19+
We will review your pull request as soon as possible. Thank you for contributing!
2320

24-
Once the code is approved, your changes will be merged!
21+
## Development Environment
2522

26-
### Releasing a new version
23+
### Clone the Repo
2724

28-
(only relevant for Sentry employees)
25+
```bash
26+
git clone [email protected]:getsentry/sentry-elixir.git
27+
```
28+
29+
### Install Elixir and Fetch Dependencies
30+
31+
Make sure that you have Elixir 1.15.x installed. Follow the official [Elixir installation guide](https://elixir-lang.org/install.html).
32+
33+
Then, run this in your shell from the root of the cloned repository:
34+
35+
```bash
36+
mix deps.get
37+
```
38+
39+
You're ready to make changes.
40+
41+
## Running Tests
42+
43+
Before submitting code, please run the test suite and format code according to Elixir's code formatter. This can be done with:
44+
45+
```bash
46+
mix test
47+
mix format
48+
```
49+
50+
CI will also run [dialyzer](http://erlang.org/doc/man/dialyzer.html) using the [Dialyxir library](https://github.com/jeremyjh/dialyxir) to check the typespecs, but this can be onerous to install and run. It is okay to submit changes without running it. If you want to run it locally, run:
51+
52+
```bash
53+
mix dialyzer
54+
```
55+
56+
Once all checks are passing locally, you are ready to [open a pull request](https://help.github.com/articles/using-pull-requests/).
57+
58+
That's it. You should be ready to make changes, run tests, and make commits! If you experience any problems, please don't hesitate to ping us in our [Discord Community](https://discord.com/invite/Ww9hbqr).
59+
60+
## Releasing a New Version
61+
62+
*(Only relevant for Sentry employees)*.
2963

3064
Prerequisites:
3165

32-
- All changes that should be released must be in the `master` branch.
66+
* All changes that should be released must be in the `master` branch.
3367

3468
Manual Process:
3569

36-
- On GitHub in the `sentry-elixir` repository go to "Actions" select the "Release" workflow.
37-
- Click on "Run workflow" on the right side and make sure the `master` branch is selected.
38-
- Set "Version to release" input field. Here you decide if it is a major, minor or patch release.
39-
- Click "Run Workflow"
70+
* [On GitHub][repo], go to "Actions" and select the "Release" workflow.
71+
* Click on "Run workflow" on the right side and make sure the `master` branch is selected.
72+
* Set "Version to release" input field. Here you decide if it is a major, minor or patch release.
73+
* Click "Run Workflow".
4074

41-
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)
75+
This will trigger [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` repository][publish-repo]. (Example release issue: <https://github.com/getsentry/publish/issues/815>)
4276

4377
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.
4478

4579
There are always two persons involved in a release.
4680

4781
If you are in a hurry and the release should be out immediately 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 immediately.
4882

49-
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!
83+
When the release issue is labeled `accepted` [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!
84+
85+
There is a sequence diagram visualizing all this in the [README.md][publish-repo] of the `Publish` repository.
86+
87+
### Versioning Policy
88+
89+
This project follows the [SemVer specification](https://semver.org/), with three additions:
90+
91+
* 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 (bug fixes and features). This project also follows that practice.
92+
93+
* All undocumented APIs are to be considered internal. They are not part of this contract.
94+
95+
* Certain features (such as integrations) may be explicitly called out as "experimental" or "unstable" in the documentation. They come with their own versioning policy described in the documentation.
96+
97+
A major release `N` implies the previous release `N-1` will no longer receive updates. We generally do not backport bug fixes to older versions unless they are security relevant. However, feel free to ask for backports of specific commits on the issue tracker.
98+
99+
## Commit Message Guidelines
100+
101+
See the documentation on commit messages here:
102+
103+
<https://develop.sentry.dev/commit-messages/#commit-message-format>
50104

51-
There is a sequence diagram visualizing all this in the [README.md](https://github.com/getsentry/publish) of the `Publish` repository.
105+
[repo]: https://github.com/getsentry/sentry-elixir
106+
[issues]: https://github.com/getsentry/sentry-elixir/issues
107+
[Craft]: https://github.com/getsentry/craft
108+
[publish-repo]: https://github.com/getsentry/publish

README.md

Lines changed: 50 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
1-
# Sentry
1+
<p align="center">
2+
<a href="https://sentry.io/?utm_source=github&utm_medium=logo" target="_blank">
3+
<img src="https://sentry-brand.storage.googleapis.com/sentry-wordmark-dark-280x84.png" alt="Sentry" width="280" height="84">
4+
</a>
5+
</p>
6+
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/)_
28

39
![Build Status](https://github.com/getsentry/sentry-elixir/actions/workflows/main.yml/badge.svg)
410
[![Hex Package](https://img.shields.io/hexpm/v/sentry.svg)](https://hex.pm/packages/sentry)
511
[![Hex Docs](https://img.shields.io/badge/hex-docs-blue.svg)](https://hexdocs.pm/sentry)
612

7-
The official Sentry client for Elixir which provides a simple API to capture exceptions, automatically handle Plug exceptions, and provides a backend for the Elixir Logger.
13+
This is the official Sentry SDK for [Sentry].
14+
15+
*💁: This README documents unreleased features (from the `master` branch). For documentation on the current release, see [the official documentation][docs].*
816

9-
💁: This README documents unreleased features (from the `master` branch). For documentation on the current release, see [the official documentation][docs].
17+
## Getting Started
1018

11-
## Installation
19+
### Install
1220

1321
To use Sentry in your project, add it as a dependency in your `mix.exs` file. Sentry does not install a JSON library nor HTTP client by itself. Sentry will default to trying to use [Jason] for JSON serialization and [Hackney] for HTTP requests, but can be configured to use other ones. To use the default ones, do:
1422

@@ -17,18 +25,28 @@ defp deps do
1725
[
1826
# ...
1927

20-
{:sentry, "8.0.0"},
28+
{:sentry, "~> 9.0"},
2129
{:jason, "~> 1.4"},
2230
{:hackney, "~> 1.19"}
2331
]
2432
end
2533
```
2634

27-
## Usage
35+
### Configuration
2836

29-
This is a short overview of how to use the library. For complete documentation, refer to [HexDocs][docs].
37+
Sentry has a range of configuration options, but most applications will have a configuration that looks like the following:
3038

31-
### Capture Crashed Process Exceptions
39+
```elixir
40+
# config/config.exs
41+
config :sentry,
42+
dsn: "https://[email protected]/1",
43+
environment_name: Mix.env(),
44+
included_environments: [:prod],
45+
enable_source_code_context: true,
46+
root_source_code_paths: [File.cwd!()]
47+
```
48+
49+
### Usage
3250

3351
This library comes with a [`:logger` handler][logger-handlers] to capture error messages coming from process crashes. To enable this, add the handler when your application starts:
3452

@@ -42,8 +60,6 @@ This library comes with a [`:logger` handler][logger-handlers] to capture error
4260

4361
The handler can also be configured to capture `Logger` metadata. See the documentation [here](https://hexdocs.pm/sentry/Sentry.LoggerBackend.html).
4462

45-
### Capture Arbitrary Exceptions
46-
4763
Sometimes you want to capture specific exceptions manually. To do so, use [`Sentry.capture_exception/2`](https://hexdocs.pm/sentry/Sentry.html#capture_exception/2).
4864

4965
```elixir
@@ -55,29 +71,37 @@ rescue
5571
end
5672
```
5773

58-
### Capture Non-Exception Events
59-
6074
Sometimes you want to capture **messages** that are not exceptions. To do that, use [`Sentry.capture_message/2`](https://hexdocs.pm/sentry/Sentry.html#capture_exception/2):
6175

6276
```elixir
6377
Sentry.capture_message("custom_event_name", extra: %{extra: information})
6478
```
6579

66-
For optional settings check the [documentation][docs].
80+
To learn more about how to use this SDK, refer to [the documentation][docs].
6781

68-
## Configuration
82+
## Integrations
6983

70-
Sentry has a range of configuration options, but most applications will have a configuration that looks like the following:
84+
* [Phoenix and Plug][setup-phoenix-and-plug]
7185

72-
```elixir
73-
# config/config.exs
74-
config :sentry,
75-
dsn: "https://[email protected]/1",
76-
environment_name: Mix.env(),
77-
included_environments: [:prod],
78-
enable_source_code_context: true,
79-
root_source_code_paths: [File.cwd!()]
80-
```
86+
## Contributing to the SDK
87+
88+
Please refer to [`CONTRIBUTING.md``](CONTRIBUTING.md).
89+
90+
## Getting Help/Support
91+
92+
If you need help setting up or configuring the Python 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!
93+
94+
## Resources
95+
96+
* [![Documentation](https://img.shields.io/badge/documentation-hexdocs.svg)][docs]
97+
* [![Forum](https://img.shields.io/badge/forum-sentry-green.svg)](https://forum.sentry.io/c/sdks)
98+
* [![Discord](https://img.shields.io/discord/621778831602221064)](https://discord.gg/Ww9hbqr)
99+
* [![Stack Overflow](https://img.shields.io/badge/stack%20overflow-sentry-green.svg)](http://stackoverflow.com/questions/tagged/sentry)
100+
* [![Twitter Follow](https://img.shields.io/twitter/follow/getsentry?label=getsentry&style=social)](https://twitter.com/intent/follow?screen_name=getsentry)
101+
102+
## License
103+
104+
Licensed under the MIT license, see [`LICENSE`](./LICENSE).
81105

82106
### Context and Breadcrumbs
83107

@@ -192,11 +216,11 @@ end
192216

193217
When testing, you will also want to set the `send_result` type to `:sync`, so the request is done synchronously.
194218

195-
## License
196219

197-
This project is Licensed under the [MIT License](https://github.com/getsentry/sentry-elixir/blob/master/LICENSE).
198220

221+
[Sentry]: http://sentry.io/
199222
[Jason]: https://github.com/michalmuskala/jason
200223
[Hackney]: https://github.com/benoitc/hackney
201224
[docs]: https://hexdocs.pm/sentry/readme.html
202225
[logger-handlers]: https://www.erlang.org/doc/apps/kernel/logger_chapter#handlers
226+
[setup-phoenix-and-plug]: https://hexdocs.pm/sentry/setup-with-plug-and-phoenix.html

0 commit comments

Comments
 (0)