generated from layer5io/layer5-repo-template
-
Notifications
You must be signed in to change notification settings - Fork 147
docs: enhance CONTRIBUTING.md and README.md with comprehensive improvements #839
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
Open
Ansita20
wants to merge
2
commits into
layer5io:master
Choose a base branch
from
Ansita20:improvedDOC
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,267 +1,44 @@ | ||
| # <a name="contributing">Contributing Overview</a> | ||
| Please do! Thanks for your help improving the project! :balloon: | ||
|
|
||
| All contributors are welcome. Please see the [newcomers welcome guide](https://layer5.io/community/newcomers) for how, where and why to contribute. This project is community-built and welcomes collaboration. Contributors are expected to adhere to our [Code of Conduct](CODE_OF_CONDUCT.md). | ||
|
|
||
| Not sure where to start? First, see the [newcomers welcome guide](https://layer5.io/community/newcomers). Grab an open issue with the [help-wanted label](../../labels/help%20wanted) and jump in. Join the [Slack account](http://slack.layer5.io) and engage in conversation. Create a [new issue](/../../issues/new/choose) if needed. All [pull requests](/../../pulls) should reference an open [issue](/../../issues). Include keywords in your pull request descriptions, as well as commit messages, to [automatically close issues in GitHub](https://help.github.com/en/github/managing-your-work-on-github/closing-issues-using-keywords). | ||
|
|
||
| **Sections** | ||
| - <a name="contributing">General Contribution Flow</a> | ||
| - <a href="#prerequisites">Prerequisites</a> | ||
| - <a href="#set-up-your-local-development-environment">Set up your Local Development Environment</a> | ||
| - <a href="#commit-signing">Developer Certificate of Origin</a> | ||
|
|
||
| Relevant coding style guidelines are the Go Code Review Comments and the Formatting and style section of Peter Bourgon's Go: Best Practices for Production Environments. | ||
|
|
||
| # <a name="contributing">General Contribution Flow</a> | ||
|
|
||
| In order to contribute to Layer5 docs, please follow the fork-and-pull request workflow described [here](./CONTRIBUTING-gitflow.md). | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| Make sure you have the following prerequisites installed on your operating system before you start contributing: | ||
|
|
||
| - [Nodejs and npm](https://nodejs.org/en/) | ||
|
|
||
| To verify run: | ||
|
|
||
| ``` | ||
| node -v | ||
| ``` | ||
|
|
||
| ``` | ||
| npm -v | ||
| ``` | ||
|
|
||
| - [Go](https://go.dev/doc/install) | ||
|
|
||
| To verify run: | ||
|
|
||
| ``` | ||
| go version | ||
| ``` | ||
|
|
||
| - [Hugo](https://gohugo.io/installation/) | ||
|
|
||
|
|
||
| - Install a recent release of the Hugo "extended" version. If you install from | ||
| the [Hugo release page](https://github.com/gohugoio/hugo/releases), make sure | ||
| you download the `extended` version, which supports SCSS. | ||
|
|
||
| To verify run: | ||
|
|
||
| ``` | ||
| hugo version | ||
| ``` | ||
|
|
||
| - Install `PostCSS` so that the site build can create the final CSS assets. You | ||
| can install it locally by running the following commands from the root | ||
| directory of your project: | ||
|
|
||
| ```sh | ||
| npm install --save-dev autoprefixer | ||
| npm install --save-dev postcss-cli | ||
| ``` | ||
|
|
||
| Starting in | ||
| [version 8 of `postcss-cli`](https://github.com/postcss/postcss-cli/blob/master/CHANGELOG.md), | ||
| you must also separately install `postcss`: | ||
|
|
||
| ```sh | ||
| npm install -D postcss | ||
| ``` | ||
|
|
||
| **Note:** If you're on a _Windows environment_ then it is highly recommended that you install [Windows Subsystem for Linux (WSL)](https://docs.microsoft.com/en-us/windows/wsl/install) both for performance and ease of use. | ||
|
|
||
|
|
||
| ## Set up your Local Development Environment | ||
|
|
||
| Follow the following instructions to start contributing. | ||
|
|
||
| **1.** Fork [this](https://github.com/layer5io/docs) repository. | ||
|
|
||
| **2.** Clone your forked copy of the project. | ||
|
|
||
| ``` | ||
| git clone --depth=1 https://github.com/<your-username>/docs.git | ||
| ``` | ||
|
|
||
| **3.** Navigate to the project directory. | ||
|
|
||
| ``` | ||
| cd docs | ||
| ``` | ||
|
|
||
| **4.** Add a reference(remote) to the original repository. | ||
|
|
||
| ``` | ||
| git remote add upstream https://github.com/layer5io/docs.git | ||
| ``` | ||
|
|
||
| **5.** Check the remotes for this repository. | ||
|
|
||
| ``` | ||
| git remote -v | ||
| ``` | ||
|
|
||
| **6.** Always take a pull from the upstream repository to your master branch to keep it at par with the main project (updated repository). | ||
|
|
||
| ``` | ||
| git pull upstream master | ||
| ``` | ||
|
|
||
| **7.** Create a new branch. | ||
|
|
||
| ``` | ||
| git checkout -b <your_branch_name> | ||
| ``` | ||
|
|
||
| **8.** Install the dependencies for running the site. | ||
|
|
||
| ``` | ||
| make setup | ||
| ``` | ||
|
|
||
| **9.** Make the desired changes. | ||
|
|
||
| **10.** Run the site locally to preview changes. | ||
|
|
||
| ``` | ||
| make site | ||
| ``` | ||
|
|
||
| This will run a local webserver with "live reload" conveniently enabled. ( **NOTE**: while using the make command on Windows, there sometimes arises an error in identifying the command even after it is installed (unrecognized command), this is because the PATH for the binary might not be set correctly ). | ||
|
|
||
| **11.** Track your changes. | ||
|
|
||
| ``` | ||
| git add . | ||
| ``` | ||
|
|
||
| **12.** Commit your changes. To contribute to this project, you must agree to the [Developer Certificate of Origin (DCO)](#signing-off-on-commits) for each commit you make. | ||
|
|
||
| ``` | ||
| git commit --signoff -m "<commit subject>" | ||
| ``` | ||
|
|
||
| or you could go with the shorter format for the same, as shown below. | ||
|
|
||
| ``` | ||
| git commit -s -m "<commit subject>" | ||
| ``` | ||
|
|
||
| **13.** While you are working on your branch, other developers may update the `master` branch with their branch. This action means your branch is now out of date with the `master` branch and missing content. So to fetch the new changes, follow along: | ||
|
|
||
| ``` | ||
| git checkout master | ||
| git fetch origin master | ||
| git merge upstream/master | ||
| git push origin | ||
| ``` | ||
|
|
||
| Now you need to merge the `master` branch into your branch. This can be done in the following way: | ||
|
|
||
| docs: improve CONTRIBUTING.md structure and clarity | ||
| ``` | ||
| git checkout <your_branch_name> | ||
| git merge master | ||
| ``` | ||
|
|
||
| **14.** Push the committed changes in your feature branch to your remote repo. | ||
|
|
||
| ``` | ||
| git push -u origin <your_branch_name> | ||
| ``` | ||
|
|
||
| **15.** Once you’ve committed and pushed all of your changes to GitHub, go to the page for your fork on GitHub, select your development branch, and click the pull request button. Please ensure that you compare your feature branch to the desired branch of the repo you are supposed to make a PR to. If you need to make any adjustments to your pull request, just push the updates to GitHub. Your pull request will automatically track the changes in your development branch and update it. | ||
|
|
||
| ## <a name="commit-signing">Signing-off on Commits (Developer Certificate of Origin)</a> | ||
|
|
||
| To contribute to this project, you must agree to the Developer Certificate of | ||
| Origin (DCO) for each commit you make. The DCO is a simple statement that you, | ||
| as a contributor, have the legal right to make the contribution. | ||
|
|
||
| See the [DCO](https://developercertificate.org) file for the full text of what you must agree to | ||
| and how it works [here](https://github.com/probot/dco#how-it-works). | ||
| To signify that you agree to the DCO for contributions, you simply add a line to each of your | ||
| git commit messages: | ||
|
|
||
| ## Standard Format (Recommended): | ||
| ``` | ||
| Signed-off-by: Jane Smith <[email protected]> | ||
| ``` | ||
| docs: enhance CONTRIBUTING.md with comprehensive guidelines | ||
|
|
||
| In most cases, you can add this signoff to your commit automatically with the | ||
| `-s` or `--signoff` flag to `git commit`. You must use your real name and a reachable email | ||
| address (sorry, no pseudonyms or anonymous contributions). An example of signing off on a commit: | ||
| ``` | ||
| $ commit -s -m “my commit message w/signoff” | ||
| - Add table of contents for better navigation | ||
| - Expand prerequisites section with version requirements | ||
| - Include detailed local development setup instructions | ||
| - Add pull request guidelines and best practices | ||
| - Organize content into logical sections with clear hierarchy | ||
| - Include commit message conventions and style guidelines | ||
| - Add community support and contributor recognition sections | ||
| ``` | ||
|
|
||
| To ensure all your commits are signed, you may choose to add this alias to your global ```.gitconfig```: | ||
|
|
||
| *~/.gitconfig* | ||
| ``` | ||
| [alias] | ||
| amend = commit -s --amend | ||
| cm = commit -s -m | ||
| commit = commit -s | ||
| ## Detailed with Context: | ||
| ``` | ||
| Or you may configure your IDE, for example, Visual Studio Code to automatically sign-off commits for you: | ||
|
|
||
| <a href="https://user-images.githubusercontent.com/7570704/64490167-98906400-d25a-11e9-8b8a-5f465b854d49.png" ><img src="https://user-images.githubusercontent.com/7570704/64490167-98906400-d25a-11e9-8b8a-5f465b854d49.png" width="50%"><a> | ||
| docs: refactor and enhance CONTRIBUTING.md for better contributor experience | ||
|
|
||
| ## <a name="contributing-docs">Documentation Contribution Flow</a> | ||
| Please contribute! Layer5 documentation uses Jekyll and GitHub Pages to host docs sites. Learn more about [Layer5's documentation framework](https://docs.google.com/document/d/17guuaxb0xsfutBCzyj2CT6OZiFnMu9w4PzoILXhRXSo/edit?usp=sharing). The process of contributing follows this flow: | ||
| Improve the contributing documentation to be more professional, | ||
| comprehensive, and user-friendly for both new and experienced contributors. | ||
|
|
||
| 1. Create a fork, if you have not already, by following the steps described [here](./CONTRIBUTING-gitflow.md) | ||
| 1. In the local copy of your fork, navigate to the docs folder. | ||
| `cd docs` | ||
| 1. Create and checkout a new branch to make changes within | ||
| `git checkout -b <my-changes>` | ||
| 1. Edit/add documentation. | ||
| `vi <specific page>.md` | ||
| 1. Run site locally to preview changes. | ||
| `make site` | ||
| 1. Commit, [sign-off](#commit-signing), and push changes to your remote branch. | ||
| `git push origin <my-changes>` | ||
| 1. Open a pull request (in your web browser) against the repo. | ||
| Changes include: | ||
| - Added comprehensive table of contents with anchor links | ||
| - Restructured content into logical, hierarchical sections | ||
| - Enhanced prerequisites section with context and version requirements | ||
| - Added step-by-step local development environment setup | ||
| - Included detailed contribution workflow with git commands | ||
| - Added separate style guidelines for code and documentation | ||
| - Expanded commit message conventions | ||
| - Added "How Can I Contribute?" section with multiple contribution types | ||
| - Included community and support resources | ||
| - Added contributor recognition information | ||
| - Improved formatting and markdown consistency throughout | ||
|
|
||
|
|
||
| #### Tests | ||
| Users can now test their code on their local machine against the CI checks implemented using `make run-tests`. | ||
|
|
||
| To test code changes on your local machine, run the following command: | ||
| This update makes it easier for contributors to understand the | ||
| contribution process and sets clear expectations for code quality | ||
| and community participation. | ||
| ``` | ||
| make run-tests | ||
| ``` | ||
|
|
||
| #### Building Docker image | ||
| To build a Docker image of the project, please ensure you have `Docker` installed to be able to build the image. Now, run the following command to build and serve the files locally.: | ||
|
|
||
| > [!IMPORTANT] | ||
| > This requires Docker Desktop version **4.24** or later, or Docker Engine with Docker | ||
| > Compose version [**2.22**](https://docs.docker.com/compose/file-watch/) or later. | ||
| ```sh | ||
| make docker | ||
| ## Very Concise (if preferred): | ||
| ``` | ||
|
|
||
| ### UI Lint Rules | ||
|
|
||
| Layer5 uses ES-Lint to maintain code quality & consistency in our UI Code. | ||
|
|
||
| # <a name="maintaining"> Reviews</a> | ||
| All contributors are invited to review pull requests. See this short video on [how to review a pull request](https://www.youtube.com/watch?v=isLfo7jfE6g&feature=youtu.be). | ||
|
|
||
| # New to Git? | ||
| Resources: https://lab.github.com and https://try.github.com/ | ||
|
|
||
| ### License | ||
|
|
||
| This repository and site are available as open source under the terms of the [Apache 2.0 License](https://opensource.org/licenses/Apache-2.0). | ||
|
|
||
| ### About Layer5 | ||
|
|
||
| **Community First** | ||
| <p>The <a href="https://layer5.io/community">Layer5 community</a> represents the largest collection of service mesh projects and their maintainers in the world.</p> | ||
|
|
||
| **Open Source First** | ||
| <p>At Layer5, we champion developer-defined infrastructure, giving engineers the power to reshape application delivery. We empower operators in reimagining how they manage modern infrastructure: collaboratively.</p> | ||
| docs: update CONTRIBUTING.md with better structure and guidelines | ||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These aren't the intended changes, but notes from your AI session. Please retry, @Ansita20.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure to sign-off on your commits, too. See the doc that you are conceptually improving for instructions, @Ansita20
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes sir, I will retry.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sir, Sorry for the previous carelessness. I have fixed the mistake I made. Can you please check the changes.