|
| 1 | +# Contributing Guide |
| 2 | + |
| 3 | +We welcome your interest in developing this project! We appreciate any contribution, whether it's fixing bugs, adding |
| 4 | +new features, or improving documentation. To make the process as smooth as possible, please review this guide. |
| 5 | + |
| 6 | +## How to Contribute |
| 7 | + |
| 8 | +The basic process for making changes is as follows: |
| 9 | + |
| 10 | +1. **Fork the repository:** Create your own copy of the repository on GitHub. |
| 11 | +2. **Clone the fork:** `git clone https://github.com/YOUR_USERNAME/DenisLopatin-server.git` |
| 12 | +3. **Create a branch:** Create a new branch for your changes (`git checkout -b feature/my-new-feature` or `git checkout -b fix/bug-fix`). |
| 13 | +4. **Make changes:** Write code, fix a bug, update configuration. |
| 14 | +5. **Test:** Ensure your changes haven't broken existing functionality. Run the Playwright tests (see the "Testing" section). |
| 15 | +6. **Commit changes:** `git commit -m "feat: Add support for a new service"` (try to follow [Conventional Commits](https://www.conventionalcommits.org/) if possible). |
| 16 | +7. **Push changes to your fork:** `git push origin feature/my-new-feature` |
| 17 | +8. **Create a Pull Request (PR):** Open a PR from your branch to the `main` branch of the main repository. |
| 18 | + |
| 19 | +## Reporting Bugs (Issues) |
| 20 | + |
| 21 | +If you find a bug: |
| 22 | + |
| 23 | +1. **Check existing Issues:** Perhaps this bug has already been reported. |
| 24 | +2. **Create a new Issue:** If the bug hasn't been reported, create a new Issue with a clear and descriptive title. |
| 25 | +3. **Describe the problem:** |
| 26 | + * Specify your Docker version, Docker Compose version, and your OS. |
| 27 | + * Describe the steps to reproduce the error. |
| 28 | + * Describe the expected and actual behavior. |
| 29 | + * Attach error logs (`docker logs <container_name>`) or screenshots if necessary. |
| 30 | + |
| 31 | +## Suggesting Enhancements (Feature Requests) |
| 32 | + |
| 33 | +If you have an idea to improve the project: |
| 34 | + |
| 35 | +1. **Check existing Issues:** Perhaps a similar idea is already being discussed. |
| 36 | +2. **Create a new Issue:** Describe your idea, explain the problem it solves, and why it would be beneficial for the project. |
| 37 | + |
| 38 | +## Setting Up the Development Environment |
| 39 | + |
| 40 | +Before making changes, you need to set up the project locally. Detailed instructions are in the [README.md](README.md) file. |
| 41 | + |
| 42 | +## Code Style and Configuration |
| 43 | + |
| 44 | +* **Docker Configurations:** Try to follow the existing style in `docker-compose.yml` and `Dockerfile`s. Use comments for non-trivial solutions. |
| 45 | +* **Bash Scripts:** Use `set -euo pipefail`. Break down complex logic into functions. Add comments. |
| 46 | +* **Playwright Tests:** Follow the structure and style of existing tests. Use reliable selectors and explicit assertions (`expect`). |
| 47 | + |
| 48 | +## Testing |
| 49 | + |
| 50 | +The project uses Playwright for E2E testing. |
| 51 | + |
| 52 | +* **Running tests:** Use the command `npm test`. |
| 53 | +* **Adding/Updating tests:** If your changes affect functionality covered by tests, update them. If you add new functionality, please add tests for it as well. |
| 54 | + |
| 55 | +Ensure all tests pass successfully before creating a Pull Request. |
| 56 | + |
| 57 | +To run the full project test cycle, execute the command `./tests/tests.sh`. Enter the system's `root` user password when |
| 58 | +prompted; this is necessary to create entries in `/etc/hosts` on WSL/Linux or `/private/etc/hosts` on macOS. |
| 59 | + |
| 60 | +## Pull Requests (PR) |
| 61 | + |
| 62 | +* **Description:** Provide a clear description of what your PR does and what problem it solves. Reference the related Issue (e.g., `Fixes #123`). |
| 63 | +* **Small PRs:** Try to make small, focused PRs. They are easier to review and merge. |
| 64 | +* **Passing Tests:** Ensure all automated checks (GitHub Actions, if configured) and local tests pass. |
| 65 | +* **Review:** Be prepared for discussion and making changes based on the review feedback. |
| 66 | + |
| 67 | +## License |
| 68 | + |
| 69 | +By contributing to this project, you agree that your changes will be licensed under the [MIT License](LICENSE) used by |
| 70 | +this project. |
| 71 | + |
| 72 | +Thank you for your contribution! |
0 commit comments