|
| 1 | +Contributing to SCEPTRE Phenix |
| 2 | + |
| 3 | +Thank you for your interest in contributing to SCEPTRE Phenix! We welcome contributions from everyone and appreciate your efforts to improve our project. This guide will help you understand how to contribute effectively. |
| 4 | + |
| 5 | +> Note: A failure to follow this guide will result in delay of PRs until there is compliance. |
| 6 | +
|
| 7 | +## Table of Contents |
| 8 | + |
| 9 | +- [Getting Started](#getting-started) |
| 10 | +- [How to Contribute](#how-to-contribute) |
| 11 | + - [Reporting Issues](#reporting-issues) |
| 12 | + - [Suggesting Enhancements](#suggesting-enhancements) |
| 13 | + - [Submitting Code](#submitting-code) |
| 14 | +- [License](#license) |
| 15 | + |
| 16 | +## Getting Started |
| 17 | + |
| 18 | +1. **Fork the Repository**: Click the "Fork" button at the top right of the repository page to create your own copy of the project. |
| 19 | + |
| 20 | +2. **Clone Your Fork**: Clone your forked repository to your local machine using: |
| 21 | + ```bash |
| 22 | + git clone https://github.com/<your-username>/sceptre-phenix.git |
| 23 | + ``` |
| 24 | + |
| 25 | +3. **Set Upstream Remote**: Add the original repository as an upstream remote to keep your fork up to date: |
| 26 | + ```bash |
| 27 | + git remote add upstream https://github.com/sandialabs/sceptre-phenix.git |
| 28 | + ``` |
| 29 | + |
| 30 | +4. **(Optional) Update Your Fork with Upstream**: To keep your fork up to date with the original repository, follow these steps: |
| 31 | + * Fetch the latest changes from the upstream repository |
| 32 | + ```bash |
| 33 | + git fetch upstream |
| 34 | + ``` |
| 35 | + * Merge the changes from the upstream main branch into your local main branch |
| 36 | + ```bash |
| 37 | + git checkout main |
| 38 | + git merge upstream/main |
| 39 | + ``` |
| 40 | + * Push the updated main branch to your forked repository |
| 41 | + ```bash |
| 42 | + git push origin main |
| 43 | + ``` |
| 44 | + |
| 45 | +## How to Contribute |
| 46 | + |
| 47 | +### Reporting Issues |
| 48 | + |
| 49 | +If you encounter a bug or have a feature request, please open an issue in the [Issues](https://github.com/sandialabs/sceptre-phenix/issues) section. Be sure to include: |
| 50 | + |
| 51 | +- A clear description of the issue. |
| 52 | +- Steps to reproduce the issue. |
| 53 | +- Any relevant screenshots or logs. |
| 54 | + |
| 55 | +### Suggesting Enhancements |
| 56 | + |
| 57 | +We welcome suggestions for improvements! Please open an issue to discuss your ideas before implementing them. |
| 58 | + |
| 59 | +### Submitting Code |
| 60 | + |
| 61 | +1. **Create a Branch**: Create a new branch (on your fork of the repository) for your feature or bug fix using [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) notation. The branch name should follow this format: |
| 62 | + ```bash |
| 63 | + type/description |
| 64 | + ``` |
| 65 | + Where `type` can be one of the following: |
| 66 | + - `feat`: A new feature |
| 67 | + - `fix`: A bug fix |
| 68 | + - `docs`: Documentation only changes |
| 69 | + - `style`: Changes that do not affect the meaning of the code (white-space, formatting, etc.) |
| 70 | + - `refactor`: A code change that neither fixes a bug nor adds a feature |
| 71 | + - `test`: Adding missing tests or correcting existing tests |
| 72 | + - `chore`: Changes to the build process or auxiliary tools and libraries |
| 73 | + |
| 74 | + Example: |
| 75 | + ```bash |
| 76 | + git checkout -b feat/add-user-authentication |
| 77 | + ``` |
| 78 | + |
| 79 | +2. **Make Your Changes**: Implement your changes. |
| 80 | + |
| 81 | +3. **Stage Your Changes**: Use the `git add` command to stage the changes you want to commit. You can stage specific files or all changes: |
| 82 | + To stage specific files: |
| 83 | + ```bash |
| 84 | + git add path/to/your/file1 path/to/your/file2 |
| 85 | + ``` |
| 86 | + |
| 87 | + To stage all changes: |
| 88 | + ```bash |
| 89 | + git add . |
| 90 | + ``` |
| 91 | + |
| 92 | +3. **Commit Your Changes**: Commit your changes using [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) notation. Your commit message should follow this format: |
| 93 | + ```bash |
| 94 | + type(scope): subject |
| 95 | + ``` |
| 96 | + * **Scope** is optional and can be used to indicate the area of the codebase affected by the change. |
| 97 | + * **Subject** should be a short description of the change. |
| 98 | + |
| 99 | + Example: |
| 100 | + ```bash |
| 101 | + git commit -m "feat(auth): add user authentication feature" |
| 102 | + ``` |
| 103 | + If you need to write a longer commit message, you can do so by running `git commit`. This will open your default text editor where you can write a detailed commit message. The first line should be a brief summary conforming to the format above, followed by a blank line, and then a more detailed explanation. |
| 104 | + |
| 105 | + Example: |
| 106 | + ```bash |
| 107 | + feat(auth): add user authentication feature |
| 108 | +
|
| 109 | + This commit introduces a new authentication system that allows users to log in using their email and password. It also includes validation for user input and error handling. |
| 110 | + ``` |
| 111 | + |
| 112 | + |
| 113 | +4. **Rebase Your Branch**: Before opening a pull request, ensure your branch is up to date with the main branch. |
| 114 | + * Fetch the latest changes from the upstream repository. |
| 115 | + ```bash |
| 116 | + git fetch upstream |
| 117 | + ``` |
| 118 | + * Rebase your branch into the main branch to preserve a linear history. Resolve any conflicts that may arise during the rebase process. |
| 119 | + ```bash |
| 120 | + git rebase upstream/main |
| 121 | + ``` |
| 122 | + * (Optional) If you have multiple commits that you want to combine into a single commit, you can use interactive rebase. |
| 123 | + ```bash |
| 124 | + git rebase -i upstream/main |
| 125 | + ``` |
| 126 | + In the interactive rebase interface, change the word `pick` to `squash` (or `s`) for all commits you want to combine into the first commit. After saving and closing the editor, you will be prompted to create a new commit message. Write a single, comprehensive commit message that summarizes all the changes. |
| 127 | + |
| 128 | +5. **Push to Your Fork**: If you had to rebase, you may need to force push your changes to your forked repository. |
| 129 | + |
| 130 | + Example: |
| 131 | + ```bash |
| 132 | + git push origin feat/add-user-authentication --force |
| 133 | + ``` |
| 134 | + |
| 135 | +6. **Open a Pull Request**: Go to the original repository and open a [pull request](https://github.com/sandialabs/sceptre-phenix/pulls). Provide a clear description of your changes and reference any related issues. |
| 136 | + |
| 137 | +## License |
| 138 | +By contributing to this project, you agree that your contributions will be licensed under the [GNU](https://github.com/sandialabs/sceptre-phenix/blob/main/LICENSE) License. |
| 139 | + |
0 commit comments