Skip to content

Commit 8e34402

Browse files
authored
Add CONTRIBUTING.md (#46)
1 parent 3971c27 commit 8e34402

File tree

2 files changed

+110
-35
lines changed

2 files changed

+110
-35
lines changed

CONTRIBUTING.md

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# Contributing
2+
3+
First of all, thank you for contributing to MeiliSearch! The goal of this document is to provide everything you need to know in order to contribute to MeiliSearch and its different integrations.
4+
5+
<!-- MarkdownTOC autolink="true" style="ordered" indent=" " -->
6+
7+
- [Assumptions](#assumptions)
8+
- [How to Contribute](#how-to-contribute)
9+
- [Development Workflow](#development-workflow)
10+
- [Git Guidelines](#git-guidelines)
11+
12+
<!-- /MarkdownTOC -->
13+
14+
## Assumptions
15+
16+
1. **You're familiar with [GitHub](https://github.com) and the [Pull Request](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests)(PR) workflow.**
17+
2. **You've read the MeiliSearch [documentation](https://docs.meilisearch.com) and the [README](/README.md).**
18+
3. **You know about the [MeiliSearch community](https://docs.meilisearch.com/resources/contact.html). Please use this for help.**
19+
20+
## How to Contribute
21+
22+
1. Make sure that the contribution you want to make is explained or detailed in a GitHub issue! Find an [existing issue](https://github.com/meilisearch/docs-scraper/issues/) or [open a new one](https://github.com/meilisearch/docs-scraper/issues/new).
23+
2. Once done, [fork the docs-scraper repository](https://help.github.com/en/github/getting-started-with-github/fork-a-repo) in your own GitHub account. Ask a maintainer if you want your issue to be checked before making a PR.
24+
3. [Create a new Git branch](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-and-deleting-branches-within-your-repository).
25+
4. Review the [Development Workflow](#workflow) section that describes the steps to maintain the repository.
26+
5. Make your changes.
27+
6. [Submit the branch as a PR](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork) pointing to the `master` branch of the main docs-scraper repository. A maintainer should comment and/or review your Pull Request within a few days. Although depending on the circumstances, it may take longer.<br>
28+
We do not enforce a naming convention for the PRs, but **please use something descriptive of your changes**, having in mind that the title of your PR will be automatically added to the next [release changelog](https://github.com/meilisearch/docs-scraper/releases/).
29+
30+
## Development Workflow
31+
32+
### Install and Launch
33+
34+
The [`pipenv` command](https://pipenv.readthedocs.io/en/latest/install/#installing-pipenv) must be installed.
35+
36+
Set both environment variables `MEILISEARCH_HOST_URL` and `MEILISEARCH_API_KEY`.
37+
38+
Then, run:
39+
40+
```bash
41+
$ pipenv install
42+
$ pipenv run ./docs_scraper run <path-to-your-config-file>
43+
```
44+
45+
### Linter and Tests
46+
47+
```bash
48+
$ pipenv install --dev
49+
# Linter
50+
$ pipenv run pylint scraper
51+
# Tests
52+
$ pipenv run pytest ./scraper/src -k "not _browser"
53+
```
54+
55+
### Release Process
56+
57+
MeiliSearch tools follow the [Semantic Versioning Convention](https://semver.org/).
58+
59+
#### Automated Changelogs
60+
61+
For each PR merged on `master`, a GitHub Action is running and updates the next release description as a draft release in the [GitHub interface](https://github.com/meilisearch/docs-scraper/releases). If you don't have the right access to this repository, you will not be able to see the draft release until the release is published.
62+
63+
The draft release description is therefore generated and corresponds to all the PRs titles since the previous release. This means each PR should only do one change and the title should be descriptive of this change.
64+
65+
About this automation:
66+
- As the draft release description is generated on every push on `master`, don't change it manually until the final release publishment.
67+
- If you don't want a PR to appear in the release changelogs: add the label `skip-changelog`. We suggest removing PRs updating the README or the CI (except for big changes).
68+
- If the changes you are doing in the PR are breaking: add the label `breaking-change`. In the release tag, the minor will be increased instead of the patch. The major will never be changed until [MeiliSearch](https://github.com/meilisearch/MeiliSearch) is stable.
69+
- If you did any mistake, for example the PR is already closed but you forgot to add a label or you misnamed your PR, don't panic: change what you want in the closed PR and run the job again.
70+
71+
*More information about the [Release Drafter](https://github.com/release-drafter/release-drafter), used to automate these steps.*
72+
73+
#### How to Publish the Release
74+
75+
Once the changes are merged on `master`, you can publish the current draft release via the [GitHub interface](https://github.com/meilisearch/docs-scraper/releases).
76+
77+
A GitHub Action will be triggered and push the `latest` and `vX.X.X` version of the Docker image to [DockerHub](https://hub.docker.com/repository/docker/getmeili/docs-scraper).
78+
79+
## Git Guidelines
80+
81+
### Git Branches
82+
83+
All changes must be made in a branch and submitted as PR.
84+
We do not enforce any branch naming style, but please use something descriptive of your changes.
85+
86+
### Git Commits
87+
88+
As minimal requirements, your commit message should:
89+
- be capitalized
90+
- not finish by a dot or any other punctuation character (!,?)
91+
- start with a verb so that we can read your commit message this way: "This commit will ...", where "..." is the commit message.
92+
e.g.: "Fix the home page button" or "Add more tests for create_index method"
93+
94+
We don't follow any other convention, but if you want to use one, we recommend [this one](https://chris.beams.io/posts/git-commit/).
95+
96+
### GitHub Pull Requests
97+
98+
Some notes on GitHub PRs:
99+
- [Convert your PR as a draft](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/changing-the-stage-of-a-pull-request) if your changes are a work in progress: no one will review it until you pass your PR as ready for review.<br>
100+
The draft PR can be very useful if you want to show that you are working on something and make your work visible.
101+
- The branch related to the PR must be **up-to-date with `master`** before merging. You need to [rebase your branch](https://gist.github.com/curquiza/5f7ce615f85331f083cd467fc4e19398) if it is not.
102+
- All PRs must be reviewed and approved by at least one maintainer.
103+
- All PRs have to be **squashed and merged**.
104+
- The PR title should be accurate and descriptive of the changes. The title of the PR will be indeed automatically added to the next [release changlogs](https://github.com/meilisearch/docs-scraper/releases/).
105+
106+
Thank you again for reading this through, we can not wait to begin to work with you if you made your way through this contributing guide ❤️

README.md

Lines changed: 4 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ This scraper is used in production and runs on the [MeiliSearch documentation](h
5252
- [Authentication](#authentication)
5353
- [Installing Chrome Headless](#installing-chrome-headless)
5454
- [🤖 Compatibility with MeiliSearch](#-compatibility-with-meilisearch)
55-
- [👩‍💻 Development Workflow](#-development-workflow)
55+
- [⚙️ Development Workflow and Contributing](#-development-workflow-and-contributing)
5656
- [Credits](#credits)
5757

5858

@@ -492,42 +492,11 @@ This package is compatible with the following MeiliSearch versions:
492492
- `v0.11.X`
493493
- `v0.10.X`
494494

495-
## 👩‍💻 Development Workflow
495+
## ⚙️ Development Workflow and Contributing
496496

497-
### Install and Launch <!-- omit in TOC -->
497+
Any new contribution is more than welcome in this project!
498498

499-
The [`pipenv` command](https://pipenv.readthedocs.io/en/latest/install/#installing-pipenv) must be installed.
500-
501-
Set both environment variables `MEILISEARCH_HOST_URL` and `MEILISEARCH_API_KEY`.
502-
503-
Then, run:
504-
```bash
505-
$ pipenv install
506-
$ pipenv run ./docs_scraper run <path-to-your-config-file>
507-
```
508-
509-
### Linter and Tests <!-- omit in TOC -->
510-
511-
```bash
512-
$ pipenv install --dev
513-
# Linter
514-
$ pipenv run pylint scraper
515-
# Tests
516-
$ pipenv run pytest ./scraper/src -k "not _browser"
517-
```
518-
519-
### Release <!-- omit in TOC -->
520-
521-
Once the changes are merged on `master`, in your terminal, you must be on the `master` branch and push a new tag with the right version:
522-
523-
```bash
524-
$ git checkout master
525-
$ git pull origin master
526-
$ git tag vX.X.X
527-
$ git push --tag origin master
528-
```
529-
530-
A GitHub Action will be triggered and push the `latest` and `vX.X.X` version of Docker image on [DockerHub](https://hub.docker.com/repository/docker/getmeili/docs-scraper)
499+
If you want to know more about the development workflow or want to contribute, please visit our [contributing guidelines](/CONTRIBUTING.md) for detailed instructions!
531500

532501
## Credits
533502

0 commit comments

Comments
 (0)