-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: improve contributor experience (#201)
- Loading branch information
Showing
53 changed files
with
995 additions
and
795 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
# How to contribute | ||
|
||
Welcome on the CONTRIBUTING page of asyncapi-codegen ! Thanks for your interest | ||
in contributing to this project, any contribution/suggestion is warmly welcomed. | ||
|
||
If you need further guidance, you can find our team on the following: | ||
* [Discussions on Github](https://github.com/lerenn/asyncapi-codegen/discussions) | ||
|
||
## Contributing | ||
|
||
### 1. Create an issue | ||
|
||
If you have a suggestion, a bug, or any kind of thing that should impact the | ||
source code, please open an issue on the | ||
[Github repository](https://github.com/lerenn/asyncapi-codegen/issues). | ||
|
||
Expose your problem and/or the suggestion and feel free to mention if you are | ||
willing to do the change by yourself or prefer to let someone else do it. | ||
|
||
It is important to open an issue in order to discuss the matter and avoid any | ||
unecessary back-and-forth exchanges that would result in uneeded change in | ||
the code you would write. | ||
|
||
### 2. Write your contribution | ||
|
||
#### Start the development environment | ||
|
||
If and once you're ready to write the contribution, you can start the development | ||
environment by typing this command: | ||
|
||
```bash | ||
make dev/up | ||
``` | ||
|
||
Once you're done, you can terminate your environment by typing this command: | ||
|
||
```bash | ||
make dev/down | ||
``` | ||
|
||
#### Explore the source code | ||
|
||
Code is separated between the following directories: | ||
* `build/` contains the files related to the CI and the packaging (Docker, ...) | ||
of asyncapi-codegen project | ||
* `cmd/` contains all executable produces by this project (no the project | ||
internal tools) | ||
* `examples/` contains workable examples of generated code along to their asyncapi | ||
document against the brokers supported in this project. You can test them if | ||
you start the `app` in a terminal then the `user` in another by using | ||
`go run ./examples/<example>/v<version>/<broker>/<app|user>` | ||
* `pkg/`contains all the project source code that can be reused in other projects: | ||
* `pkg/asyncapi` contains the Go code for asyncapi specification | ||
* `pkg/ci` contains the Go code for the CI | ||
* `pkg/codegen` contains the Go code for the code generation | ||
* `pkg/extensions` contains the Go code for the extensions used by asyncapi-codegen users | ||
* `pkg/utils` contains the Go code for the utilities used by asyncapi-codegen | ||
* `tests/` contains the tests of the project by version and by type (issue, etc). | ||
This is where you should implement your tests linked to your issues if this implies | ||
code generation. | ||
* `tools/` contains the tools used by the project (like the certs generation tool | ||
for testing) | ||
|
||
#### Write your code | ||
|
||
Once you've explored the source code, you can start writing your code. | ||
|
||
Please follow the following rules: | ||
* Write tests for your code if possible | ||
* Respect the code style (linter) | ||
|
||
#### Test your code | ||
|
||
##### Without code generation | ||
|
||
If you don't need code generation (testing broker implementation, asyncapi | ||
parsing, etc), feel free to add tests close to your changes in a `*_test.go` file. | ||
|
||
##### With code generation | ||
|
||
If you're code implies some code generation, you can write test in the corresponding | ||
directory `./test/<version>/issue<#>/` where you can put the following files: | ||
* `asyncapi.yml` the asyncapi document that will be used to generate the code | ||
* `asyncapi.gen.go` the generated code | ||
* `suite_test.go` the test file that will be used to test the generated code, it | ||
should have a `//go:generate` command to generate the `asyncapi.gen.go`. | ||
|
||
Please respect the following rules: | ||
* Channels should be prefixed with the version and the issue number (example: | ||
`v2.issue1`) to avoid collision in case of parallel tests | ||
* The test package should be named `issue<#>` where `#` is the issue number | ||
* Use the testify framework to write your tests (see the existing tests for | ||
examples) | ||
* Brokers from `test/brokers.go` should be used to ensure that tests works with | ||
all brokers. | ||
|
||
Of course, do not hesitate to ask for help if you need it. | ||
|
||
### 3. Open a pull request | ||
|
||
Once you're done with your code, you can open a pull request on the | ||
[Github repository](https://github.com/lerenn/asyncapi-codegen/pulls). | ||
|
||
## Missing information here? | ||
|
||
If you think that some information is missing here, feel free to open an issue | ||
on the [Github repository](https://github.com/lerenn/asyncapi-codegen/issues). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Contributors | ||
|
||
This is maybe the most important file of this project: it recognizes people who | ||
are helping and are, directly or indirectly, baking this project success. | ||
|
||
Those people spend their time, for free, to make this project better. As time is an | ||
asset that never comes back, and these people choose to use their time in this | ||
adventure, this file is a attempt to show them the respect they earned. | ||
|
||
## Special thanks for all the people who have helped this project so far | ||
|
||
* [Mario Graef (@magraef)](https://github.com/magraef) | ||
* [Sergey Kostyuchenko (@derfenix)](https://github.com/derfenix) | ||
* [Matouš Dzivjak (@matoous)](https://github.com/matoous) | ||
* [Olivier Bouchet (@obouchet)](https://github.com/obouchet) | ||
* [Tzu-Yu Lee (@leejuyuu)](https://github.com/leejuyuu) | ||
* [Stefan Meschke (@stefanmeschke)](https://github.com/stefanmeschke) | ||
* [Aleksey (@lo00l)](https://github.com/lo00l) | ||
* And maybe you ? | ||
|
||
## I would like to join the list. How can I help the project? | ||
|
||
For more information, please refer to our [CONTRIBUTING](./CONTRIBUTING.md) guide. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.