Skip to content

Commit

Permalink
Merge 7bc291c into e411f20
Browse files Browse the repository at this point in the history
  • Loading branch information
litleleprikon committed Jan 30, 2020
2 parents e411f20 + 7bc291c commit a35430a
Show file tree
Hide file tree
Showing 7 changed files with 261 additions and 33 deletions.
File renamed without changes.
8 changes: 8 additions & 0 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Community Code of Conduct

This document provides community guidelines for a safe, respectful, productive, and collaborative place for any person who is willing to contribute to the Moira community. It applies to all “collaborative space”, which is defined as community communications channels (such as mailing lists, submitted patches, commit comments, etc.).

* Participants will be tolerant of opposing views.
* Participants must ensure that their language and actions are free of personal attacks and disparaging personal remarks.
* When interpreting the words and actions of others, participants should always assume good intentions.
* Behaviour which can be reasonably considered harassment will not be tolerated.
158 changes: 158 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
# Contributing to Moira

First off, thanks for taking the time to contribute!

The following is a set of guidelines for contributing to Moira and its packages, which are hosted in the
[Moira](https://github.com/moira-alert) Organization on GitHub. These are mostly guidelines, not rules. Use your best
judgment, and feel free to propose changes to this document in a pull request.

**Table of Content**

- [Contributing to Moira](#contributing-to-moira)
- [How Can I Contribute](#how-can-i-contribute)
- [Submitting an Issue](#submitting-an-issue)
- [Contributing a Code](#contributing-a-code)
- [Contributing to documentation](#contributing-to-documentation)
- [Style Guides](#style-guides)
- [Git Style Guide](#git-style-guide)
- [Go Code Style Guide](#go-code-style-guide)
- [Testing Strategy](#testing-strategy)
- [Development](#development)

## How Can I Contribute

### Submitting an Issue

If you find bugs or you want propose an idea that you think will be suitable for Moira you can create an issue. The main
issue tracker is https://github.com/moira-alert/moira/issues. Issues that belongs for moira backend and web are placed here.
Issues that are related to python client and ansible role should be placed in issue tracker for related repo.

We have templates for two types of issues: a Feature Request and a Bug. If you want to submit a bug please be patient
and fill all required fields. This will help us to define the problem.

Try to follow this advice to fill a great issue:

- Check that issue tracker does not contain issues similar to your.
- Use a clear and descriptive title for the issue to identify the suggestion.
- Provide a step-by-step description of the suggested enhancement in as many details as possible.
- Provide specific examples to demonstrate the steps. Include copy/pasteable snippets which you use in those examples, as Markdown code blocks.
- Describe the current behavior and explain which behavior you expected to see instead and why.
- Include screenshots and animated GIFs which help you demonstrate the steps to reproduce issue.
- Explain why this enhancement would be useful to most Moira users.
- Specify which version of Moira you're using.

### Contributing a Code

If you want to contribute a code you should choose an issue and comment that you want to work on it. If you cannot find
an issue for your contribution please fill an issue first. Please **DO NOT** work on code before you file an issue and comment
about your wish to work on it.

Here you can find issues that are good for first time contributors.

- [Good First Issue](https://github.com/moira-alert/moira/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22)
- [Help Wanted](https://github.com/moira-alert/moira/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22)

During implementation and submission of code follow style guides listed below.

### Contributing to documentation

The main source of knowledge about Moira is a documentation that is hosted on Read the Docs service. You can help improve the Moira guides or the API reference by making them more coherent, consistent, or readable, adding missing information, correcting factual errors, fixing typos, or bringing them up to date with the latest Moira release. Check [moira-alert/doc](github.com/moira-alert/doc) for sources of documentation.

One of our goals is to provide beautiful and clear documentation of Moira API. If you familiar with Go and OpenAPI specification you can add description of missing API methods to swagger file located in `api` folder of [moira-alert/doc](github.com/moira-alert/doc) repository.

## Style Guides

### Git Style Guide

We are using [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) philosophy to submit the code.
If you are not familiar with Conventional Commits it's highly recommended to read
[documentation](https://www.conventionalcommits.org/en/v1.0.0/) about it.

In general the rules for commiting are following:

- Commit message should have three blocks: title, body and footer divided with empty lines.
- At least title should be specified.
- Start first line with type of commit. You can find commit types below.
- Place summary in the first line.
- If applicable specify the scope of commit.
- In body describe the changes you did. Write mostly **why** you did changes instead **what** you changed.
- You can split a body to multiple paragraphs using blank lines.
- In footer place an additional information about your commit. Specify issue number in footer with `Relates` or `Closes` label.

Structure of commit:

```blank
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
```

We are using following commit types in our repo:

- **build:** Changes that affect the build system or external dependencies
- **ci:** Changes to our CI configuration files and scripts
- **docs:** Documentation only changes
- **feat:** A new feature
- **fix:** A bug fix
- **perf:** A code change that improves performance
- **refactor:** A code change that neither fixes a bug nor adds a feature
- **style:** Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
- **test:** Adding missing tests or correcting existing tests

Good commit message example:

```blank
fix(notifier): Handle nil pointer dereference
At notifier/plotting.go inside fetchAvailableSeries in case of error
returned from `metricsSource.Fetch` only
`local.ErrEvaluateTargetFailedWithPanic` was checked. Another errors did
not handled properly and function was trying to call methods of fetch
result which became nil. That caused Nil Pointer Dereference panic. Add
proper error handling to prevent nil pointer dereference.
Closes #437
```

### Go Code Style Guide

We are using [GolangCI-Lint](https://github.com/golangci/golangci-lint) to check our code for following the code style.
Check your code with `make lint` before you will submit it. Code with broken style will not pass the CI and will not be
reviewed.

### Testing Strategy

We are using unit and integration tests to check that Moira behaviour satisfies our expectations and we expect that
contributors will cover with tests changed code as much as possible.
Use [tests skipping](https://golang.org/pkg/testing/#hdr-Skipping) in short mode for tests that uses database.
If you fix a bug first cover a bug with test that reproduce this bug then fix it.

## Development

To build and run tests you need local redis listening on port 6379.
Easiest way to get redis is via docker:

```bash
docker run -p 6379:6379 -d redis:alpine
```

To run test use ``go test ./...`` or run [GoConvey](http://goconvey.co/):

```bash
go get github.com/smartystreets/goconvey
goconvey
```

For full local deployment of all services, including web, graphite and metrics relay (may be slow on first launch) use:

```bash
docker-compose up
```

Before pushing your changes don't forget about linter:

```bash
make lint
```
67 changes: 67 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
name: 🐞 Bug report
about: Create a report for a bug
labels: bug
---

# BUG REPORT

## What version of Moira are you using (`[binary] --version`)?

<!-- Please fill version for each binary -->

<details><pre>

$ api --version

$ checker --version

$ cli --version

$ filter --version

$ notifier --version

</pre></details>

## Configuration

<!-- Please fill configuration files as much as possible. This will help us to find the problem. -->

<details>

`api.yaml`

```yaml

```

`checker.yaml`

```yaml

```

`cli.yaml`

```yaml

```

`filter.yaml`

```yaml

```

`notifier.yaml`

```yaml

```

</details>

## What did you expect to see?

## What did you see instead?
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: 💫 Feature request
about: Ask us to implement something new
labels: feature
---

<!--- Verify first that your feature was not already discussed on GitHub -->
<!--- Complete *all* sections as described -->

# FEATURE

## Summary

Main idea

### Details

<details>
</details>
5 changes: 5 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# PR Summary

Additional information

Closes/Relates #issue
37 changes: 4 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ docker-compose pull
docker-compose up
```

See more on our [documentation page](https://moira.readthedocs.io/en/latest/installation/index.html).

Feed data in Graphite format to `localhost:2003`:

```bash
Expand All @@ -23,45 +25,14 @@ Configure triggers at `localhost:8080` using your browser.

Other installation methods are available, see [documentation](https://moira.readthedocs.io/en/latest/installation/index.html).

## Development

To build and run tests you need local redis listening on port 6379.
Easiest way to get redis is via docker:

```bash
docker run -p 6379:6379 -d redis:alpine
```

To run test use ``go test ./...`` or run [GoConvey](http://goconvey.co/):

```bash
go get github.com/smartystreets/goconvey
goconvey
```

For full local deployment of all services, including web, graphite and metrics relay (may be slow on first launch) use:
## Contribution

```bash
docker-compose up
```

Before push your changes don't forget about linter:

```bash
make lint
```
Check our [contribution guideline](.github/CONTRIBUTING.md)

## Getting Started

See our [user guide](https://moira.readthedocs.io/en/latest/user_guide/index.html) that is based on a number of real-life scenarios, from simple and universal to complicated and specific.

## Why 2.0

Moira 2.0 is different from the first version in two important ways:

1. We got rid of Python, because it was slow. Checker and API services are now written in Go, based on [carbonapi](https://github.com/go-graphite/carbonapi) implementation of Graphite functions.
2. We got rid of Angular, because our main stack is React now. We just don't know how to do Angular anymore. We also revamped the UI.

## What is in the other repositories

Code in this repository is the backend part of Moira monitoring application.
Expand Down

0 comments on commit a35430a

Please sign in to comment.