|
2 | 2 |
|
3 | 3 | Thank you for your interest in contributing to Semaphore! This document provides guidelines and information for contributors.
|
4 | 4 |
|
5 |
| -## Table of Contents |
6 |
| -- [Code of Conduct](#code-of-conduct) |
7 |
| -- [Getting Started](#getting-started) |
8 |
| -- [Repository Structure](#repository-structure) |
9 |
| -- [Development Process](#development-process) |
10 |
| -- [Submitting Changes](#submitting-changes) |
11 |
| -- [Community](#community) |
| 5 | +## Quick Start |
12 | 6 |
|
13 |
| -## Code of Conduct |
| 7 | +**Ready to contribute?** |
14 | 8 |
|
15 |
| -By participating in this project, you are expected to uphold our [Code of Conduct](CODE_OF_CONDUCT.md). |
| 9 | +1. **Fork the repository** on GitHub |
| 10 | +2. **Clone your fork**: `git clone https://github.com/YOUR_USERNAME/semaphore.git` |
| 11 | +3. **Create a feature branch**: `git checkout -b feature/your-feature-name` |
| 12 | +4. **Open in VS Code**: Most services have dev container support for easy setup |
| 13 | +5. **Make your changes** and ensure all tests pass |
| 14 | +6. **Create a Pull Request** from your fork |
16 | 15 |
|
17 |
| -## Getting Started |
| 16 | +> [!IMPORTANT] |
| 17 | +> 🚦 **All CI checks must pass before review.** |
18 | 18 |
|
19 |
| -### Repository Structure |
| 19 | +## Repository Structure |
20 | 20 |
|
21 |
| -Our repository contains both open-source and enterprise code: |
22 |
| -- Open-source code: All code outside the `ee/` directory (Apache 2.0 license) |
23 |
| -- Enterprise code: All code within the `ee/` directory (proprietary license) |
| 21 | +Our monorepo contains multiple services: |
24 | 22 |
|
25 |
| -Please ensure you're working in the appropriate directory based on the feature you're developing. |
| 23 | +- **Community Edition**: All code outside `ee/` directory (Apache 2.0 license) |
| 24 | +- **Enterprise Edition**: Code within `ee/` directory (commercial license) |
26 | 25 |
|
27 |
| -## Development Process |
| 26 | +### Technology Stack |
28 | 27 |
|
29 |
| -### 1. Finding Issues to Work On |
30 |
| -- Check our issue tracker for open issues |
31 |
| -- Look for issues tagged with `good-first-issue` or `help-wanted` |
32 |
| -- Feel free to ask questions in the issue comments |
| 28 | +- **Elixir**: Core services (auth, guard, projecthub, secrethub, etc.) |
| 29 | +- **Go**: Infrastructure services (bootstrapper, encryptor, repohub, etc.) |
| 30 | +- **TS/React**: Frontend (front/) |
| 31 | +- **Ruby**: Github hook processing (github_hooks) |
33 | 32 |
|
34 |
| -### 2. Making Changes |
| 33 | +## Development Workflow |
35 | 34 |
|
36 |
| -1. Fork the repository |
37 |
| -2. Create a new branch from `main`: |
38 |
| - ``` |
39 |
| - git checkout -b feature/your-feature-name |
40 |
| - ``` |
41 |
| -3. Make your changes |
42 |
| -4. Write or update tests as needed |
43 |
| -5. Ensure all tests pass locally |
| 35 | +### 1. Fork & Setup |
44 | 36 |
|
45 |
| -### 3. Code Style |
| 37 | +```bash |
| 38 | +# Fork repository on GitHub, then: |
| 39 | +git clone https://github.com/YOUR_USERNAME/semaphore.git |
| 40 | +cd semaphore |
| 41 | +git remote add upstream https://github.com/semaphoreio/semaphore.git |
| 42 | +``` |
46 | 43 |
|
47 |
| -Our codebase follows these principles: |
48 |
| -- Keep code simple and readable |
49 |
| -- Add comments for complex logic |
50 |
| -- Follow existing patterns in the codebase |
51 |
| -- Document public APIs |
| 44 | +### 2. Create Feature Branch |
52 | 45 |
|
53 |
| -## Submitting Changes |
| 46 | +```bash |
| 47 | +git checkout -b feature/descriptive-name |
| 48 | +# or: fix/bug-description, docs/update-readme, etc. |
| 49 | +``` |
54 | 50 |
|
55 |
| -### Pull Request Process |
| 51 | +### 3. Development & Testing |
56 | 52 |
|
57 |
| -1. Update relevant documentation |
58 |
| -2. Add an entry to CHANGELOG.md if applicable |
59 |
| -3. Ensure your PR includes only related changes |
60 |
| -4. Fill out the PR template completely |
61 |
| -5. Request review from maintainers |
| 53 | +**Most services include VS Code dev container support for instant setup:** |
62 | 54 |
|
63 |
| -### PR Requirements |
64 |
| -- Clear, descriptive title |
65 |
| -- Reference related issues |
66 |
| -- Test coverage for new features |
67 |
| -- Updated documentation |
68 |
| -- Clean commit history |
| 55 | +```bash |
| 56 | +# Open any service with dev container support |
| 57 | +code auth/ # VS Code will prompt to "Reopen in Container" |
| 58 | +``` |
69 | 59 |
|
70 |
| -### Review Process |
| 60 | +**For services without dev containers, use Docker directly:** |
71 | 61 |
|
72 |
| -1. Maintainers will review your code |
73 |
| -2. Address any requested changes |
74 |
| -3. Once approved, maintainers will merge your PR |
| 62 | +```bash |
| 63 | +cd service_name |
| 64 | +make build |
| 65 | +make test.ex # For Elixir services |
| 66 | +make test # For Go services |
| 67 | +``` |
75 | 68 |
|
76 |
| -## Community |
| 69 | +### 4. Ensure CI Will Pass |
77 | 70 |
|
78 |
| -### Getting Help |
| 71 | +**Before pushing, run these checks locally:** |
79 | 72 |
|
80 |
| -- GitHub Discussions: Technical questions and feature discussions |
81 |
| -- Issue Tracker: Bug reports and feature requests |
82 |
| -- [Community Chat]: Quick questions and community discussions |
| 73 | +```bash |
| 74 | +# Elixir services |
| 75 | +make format.ex # Format code |
| 76 | +make lint.ex # Run linter |
| 77 | +make test.ex # Run tests |
83 | 78 |
|
84 |
| -### Communication Tips |
| 79 | +# Go services |
| 80 | +make lint |
| 81 | +make test |
85 | 82 |
|
86 |
| -- Be clear and concise |
87 |
| -- Provide context for your questions |
88 |
| -- Be patient with responses |
89 |
| -- Help others when you can |
| 83 | +# All services |
| 84 | +make check.docker # Security scan |
| 85 | +``` |
90 | 86 |
|
91 |
| -## Recognition |
| 87 | +### 5. Create Pull Request |
92 | 88 |
|
93 |
| -Contributors are recognized in: |
94 |
| -- Release notes |
95 |
| -- Contributors list |
96 |
| -- Project documentation |
| 89 | +- **Push your branch** to your fork |
| 90 | +- **Create PR** from your fork to `semaphoreio/semaphore:main` |
| 91 | +- **Fill out the PR template** completely |
| 92 | +- **Wait for review** - maintainers will be automatically assigned |
97 | 93 |
|
98 |
| -Thank you for contributing to Semaphore! |
| 94 | +## Code Guidelines |
| 95 | + |
| 96 | +### Commit Messages |
| 97 | + |
| 98 | +Use [conventional commits](https://www.conventionalcommits.org/): |
| 99 | + |
| 100 | +```text |
| 101 | +feat(auth): add OAuth2 token refresh mechanism |
| 102 | +
|
| 103 | +- Implement automatic token refresh logic |
| 104 | +- Add retry mechanism for expired tokens |
| 105 | +- Update auth middleware to handle refresh |
| 106 | +``` |
| 107 | + |
| 108 | +### Testing Requirements |
| 109 | + |
| 110 | +- **New features**: Include unit tests |
| 111 | +- **Bug fixes**: Include regression tests |
| 112 | +- **API changes**: Update integration tests |
| 113 | +- **Frontend changes**: Consider browser test coverage |
| 114 | + |
| 115 | +## Getting Help |
| 116 | + |
| 117 | +- **[GitHub Discussions](https://github.com/semaphoreio/semaphore/discussions)**: Questions and discussions |
| 118 | +- **[Discord](https://discord.gg/FBuUrV24NH)**: Real-time chat |
| 119 | +- **[Good First Issues](https://github.com/semaphoreio/semaphore/labels/good%20first%20issue)**: Beginner-friendly tasks |
| 120 | + |
| 121 | +## Additional Resources |
| 122 | + |
| 123 | +- **[Development Setup](DEVELOPMENT.md)**: Detailed environment setup |
| 124 | +- **[Roadmap](ROADMAP.md)**: Project direction and priorities |
| 125 | +- **[Code of Conduct](CODE_OF_CONDUCT.md)**: Community guidelines |
| 126 | + |
| 127 | +--- |
| 128 | + |
| 129 | +**Ready to contribute?** Pick a [good first issue](https://github.com/semaphoreio/semaphore/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) or say hello on [Discord](https://discord.gg/FBuUrV24NH)! 👋 |
0 commit comments