Skip to content

Commit dcb034d

Browse files
Merge pull request #36 from stephenyeargin/readme-updates-contributing
Add CONTRIBUTING.md, update README on config vars
2 parents 0e60572 + 69f673d commit dcb034d

2 files changed

Lines changed: 52 additions & 11 deletions

File tree

CONTRIBUTING.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Contributing to hubot-grafana
2+
3+
We are proud to have [several contributors](https://github.com/stephenyeargin/hubot-grafana/graphs/contributors) to this Hubot Script Package and want you to be one! Here are some general suggestions to help make sure your PR is merged quickly.
4+
5+
This follows the standard [GitHub Flow](https://guides.github.com/introduction/flow/), with some notes about working with NPM modules.
6+
7+
1. [Open a GitHub Issue](https://github.com/stephenyeargin/hubot-grafana/issues/new) before starting. This is a great way to get feedback from other users on your idea and helps clarify what the upcoming PR will accomplish.
8+
2. [Fork the repository](https://github.com/stephenyeargin/hubot-grafana/fork) to your account or organization.
9+
3. Clone the repository locally and run `npm install` to download the necessary dependancies.
10+
4. Run the test suite with `npm test` in your cloned repository. This is to make sure you've got everything you need to get started.
11+
5. Use `npm link` in the cloned repository and then run `nmp link hubot-grafana` in your Hubot checkout to connect your cloned version to your local Hubot install. Now you can test changes with your own data!
12+
6. Commit and push changes back to your forked repository.
13+
7. [Open a Pull Request](https://github.com/stephenyeargin/hubot-grafana/compare) with your repository against the parent one to submit your changes.
14+
8. See if the the CI tests that run automatically upon opening a Pull Request pass. If not, double check your work locally with `npm test` again to resolve any issues.
15+
16+
Note: You won't need to do a version bump in the `package.json` file as we have a [Grunt](http://gruntjs.com) task for handling that.
17+
18+
## Tips
19+
20+
- Test coverage makes the world go round. If you add a feature or fix a bug, be sure to adjust the tests to account for it when practical.
21+
- Configuration options are preferable to changing something globally. Many folks may depend on the current behavior (e.g. the default time window) and want to leave the default in place.
22+
- This package is designed to work with all Hubot adapters, so we are not wanting to limit it to only folks who use Slack, HipChat, etc. See [`robot.adapterName`](https://github.com/github/hubot/pull/663) if you want to create an adapter-specific feature.
23+
- If you find yourself copying large blocks of code, consider refactoring it to be a bit more [DRY](https://en.wikipedia.org/wiki/Don't_repeat_yourself).
24+
- `robot.logger.debug` and `robot.logger.error` are helpful methods. You can set your `HUBOT_LOG_LEVEL` locally to see the output of these methods as your code is run.
25+
- If you have something super custom (say, wanting to prefix every command with "hey Siri ..."), it is totally fine to fork this repository and _not_ submit back a Pull Request. You can include your forked version in Hubot by specifying the repository URL in the version field in `package.json`.
26+
27+
## Thank You!
28+
29+
You are super awesome for taking the time to contribute to Open Source Software like this project. :heart:

README.md

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,30 @@ Then add **hubot-grafana** to your `external-scripts.json`:
2424

2525
## Configuration Variables
2626

27-
- `HUBOT_GRAFANA_HOST` - Host for your Grafana 2.x install, e.g. 'http://play.grafana.org'
28-
- `HUBOT_GRAFANA_API_KEY` - API key for a particular user
29-
- `HUBOT_GRAFANA_QUERY_TIME_RANGE` - Optional; Default time range for queries (defaults to 6h)
30-
- `HUBOT_GRAFANA_S3_ENDPOINT` - Optional; Endpoint of the S3 API (useful for S3 compatible API, defaults to s3.amazonaws.com)
31-
- `HUBOT_GRAFANA_S3_BUCKET` - Optional; Name of the S3 bucket to copy the graph into
32-
- `HUBOT_GRAFANA_S3_ACCESS_KEY_ID` - Optional; Access key ID for S3
33-
- `HUBOT_GRAFANA_S3_SECRET_ACCESS_KEY` - Optional; Secret access key for S3
34-
- `HUBOT_GRAFANA_S3_PREFIX` - Optional; Bucket prefix (useful for shared buckets)
35-
- `HUBOT_GRAFANA_S3_REGION` - Optional; Bucket region (defaults to us-standard)
27+
### General Settings
3628

37-
Example:
29+
| Configuration Variable | Required | Description |
30+
| -------------------------------- | -------- | ------------------------------ |
31+
| `HUBOT_GRAFANA_HOST` | **Yes** | Host for your Grafana 2.x install, e.g. `http://play.grafana.org` |
32+
| `HUBOT_GRAFANA_API_KEY` | _Yes^_ | API key for a particular user |
33+
| `HUBOT_GRAFANA_QUERY_TIME_RANGE` | No | Default time range for queries (defaults to 6h) |
34+
35+
^ _Not required for `auth.anonymous` Grafana configurations. All other authentication models will require a user-specific API key._
36+
37+
### Amazon S3 Image Hosting
38+
39+
Recommended if you use a service such as Slack or HipChat. You can omit all of these settings if you do not plan to use S3.
40+
41+
| Configuration Variable | Required | Description |
42+
| ------------------------------------ | -------- | -------------------------- |
43+
| `HUBOT_GRAFANA_S3_BUCKET` | **Yes** | Name of the S3 bucket to copy the graph into |
44+
| `HUBOT_GRAFANA_S3_ACCESS_KEY_ID` | **Yes** | Access key ID for S3 |
45+
| `HUBOT_GRAFANA_S3_SECRET_ACCESS_KEY` | **Yes** | Secret access key for S3 |
46+
| `HUBOT_GRAFANA_S3_PREFIX` | No | Bucket prefix (useful for shared buckets) |
47+
| `HUBOT_GRAFANA_S3_REGION` | No | Bucket region (defaults to us-standard) |
48+
| `HUBOT_GRAFANA_S3_ENDPOINT` | No | Endpoint of the S3 API (useful for S3 compatible API, defaults to s3.amazonaws.com) |
49+
50+
### Example Configuration
3851

3952
```
4053
export HUBOT_GRAFANA_HOST=http://play.grafana.org
@@ -44,7 +57,6 @@ export HUBOT_GRAFANA_S3_BUCKET=mybucket
4457
export HUBOT_GRAFANA_S3_ACCESS_KEY_ID=ABCDEF123456XYZ
4558
export HUBOT_GRAFANA_S3_SECRET_ACCESS_KEY=aBcD01234dEaDbEef01234
4659
export HUBOT_GRAFANA_S3_PREFIX=graphs
47-
export HUBOT_GRAFANA_S3_REGION=us-standard
4860
```
4961

5062
## Sample Interaction

0 commit comments

Comments
 (0)