-
Notifications
You must be signed in to change notification settings - Fork 118
Add developer guide to CONTRIBUTING.md #669
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
bd89968
Add developer guide to CONTRIBUTING.md
4e52a9a
Use maintainers
86840f7
Don't use please
c9ac6b7
Rephrase intro to branching and workflow
a9625ba
Replace alice with alice-user-id
b783cc0
Rephrase fork workflow paragraph
c341d7b
Rephrase developer Alice
5e1be47
Capitalize bug in heading
4cb55c4
Fix comment tag section
6fcba52
section -> document
5c9acd8
Rephrase testing intro
5dfdc28
Rephrase pass traffic
03d1fc7
Rephrase examples bullet point
c3ffc18
Make changes to squash and merge bullet point
8c568bc
Use pull request where it makes sense
cb55268
Add section to Alice worklflow about upstream maintenance
2a43bcd
Replace relative links
c13a357
Add semi colon
d9b1326
Add commands
0de5a60
Move PR description to template
f9eca88
Add period
dc676d6
Separate output from input for git remote
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Branching and Workflow | ||
|
||
pleshakov marked this conversation as resolved.
Show resolved
Hide resolved
|
||
NKG is an open source and public repository; our goal is to keep the number of branches in the repository to a minimum: | ||
the main branch, release branches and long-term feature branches. | ||
|
||
Internal developers and external contributors will follow a fork and merge process. Each contributor should fork the | ||
repo to their own space; branch, experiment, develop and prepare a pull request (PR) to merge their work into NKG’s main | ||
branch. This way ephemeral developer branches will remain outside the main repository. | ||
|
||
Below is an example of following the merge and fork process. Developer Alice: | ||
|
||
- Forks `github.com/nginxinc/nginx-kubernetes-gateway` → `github.com/<alice-user-id>/nginx-kubernetes-gateway` | ||
- Adds upstream: | ||
```shell | ||
git remote add upstream git@github.com:nginxinc/nginx-kubernetes-gateway.git | ||
``` | ||
- Alice lists all of her configured remotes: | ||
```shell | ||
git remote -v | ||
kate-osborn marked this conversation as resolved.
Show resolved
Hide resolved
|
||
``` | ||
Which shows the following: | ||
```text | ||
origin git@github.com:<alice-user-id>/nginx-kubernetes-gateway.git (fetch) | ||
origin git@github.com:<alice-user-id>/nginx-kubernetes-gateway.git (push) | ||
upstream git@github.com:nginxinc/nginx-kubernetes-gateway.git (fetch) | ||
upstream git@github.com:nginxinc/nginx-kubernetes-gateway.git (push) | ||
``` | ||
- Alice develops a feature or bugfix - using as many ephemeral branches as she needs. | ||
- Alice creates a | ||
PR `github.com/<alice-user-id>/nginx-kubernetes-gateway:feature/some-feature` → `github.com/nginxinc/nginx-kubernetes-gateway:main` | ||
sjberman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- Alice keeps her fork up to date by running: | ||
```shell | ||
git pull upstream main | ||
``` | ||
This will sync her local main branch with the main branch of the project's repo. | ||
|
||
## Branch Naming Conventions | ||
|
||
To maintain consistency and facilitate proper labeling of pull requests (PRs), we follow specific branch naming | ||
conventions. Each branch should contain a prefix that accurately describes the purpose of the PR. The prefixes align | ||
with the labels defined in the [labeler](/.github/labeler.yml) file, which are used to create release notes. | ||
|
||
For example, if you are working on a bug fix, name your branch starting with `bug/` or `fix/`, followed by a descriptive | ||
name of the bug you are fixing. | ||
|
||
To ensure correct labeling of your PRs, please use the appropriate prefix from the predefined list when naming your | ||
branches. This practice helps maintain consistent labeling and allows for the automated generation of accurate release | ||
notes. | ||
|
||
For a comprehensive list of labels and prefixes, please refer to the [labeler](/.github/labeler.yml) file. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# Implementing a Feature | ||
|
||
This document provides guidance on implementing new features in the project. Follow the recommended steps and best | ||
practices to ensure a successful feature development process. | ||
|
||
> **Note** | ||
> | ||
> If you’d like to implement a new feature, please open a discussion about the feature before creating an issue or opening a PR. | ||
|
||
1. **Assign yourself to the GitHub issue for the feature**: Each feature must have a corresponding GitHub issue to track | ||
its progress. | ||
2. **Post any questions or comments about the feature on the corresponding issue**: This allows for better tracking and | ||
visibility. If any discussions regarding the issue occur outside the issue thread, provide a summary of the | ||
conversation as a comment on the issue itself. This ensures that all relevant information and discussions are | ||
consolidated in one place for easy reference. | ||
3. **Fork the repo**: NKG follows a fork workflow, which you can learn more about in | ||
the [branching and workflow](/docs/developer/branching-and-workflow.md) documentation. | ||
4. **Branch**: Create a branch following | ||
the [naming conventions](/docs/developer/branching-and-workflow.md#branch-naming-conventions). | ||
5. **Make changes**: Make the necessary changes for the feature. | ||
6. **Consider opening a draft PR**: If your feature involves substantial architecture changes, or you would like to | ||
receive early feedback, consider opening a draft PR and requesting reviews from the maintainers. Draft PRs are an | ||
effective means to solicit feedback and ensure that major architectural changes align with the project's goals and | ||
standards. | ||
7. **Add or update unit tests** All features **must** be accompanied by unit tests that verify the functionality. Make | ||
sure to thoroughly test the different scenarios and edge cases related to the feature to ensure robustness and | ||
reliability. Additionally, open the code coverage report to ensure that the code you added has sufficient test | ||
coverage. For instructions on writing and running unit tests, refer to | ||
the [testing](/docs/developer/testing.md#unit-test-guidelines) documentation. | ||
8. **Manually verify your changes**: Refer to the [manual testing](/docs/developer/testing.md#manual-testing) section of | ||
the testing documentation for instructions on how to manually test your changes. | ||
9. **Update any relevant documentation**: Here are some guidelines for updating documentation: | ||
- **Gateway API Feature**: If you are implementing a Gateway API feature, make sure to update | ||
the [Gateway API Compatibility](/docs/gateway-api-compatibility.md) documentation. | ||
- **New Use Case:** If your feature introduces a new use case, add an example of how to use it in | ||
the [examples](/examples) directory. This example will help users understand how to leverage the new feature. | ||
- **Installation Changes**: If your feature involves changes to the installation process of NKG, update | ||
the [installation](/docs/installation.md) documentation. | ||
- **Command-line Changes**: If your feature introduces or changes a command-line flag or subcommand, update | ||
the [cli help](/docs/cli-help.md) documentation. | ||
- **Other Documentation Updates**: For any other changes that affect the behavior, usage, or configuration of NKG, | ||
review the existing documentation and update it as necessary. Ensure that the documentation remains accurate and | ||
up to date with the latest changes. | ||
10. **Lint code**: See the [run the linter](/docs/developer/quickstart.md#run-the-linter) section of the quickstart | ||
guide for instructions. | ||
11. **Open pull request**: Open a pull request targeting the `main` branch of | ||
the [nginx-kubernetes-gateway](https://github.com/nginxinc/nginx-kubernetes-gateway/tree/main) repository. The | ||
entire `nginx-kubernetes-gateway` group will be automatically requested for review. If you have a specific or | ||
different reviewer in mind, you can request them as well. Refer to | ||
the [pull request](/docs/developer/pull-request.md) documentation for expectations and guidelines. | ||
12. **Obtain the necessary approvals**: Work with code reviewers to maintain the required number of approvals. | ||
13. **Squash and merge**: Squash your commits locally, or use the GitHub UI to squash and merge. Only one commit per | ||
pull request should be merged. Make sure the first line of the final commit message includes the pull request | ||
number. For example, Fix supported gateway conditions in compatibility doc (#674). | ||
> **Note**: | ||
When you squash commits, make sure to not include any commit messages related to the code review | ||
(for example, Fixed a typo). If you changed the code as a result of the code review in way that the original commit message no longer describes it well, make sure to update the message. | ||
|
||
|
||
|
||
## Fixing a Bug | ||
|
||
When fixing a bug, follow the same process as [implementing a feature](#implementing-a-feature) with one additional | ||
requirement: | ||
|
||
All bug fixes should be reproduced with a unit test before submitting any code. Once the bug is reproduced in a unit | ||
test, make the necessary code changes to address the issue and ensure that the unit test passes successfully. This | ||
systematic approach helps ensure that the bug is properly understood, effectively resolved, and prevents regression. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.