To contribute new or improve existing documentation content, submit a pull request (PR):
The following figure illustrates how to contribute new documentation.
flowchart LR subgraph first[How to contribute] direction TB T[ ] -.- B[Fork the repo in GitHub] --- C[Write docs in markdown<br>and build site with Hugo] C --- D[Push source to the fork] D --- E[Open a pull request] E --- F[Sign the CNCF CLA] end classDef grey fill:#dddddd,stroke:#ffffff,stroke-width:px,color:#000000, font-size:15px; classDef white fill:#ffffff,stroke:#000,stroke-width:px,color:#000,font-weight:bold classDef spacewhite fill:#ffffff,stroke:#fff,stroke-width:0px,color:#000 class A,B,C,D,E,F,G,H grey class S,T spacewhite class first,second white
Figure 1. Contributing new content.
If you’re less experienced with Git workflows, here’s an easier method of creating and submitting a pull request. Figure 2 outlines the steps and the details follow.
flowchart LR A([fa:fa-user New<br>Contributor]) --- id1[(open-telemetry/opentelemetry.io<br>GitHub)] subgraph tasks[Changes using GitHub] direction TB 0[ ] -.- 1[1. Edit this page] --> 2[2. Use GitHub markdown<br>editor to make changes] 2 --> 3[3. fill in Propose file change] end subgraph tasks2[ ] direction TB 4[4. select Propose file change] --> 5[5. select Create pull request] --> 6[6. fill in Open a pull request] 6 --> 7[7. select Create pull request] end id1 --> tasks --> tasks2 classDef grey fill:#dddddd,stroke:#ffffff,stroke-width:px,color:#000000, font-size:15px; classDef white fill:#ffffff,stroke:#000,stroke-width:px,color:#000,font-weight:bold classDef k8s fill:#326ce5,stroke:#fff,stroke-width:1px,color:#fff; classDef spacewhite fill:#ffffff,stroke:#fff,stroke-width:0px,color:#000 class A,1,2,3,4,5,6,7 grey class 0 spacewhite class tasks,tasks2 white class id1 k8s
Figure 2. Steps for opening a PR using GitHub.
On the page where you see the issue, select the Edit this page option in the right-hand side navigation panel.
If you’re not a member of the project, GitHub offers to create a fork of the repository. Select Fork this repository.
Make your changes in the GitHub editor.
Fill in the Propose file change form.
Select Propose file change.
Select Create pull request.
The Open a pull request screen appears. Your description helps reviewers understand your change.
Select Create pull request.
Before merging a pull request, OpenTelemetry community members review and approve it.
If a reviewer asks you to make changes:
When your review is complete, a reviewer merges your PR and your changes goes live a few minutes later.
/fix:format
on your pull request to trigger an automated check for
formatting issues.If you’re more experienced with Git, or if your changes are larger than a few lines, work from a local fork.
Make sure you have git installed on your computer. You can also use a user interface for Git.
Figure 3 shows the steps to follow when you work from a local fork. The details for each step follow.
flowchart LR 1[Fork the open-telemetry/opentelemetry<br>repository] --> 2[Create local clone<br>and set upstream] subgraph changes[Your changes] direction TB S[ ] -.- 3[Create a branch<br>example: my_new_branch] --> 3a[Make changes using<br>a text editor] --> 4["Preview your changes<br>locally using Hugo<br>(localhost:1313)"] end subgraph changes2[Commit / Push] direction TB T[ ] -.- 5[Commit your changes] --> 6[Push commit to<br>origin/my_new_branch] end 2 --> changes --> changes2 classDef grey fill:#dddddd,stroke:#ffffff,stroke-width:px,color:#000000, font-size:15px; classDef white fill:#ffffff,stroke:#000,stroke-width:px,color:#000,font-weight:bold classDef k8s fill:#326ce5,stroke:#fff,stroke-width:1px,color:#fff; classDef spacewhite fill:#ffffff,stroke:#fff,stroke-width:0px,color:#000 class 1,2,3,3a,4,5,6 grey class S,T spacewhite class changes,changes2 white
Figure 3. Working from a local fork to make your changes.
opentelemetry.io
repository.In a terminal window, clone your fork and install the requirements:
git clone git@github.com:<your_github_username>/opentelemetry.io.git
cd opentelemetry.io
npm install
Set the open-telemetry/opentelemetry.io
repository as the upstream
remote:
git remote add upstream https://github.com/open-telemetry/opentelemetry.io.git
Confirm your origin
and upstream
repositories:
git remote -v
Output is similar to:
origin git@github.com:<your_github_username>/opentelemetry.io.git (fetch)
origin git@github.com:<your_github_username>/opentelemetry.io.git (push)
upstream https://github.com/open-telemetry/opentelemetry.io.git (fetch)
upstream https://github.com/open-telemetry/opentelemetry.io.git (push)
Fetch commits from your fork’s origin/main
and
open-telemetry/opentelemetry.io
’s upstream/main
:
git fetch origin
git fetch upstream
This makes sure your local repository is up to date before you start making changes. Push changes from upstream to origin regularly to keep your fork in sync with upstream.
Create a new branch. This example assumes the base branch is upstream/main
:
git checkout -b <my_new_branch> upstream/main
Make your changes using a code or text editor.
At any time, use the git status
command to see what files you’ve changed.
When you are ready to submit a pull request, commit your changes.
In your local repository, check which files you need to commit:
git status
Output is similar to:
On branch <my_new_branch>
Your branch is up to date with 'origin/<my_new_branch>'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: content/en/docs/file-you-are-editing.md
no changes added to commit (use "git add" and/or "git commit -a")
Add the files listed under Changes not staged for commit to the commit:
git add <your_file_name>
Repeat this for each file.
After adding all the files, create a commit:
git commit -m "Your commit message"
Push your local branch and its new commit to your remote fork:
git push origin <my_new_branch>
Once the changes are pushed, GitHub lets you know that you can create a PR.
Figure 4 shows the steps to open a PR from your fork to opentelemetry.io.
flowchart LR subgraph first[ ] direction TB 1[1. Go to opentelemetry.io repository] --> 2[2. Select New Pull Request] 2 --> 3[3. Select compare across forks] 3 --> 4[4. Select your fork from<br>head repository drop-down menu] end subgraph second [ ] direction TB 5[5. Select your branch from<br>the compare drop-down menu] --> 6[6. Select Create Pull Request] 6 --> 7[7. Add a description<br>to your PR] 7 --> 8[8. Select Create pull request] end first --> second classDef grey fill:#dddddd,stroke:#ffffff,stroke-width:px,color:#000000, font-size:15px; classDef white fill:#ffffff,stroke:#000,stroke-width:px,color:#000,font-weight:bold class 1,2,3,4,5,6,7,8 grey class first,second white
Figure 4. Steps to open a PR from your fork to opentelemetry.io.
In a web browser, go to the
opentelemetry.io
repository.
Select New Pull Request.
Select compare across forks.
From the head repository drop-down menu, select your fork.
From the compare drop-down menu, select your branch.
Select Create Pull Request.
Add a description for your pull request:
Title (50 characters or less): Summarize the intent of the change.
Description: Describe the change in more detail.
Fixes #12345
or
Closes #12345
in the description so that GitHub’s automation closes the
mentioned issue after merging the PR. If there are other related PRs,
link those as well.Select the Create pull request button.
Your pull request is available in Pull requests.
After opening a PR, GitHub runs automated tests and tries to deploy a preview using Netlify.
Other checks might also fail. See the list of all PR checks.
Before submitting a change to the repository, run the following command and (i) address any reported issues, (ii) commit any files changed by the script:
npm run test-and-fix
To separately test and fix all issues with your files, run:
npm run test # Checks but does not update any files
npm run fix:all # May update files
To list available NPM scripts, run npm run
. See PR checks for
more information on pull request checks and how to fix errors automatically.
Preview your changes locally before pushing them or opening a pull request. A preview lets you catch build errors or markdown formatting problems.
To build and serve the site locally with Hugo, run the following command:
npm run serve
Navigate to http://localhost:1313
in your web browser to see the local
preview. Hugo watches for changes and rebuilds the site as needed.
To stop the local Hugo instance, go back to the terminal and type Ctrl+C
, or
close the terminal window.
If you submit a PR, Netlify creates a deploy preview so that you can review your changes. Once your PR is merged, Netlify deploys the updated site to the production server.
Note: PR previews include draft pages, but production builds do not.
To see deploy logs and more, visit the project’s dashboard – Netlify login required.
Before a PR gets merged, it sometimes requires a few iterations of review-and-edit. To help us and yourself make this process as easy as possible, we ask that you adhere to the following:
main
branch of your fork, but create a PR-specific
branch.Sometimes reviewers commit to your pull request. Before making any other changes, fetch those commits.
Fetch commits from your remote fork and rebase your working branch:
git fetch origin
git rebase origin/<your-branch-name>
After rebasing, force-push new changes to your fork:
git push --force-with-lease origin <your-branch-name>
You can also solve merge conflicts from the GitHub UI.
If another contributor commits changes to the same file in another PR, it can create a merge conflict. You must resolve all merge conflicts in your PR.
Update your fork and rebase your local branch:
git fetch origin
git rebase origin/<your-branch-name>
Then force-push the changes to your fork:
git push --force-with-lease origin <your-branch-name>
Fetch changes from open-telemetry/opentelemetry.io
’s upstream/main
and
rebase your branch:
git fetch upstream
git rebase upstream/main
Inspect the results of the rebase:
git status
This results in a number of files marked as conflicted.
Open each conflicted file and look for the conflict markers: >>>
, <<<
,
and ===
. Resolve the conflict and delete the conflict marker.
For more information, see How conflicts are presented.
Add the files to the changeset:
git add <filename>
Continue the rebase:
git rebase --continue
Repeat steps 2 to 5 as needed.
After applying all commits, the git status
command shows that the rebase is
complete.
Force-push the branch to your fork:
git push --force-with-lease origin <your-branch-name>
The pull request no longer shows any conflicts.
Pull requests are merged when they comply with the following criteria:
Important
Do not worry too much about failing PR checks. Community members will help you to get them fixed, by either providing you with instructions how to fix them or by fixing them on your behalf.
[i18n] feedback_question
Thank you. Your feedback is appreciated!
Please let us know how we can improve this page. Your feedback is appreciated!