Skip to content

Commit 136c905

Browse files
committed
Add contributing.md
1 parent d296e3f commit 136c905

File tree

5 files changed

+157
-40
lines changed

5 files changed

+157
-40
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,4 @@ jobs:
4343

4444
# Run PHP CS Fixer
4545
- name: Run linter
46-
run: composer test:lint
46+
run: composer lint:check

CONTRIBUTING.md

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
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/meilisearch-symfony/issues/) or [open a new one](https://github.com/meilisearch/meilisearch-symfony/issues/new).
23+
2. Once done, [fork the meilisearch-symfony 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 meilisearch-symfony 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/meilisearch-symfony/releases/).
29+
30+
## Development Workflow
31+
32+
### Using the Docker Environment
33+
34+
#### Setup
35+
36+
To start and build your Docker environment, just execute the next command in a terminal:
37+
38+
```sh
39+
$ docker-compose up -d
40+
```
41+
42+
Be sure no other MeiliSearch instance is currently running on your machine.
43+
44+
#### Tests and Linter
45+
46+
Each Pull Request should pass the tests, and the linter to be accepted.
47+
48+
```sh
49+
# Tests
50+
$ docker-compose exec -e MEILISEARCH_URL=http://meilisearch:7700 php composer test:unit
51+
# Linter
52+
$ docker-compose exec php composer lint:check
53+
# Linter (with auto-fix)
54+
$ docker-compose exec php composer lint:fix
55+
```
56+
57+
### Using Composer
58+
59+
#### Setup
60+
61+
Install the dependencies:
62+
63+
```sh
64+
$ composer install
65+
```
66+
67+
#### Tests and Linter
68+
69+
Each Pull Request should pass the tests, and the linter to be accepted.
70+
71+
```sh
72+
# Tests
73+
$ docker run -p 7700:7700 getmeili/meilisearch:latest ./meilisearch --master-key=masterKey --no-analytics
74+
$ composer test:unit
75+
# Linter
76+
$ composer lint:check
77+
# Linter (with auto-fix)
78+
$ composer lint:check
79+
```
80+
81+
### Release Process
82+
83+
MeiliSearch tools follow the [Semantic Versioning Convention](https://semver.org/).
84+
85+
#### Automated Changelogs
86+
87+
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/meilisearch-symfony/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.
88+
89+
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.
90+
91+
About this automation:
92+
- As the draft release description is generated on every push on `master`, don't change it manually until the final release publishment.
93+
- 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).
94+
- 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.
95+
- 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.
96+
97+
*More information about the [Release Drafter](https://github.com/release-drafter/release-drafter), used to automate these steps.*
98+
99+
#### How to Publish the Release
100+
101+
Make a PR modifying the file [`src/MeiliSearchBundle.php`](/src/MeiliSearchBundle.php) with the right version.
102+
103+
```ruby
104+
VERSION = 'X.X.X'
105+
```
106+
107+
Once the changes are merged on `master`, you can publish the current draft release via the [GitHub interface](https://github.com/meilisearch/meilisearch-symfony/releases).
108+
109+
A WebHook will be triggered and push the new package to [Packagist](https://packagist.org/packages/meilisearch/search-bundle).
110+
111+
## Git Guidelines
112+
113+
### Git Branches
114+
115+
All changes must be made in a branch and submitted as PR.
116+
We do not enforce any branch naming style, but please use something descriptive of your changes.
117+
118+
### Git Commits
119+
120+
As minimal requirements, your commit message should:
121+
- be capitalized
122+
- not finish by a dot or any other punctuation character (!,?)
123+
- start with a verb so that we can read your commit message this way: "This commit will ...", where "..." is the commit message.
124+
e.g.: "Fix the home page button" or "Add more tests for create_index method"
125+
126+
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/).
127+
128+
### GitHub Pull Requests
129+
130+
Some notes on GitHub PRs:
131+
- [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>
132+
The draft PR can be very useful if you want to show that you are working on something and make your work visible.
133+
- 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.
134+
- All PRs must be reviewed and approved by at least one maintainer.
135+
- All PRs have to be **squashed and merged**.
136+
- 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/meilisearch-symfony/releases/).
137+
138+
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: 14 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -14,66 +14,44 @@
1414
</h4>
1515

1616
<p align="center">
17-
<a href="https://packagist.org/packages/meilisearch/meilisearch-bundle"><img src="https://img.shields.io/packagist/v/meilisearch/meilisearch-bundle" alt="Latest Stable Version"></a>
18-
<a href="https://github.com/emulienfou/meilisearch-bundle/actions"><img src="https://github.com/emulienfou/meilisearch-bundle/workflows/Tests/badge.svg" alt="Test"></a>
19-
<a href="https://github.com/emulienfou/meilisearch-bundle/blob/master/LICENSE"><img src="https://img.shields.io/badge/license-MIT-informational" alt="License"></a>
17+
<a href="https://packagist.org/packages/meilisearch/meilisearch-symfony"><img src="https://img.shields.io/packagist/v/meilisearch/search-bundle" alt="Latest Stable Version"></a>
18+
<a href="https://github.com/meilisearch/meilisearch-symfony/actions"><img src="https://github.com/meilisearch/meilisearch-symfony/workflows/Tests/badge.svg" alt="Test"></a>
19+
<a href="https://github.com/meilisearch/meilisearch-symfony/blob/master/LICENSE"><img src="https://img.shields.io/badge/license-MIT-informational" alt="License"></a>
2020
<a href="https://slack.meilisearch.com"><img src="https://img.shields.io/badge/slack-MeiliSearch-blue.svg?logo=slack" alt="Slack"></a>
2121
</p>
2222

23+
<p align="center">⚡ Lightning Fast, Ultra Relevant, and Typo-Tolerant Search Engine MeiliSearch bundle for Symfony</p>
2324

24-
<p align="center">⚡ Lightning Fast, Ultra Relevant, and Typo-Tolerant Search Engine MeiliSearch Symfony Bundle</p>
25-
26-
**MeiliSearchBundle** is a Bundle to integrate **MeiliSearch** within your Symfony Project.
27-
**MeiliSearch** is a powerful, fast, open-source, easy to use and deploy search engine. Both searching and indexing are highly customizable. Features such as typo-tolerance, filters, and synonyms are provided out-of-the-box.
25+
**MeiliSearch Symfony** is a search bundle to integrate **MeiliSearch** within your Symfony Project. **MeiliSearch** is a powerful, fast, open-source, easy to use and deploy search engine. Both searching and indexing are highly customizable. Features such as typo-tolerance, filters, and synonyms are provided out-of-the-box.
2826

2927
## Table of Contents <!-- omit in toc -->
3028
- [🤖 Compatibility with MeiliSearch](#-compatibility-with-meilisearch)
3129
- [✨ Features](#-features)
3230
- [📖 Documentation](#-documentation)
33-
- [⚙️ Development Workflow](#️-development-workflow)
31+
- [⚙️ Development Workflow and Contributing](#️-development-workflow-and-contributing)
3432

3533
## 🤖 Compatibility with MeiliSearch
34+
3635
This package is compatible with the following MeiliSearch versions:
36+
37+
- `v0.12.X`
3738
- `v0.11.X`
3839

3940
## ✨ Features
41+
4042
* **Require** PHP 7.2 and later.
4143
* **Compatible** with Symfony 4.0 and later.
4244
* **Support** Doctrine ORM and Doctrine MongoDB.
4345

4446
## 📖 Documentation
45-
Complete documentation of the MeiliSearch Bundle is available in the [Uncyclo](https://github.com/emulienfou/meilisearch-bundle/wiki) section.
46-
47-
## ⚙️ Development Workflow
48-
If you want to contribute, this section describes the steps to follow.
49-
50-
Thank you for your interest in a MeiliSearch tool! ♥️
51-
52-
### Run Docker Environment <!-- omit in toc -->
53-
To start and build your Docker environment, just execute the next command in a terminal:
54-
```sh
55-
docker-compose up -d
56-
```
57-
58-
#### Tests <!-- omit in toc -->
59-
Each Pull Request should pass the tests, and the linter to be accepted.
60-
To execute the tests, run the next command:
61-
```sh
62-
docker-compose exec -e MEILISEARCH_URL=http://meilisearch:7700 php composer test:unit
63-
```
64-
65-
### Release <!-- omit in toc -->
6647

67-
MeiliSearch tools follow the [Semantic Versioning Convention](https://semver.org/).
48+
Complete documentation of the MeiliSearch Bundle is available in the [Uncyclo section](https://github.com/meilisearch/meilisearch-symfony/wiki).
6849

69-
You must do a PR modifying the file `src/MeiliSearchBundle.php` with the right version.<br>
50+
## ⚙️ Development Workflow and Contributing
7051

71-
```php
72-
const VERSION = 'X.X.X';
73-
```
52+
Any new contribution is more than welcome in this project!
7453

75-
Then, you must create a release (with this name `vX.X.X`) via the GitHub interface.<br>
76-
A webhook will be triggered and push the new package on [Packagist](https://packagist.org/packages/meilisearch/meilisearch-bundle).
54+
If you want to know more about the development workflow or want to contribute, please visit our [contributing guidelines](/CONTRIBUTING.md) for detailed instructions!
7755

7856
<hr>
7957

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
},
5151
"scripts": {
5252
"test:unit": "phpunit --colors=always --verbose",
53-
"test:lint": "php-cs-fixer fix -v --config=.php_cs.dist --using-cache=no --dry-run"
53+
"lint:check": "php-cs-fixer fix -v --config=.php_cs.dist --using-cache=no --dry-run",
54+
"lint:fix": "php-cs-fixer fix -v --config=.php_cs.dist --using-cache=no"
5455
}
5556
}

docker-compose.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ services:
1111

1212
meilisearch:
1313
image: getmeili/meilisearch
14-
command: ./meilisearch --master-key=masterKey
14+
command: ./meilisearch --master-key=masterKey --no-analytics=true
1515
ports:
1616
- target: 7700
1717
published: 7700
18-
protocol: tcp
18+
protocol: tcp

0 commit comments

Comments
 (0)