|
| 1 | +# Contributing to opsi-configed |
| 2 | + |
| 3 | +Thank you for your interest in contributing to the Configed project! We |
| 4 | +appreciate your contributions to help improve the project. To ensure a |
| 5 | +smooth collaboration, please follow these guidelines when contributing. |
| 6 | + |
| 7 | +## Commit Message Convention |
| 8 | + |
| 9 | +We follow a prefix-based commit message convention to provide clarity |
| 10 | +and consistency in our commit messages. The convention is as follows: |
| 11 | + |
| 12 | +```bash |
| 13 | +[Prefix]: Short Description |
| 14 | +``` |
| 15 | + |
| 16 | +### Prefixes |
| 17 | + |
| 18 | +Prefixes are used to categorize commits based on the type of change they |
| 19 | +represent. The following prefixes are used in our project: |
| 20 | + |
| 21 | +* **new**: A new feature implementation |
| 22 | +* **chg**: Implementation changes |
| 23 | +* **dep**: Changes related to deprecated code or functionality |
| 24 | +* **rem**: Removal or deletion of code or files |
| 25 | +* **fix**: A bug fix |
| 26 | +* **sec**: Security-related changes or fixes |
| 27 | + |
| 28 | +## Commit Message Guidelines |
| 29 | + |
| 30 | +Please adhere to the following guidelines when crafting your commit messages: |
| 31 | + |
| 32 | +* Separate the subject line from the body with a blank line. |
| 33 | +* Limit the subject line to 50 characters or less and the body to 72 characters |
| 34 | + per line. |
| 35 | +* Capitalize the subject line and use imperative mood (e.g., "Add", "Fix"). |
| 36 | +* Do not end the subject line with a period. |
| 37 | +* Provide explanatory text in the body to explain what and why, rather than how. |
| 38 | +* Include relevant issues by referencing their numbers in the commit message. |
| 39 | +* Use the following rules for commit messages: |
| 40 | + 1. Follow an atomic commit approach, addressing a single logical change in |
| 41 | + each commit. |
| 42 | + 2. Include the original problem description when fixing an issue. |
| 43 | + 3. Avoid assuming the code is self-explanatory and provide sufficient context. |
| 44 | + |
| 45 | +### Example Commit Message |
| 46 | + |
| 47 | +``` |
| 48 | +[new] Implement login functionality |
| 49 | +
|
| 50 | +This commit adds a new login feature that allows users to authenticate |
| 51 | +and access protected resources. It includes the necessary API endpoints, |
| 52 | +database schema modifications, and user interface changes. |
| 53 | +
|
| 54 | +Fixes #123 |
| 55 | +``` |
| 56 | + |
| 57 | +## Breaking Change |
| 58 | + |
| 59 | +In our project, we follow a specific convention for a committing a breaking |
| 60 | +changes to our codebase. This convention helps us maintain a clear and |
| 61 | +standardized commit history, making it easier for developers to understand |
| 62 | +the nature and impact of changes. |
| 63 | + |
| 64 | +A breaking commit refers to a commit that introduces changes that could |
| 65 | +potentially break existing functionality or cause compatibility issues. |
| 66 | +These changes are typically significant and may require careful consideration |
| 67 | +by other developers who depend on the codebase. |
| 68 | + |
| 69 | +When creating a breaking commit in our project, we include an exclamation |
| 70 | +mark (!) symbol at the end of the prefix but before the short description. |
| 71 | +This convention is widely adopted within our team and serves as a visual |
| 72 | +indicator to quickly identify commits that may introduce compatibilty issues |
| 73 | +or break existing functionality. |
| 74 | + |
| 75 | +For instance, if we make a breaking change that modifies a critical function |
| 76 | +in our software library, we would write a breaking commit message like |
| 77 | +"[chg]! modify function x to improve performance" By adding the exclamation |
| 78 | +mark after the "chg" prefix, it becomes immediately apparent that this commit |
| 79 | +contains changes with the potential to break existing functionality. |
| 80 | + |
| 81 | +It's important to note that the convention of adding the exclamation mark (!) |
| 82 | +symbol after the breaking prefix is specifc to our project. While it may not |
| 83 | +be a strict requirement imposed by version control systems or tools like Git, |
| 84 | +we have found it to be a valuable practice that improves code comprehension |
| 85 | +within our team. |
| 86 | + |
| 87 | +## Coding Style and Code Analysis |
| 88 | + |
| 89 | +* All code changes must adhere to the project's [coding style guidelines](CODING_STYLE.md). |
| 90 | +* We use SonarLint tool to identify and resolve bugs, code smells, and other |
| 91 | + issues. |
| 92 | +* Ensure that every commit has no SonarLint warnings or issues. |
| 93 | + |
| 94 | +## Merge Requests and Issues |
| 95 | + |
| 96 | +In our project, we use merge requests and issues to facilitate collaboration |
| 97 | +and track progress. Understanding when to use each can help streamline the |
| 98 | +development process. |
| 99 | + |
| 100 | +### Merge Requests |
| 101 | + |
| 102 | +Merge requests are used when you have completed a task or made changes to the |
| 103 | +code that need to be reviewed and merged into the `main` branch. They are |
| 104 | +typically used for the following scenarios: |
| 105 | + |
| 106 | +* Implementing new features |
| 107 | +* Fixing bugs |
| 108 | +* Refactoring code |
| 109 | +* Making significant changes to the project |
| 110 | + |
| 111 | +When creating a merge request, make sure to provide a clear and concise |
| 112 | +description of the changes made, along with any relevant information or |
| 113 | +context. This helps reviewers understand the purpose and impact of the changes |
| 114 | +and enables a smooth review process. |
| 115 | + |
| 116 | +### Issues |
| 117 | + |
| 118 | +Issues are used to track and discuss specific tasks, enhancements, or bugs |
| 119 | +in the project. They are a way to document and organize work that needs to |
| 120 | +be done. Issues can be used for the following purposes: |
| 121 | + |
| 122 | +* Reporting bugs or unexpected behavior |
| 123 | +* Discussing and planning new features or enhancements |
| 124 | +* Tracking tasks and assignments |
| 125 | + |
| 126 | +When creating an issue, provide a descriptive title and a detailed description |
| 127 | +of the problem or task. Include any relevant information, such as steps to |
| 128 | +reproduce a bug or specifications for a new feature. This helps in providing |
| 129 | +context and ensures that everyone involved understands the purpose and scope |
| 130 | +of the issue. |
| 131 | + |
| 132 | +It's a good practice to reference the relevant issues in your merge requests |
| 133 | +by mentioning the issue number or using the "Closes" keyword. This helps in |
| 134 | +establishing the link between the work being done and the associated issue, |
| 135 | +making it easier to track the progress and close the issue when the changes |
| 136 | +are merged. |
| 137 | + |
| 138 | +Remember, clear and informative merge requests and well-documented issues |
| 139 | +contribute to effective collaboration and ensure that the development process |
| 140 | +runs smoothly. |
| 141 | + |
| 142 | +## Branch Strategy |
| 143 | + |
| 144 | +### Branch Types |
| 145 | + |
| 146 | +* **`main` branch**: The `main` branch serves as the main integration |
| 147 | + branch for ongoing development work. It is where individual feature |
| 148 | + branches or bug fix branches are merged in preparation for the next |
| 149 | + release. The `main` branch may contain features and bug fixes that |
| 150 | + are still being tested and refined. |
| 151 | + |
| 152 | +When starting work on a new feature or bug fix, create a new branch from |
| 153 | +the `main` branch. Once the changes are completed and tested, they can |
| 154 | +be merged back into the `main` branch. |
| 155 | + |
| 156 | +### Creating Branches |
| 157 | + |
| 158 | +When working on a new feature, bug fix, or any other code change, follow |
| 159 | +this branch naming convention: |
| 160 | + |
| 161 | +``` |
| 162 | +<type>/<short-description> |
| 163 | +``` |
| 164 | + |
| 165 | +* `<type>`: Use one of the following prefixes to indicate the type of the branch: |
| 166 | + * `feat`: Feature implementation |
| 167 | + * `fix`: Bug fix |
| 168 | + * `ref`: Code refactoring |
| 169 | + * `docs`: Documentation changes |
| 170 | + * `style`: Code style changes |
| 171 | + * `perf`: Performance improvements |
| 172 | + * `ci`: Continuous Integration configuration |
| 173 | + * `sec`: Security-related changes or fixes |
| 174 | +* `<short-description>`: A brief description of the changes being made. |
| 175 | + |
| 176 | +Example: `feat/user-authentication`, `fix/file-upload-bug` |
| 177 | + |
| 178 | +## Workflow |
| 179 | + |
| 180 | +1. Create a new branch for the issue or task you are working on, based on |
| 181 | + the `main` branch. |
| 182 | +2. Make the necessary changes, additions, or fixes in your branch. |
| 183 | +3. Commit your changes following the commit message guidelines, including |
| 184 | + relevant issues. |
| 185 | +4. Push your branch to the remote repository. |
| 186 | +5. Create a merge request to propose your changes for review. |
| 187 | +6. Discuss and iterate on your code changes through comments on the |
| 188 | + merge request. |
| 189 | +7. Once the changes are approved, they will be merged into the `main` branch. |
| 190 | + |
| 191 | +## Discussion and Communication |
| 192 | + |
| 193 | +All discussions and communication related to the project should be conducted |
| 194 | +in English. This helps to ensure clear and effective communication among |
| 195 | +contributors from different backgrounds. |
| 196 | + |
| 197 | +We appreciate your contribution to Configed and adherence to these guidelines! |
| 198 | +By following these guidelines and the established workflow, we can maintain |
| 199 | +a collaborative and efficient development process. |
| 200 | + |
| 201 | +Please reach out to us if you have any questions or need further assistance. |
| 202 | + |
| 203 | +Thank you, |
| 204 | + |
| 205 | +Configed Team |
0 commit comments