Skip to content

Commit

Permalink
CONTRIBUTING: adoc file created (ReactiveX#724)
Browse files Browse the repository at this point in the history
  • Loading branch information
hexmind authored and RobWin committed Nov 4, 2019
1 parent c016641 commit 2edad44
Show file tree
Hide file tree
Showing 4 changed files with 122 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ classes
*/bin
*.orig
.attach_pid*
java_pid*.hprof
.DS_Store

105 changes: 105 additions & 0 deletions CONTRIBUTING.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
:toc: macro
ifdef::env-github[]
:tip-caption: :bulb:
:note-caption: :information_source:
:important-caption: :heavy_exclamation_mark:
:caution-caption: :fire:
:warning-caption: :warning:
endif::[]

= Contributing

We appreciate your input! We want to make contributing to *Resilience4j* as easy and transparent as possible.
As a contributor, here are the guidelines we would like you to follow:

toc::[]

== Questions

First, visit our https://resilience4j.readme.io/docs[User Guide]
and search https://stackoverflow.com/questions/tagged/resilience4j?tab=votes&pagesize=50[Stack Overflow].
Maybe somebody asked similar question in the past.

IMPORTANT: Before you submit new issue, please search the https://github.com/resilience4j/resilience4j/issues[GitHub Issues].
Maybe the discussion might inform you of solutions readily available.

== Bugs
If you discover unexpected behaviour or find a bug in the source code,
you can help us by submitting an issue via https://github.com/resilience4j/resilience4j/issues[GitHub Issues].
Use link:ISSUE_TEMPLATE[ISSUE_TEMPLATE] to provide required details.

* Use a clear and descriptive title for the issue to identify the problem.
* Explain which behavior you expected to see instead and why.

We want to fix all the issues as soon as possible, but before fixing a bug we need to reproduce and confirm it.
Having a minimal reproducible scenario gives us a wealth of important information without going back and forth to you with additional questions.
We ask you to provide a minimal reproduction as a JUnit test.
It allows us to quickly confirm a bug (or point out a coding problem)
as well as confirm that we are fixing the right problem.

== New features
You can propose a new feature by submitting an issue.

TIP: No ideas? See issues tagged as https://github.com/resilience4j/resilience4j/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22[*help wanted*].

CAUTION: Even if you would like to start with a Pull Request first,
please submit an issue with a proposal for your work first,
to be sure that we can use it.

For a major feature, outline your proposal in an issue so that it can be discussed.
This will also allow us to better coordinate our efforts, prevent duplication of work,
and help you to craft the change so that it is successfully accepted into the project.

NOTE: We use https://guides.github.com/introduction/flow/index.html[Github Flow].

Pull Requests are the best way to propose changes to the codebase:

. Fork the repo and create your branch from `master`.
. If you added code, add tests.
. Don't forget about backward compatibility and `Javadoc` for public methods.
. Apply out Twitter based coding style link:.editorconfig[.editorconfig]
(https://blog.jetbrains.com/idea/2019/06/managing-code-style-on-a-directory-level-with-editorconfig/[Idea])
and https://gist.github.com/wojteklu/73c6914cc446146b8b533c0988cf8d29[Clean Code] rules.
. Use our commit message format: `Issue #699: Fixed/Added bla bla`
. Send that Pull Request and participate in a code review.
. After a merge update the documentation especially if you've changed API (public methods).

== Tests

We use https://assertj.github.io/doc/[AssertJ],
https://javadoc.io/static/org.mockito/mockito-core/3.1.0/org/mockito/BDDMockito.html[BDDMockito]
and static imports for them.
Please write test body in the _Arrange-Act-Assert_ manner.
Keep _Act (When)_ section as small as possible.

TIP: Instead of `//Given` `//When` `//Then` comments separate sections by a new line.
For complex _Given_ setup you can extract private methods.


[source,java,title='Example test structure and conventions']
----
@Test
public void shouldConsumeOnErrorEvent() {
retry.getEventPublisher().onError(
event -> logger.info(event.getEventType().toString()));
Supplier<String> supplier = Retry.decorateSupplier(retry, helloWorldService::returnHelloWorld);
given(helloWorldService.returnHelloWorld()).willThrow(new HelloWorldException());
Try.ofSupplier(supplier)
// assertThat(result).isEqualTo...
then(logger).should().info("ERROR");
then(helloWorldService).should(times(3)).returnHelloWorld();
}
----

== Licence

By contributing, you agree that your contributions will be licensed under its
link:LICENSE.txt[Apache License, Version 2.0.]

== References

This document was adapted from the open-source contribution guidelines:
https://github.com/facebook/draft-js/blob/a9316a723f9e918afde44dea68b5f9f39b7d9b00/CONTRIBUTING.md[Facebook's Draft],
https://github.com/angular/angular/blob/master/CONTRIBUTING.md[Angular].
9 changes: 9 additions & 0 deletions ISSUE_TEMPLATE
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Thanks for raising a Resilience4j issue.
Please provide a brief description of your problem along with the versions you are using.
If possible, please also consider putting together a complete JUnit test that reproduces the issue.

Resilience4j version:

Java version:

Problem description:
9 changes: 7 additions & 2 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ image:https://dev.azure.com/resilience4j/resilience4j/_apis/build/status/resilie
image:https://api.bintray.com/packages/resilience4j/Maven/resilience4j/images/download.svg[link="https://bintray.com/resilience4j/Maven/resilience4j/_latestVersion"]
image:http://img.shields.io/badge/license-ASF2-blue.svg["Apache License 2", link="http://www.apache.org/licenses/LICENSE-2.0.txt"]

image:https://sonarcloud.io/api/project_badges/measure?project=resilience4j_resilience4j&metric=bugs["Bugs", link="https://sonarcloud.io/dashboard?id=resilience4j_resilience4j"]
image:https://sonarcloud.io/api/project_badges/measure?project=resilience4j_resilience4j&metric=vulnerabilities["Vulnerabilities", link="https://sonarcloud.io/dashboard?id=resilience4j_resilience4j"]
image:https://sonarcloud.io/api/project_badges/measure?project=resilience4j_resilience4j&metric=coverage["Coverage", link="https://sonarcloud.io/dashboard?id=resilience4j_resilience4j"]
image:https://sonarcloud.io/api/project_badges/measure?project=resilience4j_resilience4j&metric=sqale_rating["Maintainability", link="https://sonarcloud.io/dashboard?id=resilience4j_resilience4j"]
image:https://sonarcloud.io/api/project_badges/measure?project=resilience4j_resilience4j&metric=reliability_rating["Reliability", link="https://sonarcloud.io/dashboard?id=resilience4j_resilience4j"]
image:https://sonarcloud.io/api/project_badges/measure?project=resilience4j_resilience4j&metric=security_rating["Security", link="https://sonarcloud.io/dashboard?id=resilience4j_resilience4j"]
image:https://sonarcloud.io/api/project_badges/measure?project=resilience4j_resilience4j&metric=vulnerabilities["Vulnerabilities", link="https://sonarcloud.io/dashboard?id=resilience4j_resilience4j"]
image:https://sonarcloud.io/api/project_badges/measure?project=resilience4j_resilience4j&metric=bugs["Bugs", link="https://sonarcloud.io/dashboard?id=resilience4j_resilience4j"]

toc::[]

Expand Down Expand Up @@ -365,6 +365,11 @@ Find out more in our *https://resilience4j.readme.io/[User Guide]*.
[cols="4*"]
|===

|slides
|https://www.slideshare.net/nfrankel/goto-berlin-battle-of-the-circuit-breakers-resilience4j-vs-istio[Battle of the Circuit Breakers: Resilience4J vs Istio]
|Nicolas Frankel
|GOTO Berlin

|0:42
|https://www.youtube.com/watch?v=KosSsZEqS-k&t=157[Resilience patterns in the post-Hystrix world]
|Tomasz Skowroński
Expand Down

0 comments on commit 2edad44

Please sign in to comment.