(This guide only appears on GitHub, not the website, because it intentionally does not include YAML front-matter.)

First off, thanks for taking the time to contribute!

The following are guidelines for contributing to the Knative documentation. These are just guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request.

Your first contribution

Code of conduct

Knative follows the Knative Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to knative-code-of-conduct@googlegroups.com.

Contributor license agreements

Knative requires the Google CLA. Important: You must fill out the CLA with the same email address that you used to create your GitHub account.

Once you are CLA’ed, we’ll be able to accept your pull requests. This is necessary because you own the copyright to your changes, even after your contribution becomes part of this project. So this agreement simply gives us permission to use and redistribute your contributions as part of the project.

Note: Your contributions are verified using the email address for which you use to sign the CLA. Therefore, setting your GitHub account to private is unsupported because all commits from private accounts are sent from the noreply email address.

Fixing Issues (Pull Requests)

Here’s what generally happens when you open a PR against the knative/docs repo:

  1. One of the assigned repo maintainers will triage the PR by assigning relative priority, adding appropriate labels, and performing an initial documentation review.

  2. If the PR involves significant technical changes, for example new features, or new and changed sample code, the PR is assigned to a Subject Matter Expert (SME), typically an engineer working on Knative, for technical review and approval.

  3. When both the technical writers and SMEs are satisfied with the quality of the writing and the technical accuracy of the content, the PR can be merged. A PR requires two labels before it can merge: lgtm and approved.

    • The SME is responsible for reviewing the technical accuracy and adding the lgtm label.

    • The Knative technical writers are who provide the approved label when the content meets quality, clarity, and organization standards (see Style Guide).

We appreciate contributions to the docs, so if you open a PR we will help you get it merged. You can also post in the #docs Slack channel to get input on your ideas or find areas to contribute before creating a PR.

Reporting Issues

Knative uses Github issues to track documentation issues and requests. If you see a problem with the documentation that you’re not sure how to fix, submit an issue using the following steps:

  1. Check the Knative docs issues list before creating an issue to avoid making a duplicate.

  2. Use the correct template for your new issue. There are two templates available:

    • Bug report: If you’re reporting an error in the existing documentation, use this template. This could be anything from broken samples to typos. When you create a bug report, include as many details as possible and include suggested fixes to the issue. If you know which Knative component your bug is related to, you can assign the appropriate Working Group Lead.

    • Feature request: For upcoming changes to the documentation or requests for more information on a particular subject.

Note that code issues should be filed against the individual Knative repositories, while documentation issues should go in the knative/docs repo. If the issue is specific to the https://knative.dev website, open the issue in the knative/website repo.

Getting involved

There are a couple of different ways to get started with contributing to the Knative documentation:

Working group meetings

The Knative Documentation Working Group meeting info and times. Click here

The Working Group meetings are used to discuss documentation strategy and policy; we expect individual PR review to happen mostly asynchronously via GitHub, and Slack.

Workflow

There are roughly two workflows: writing / contributing new content, and refining and reviewing existing content.

New Content

We expect most new content to be written by the subject matter expert (SME) which would be the contributor who actually worked on the feature or example.

When writing new content, keep the following in mind:

The goal of adding new content is to get technically correct documentation into the repo before it is lost. Tech Writers may provide some quick guidance on getting documentation into the correct location, but won’t be providing a detailed list of items to change.

Refining and Reviewing Content

Once the raw documentation has made it into the repo, tech writers and other communications experts will review and revise the documentation to make it easier to consume. This will be done as a second PR; it’s often easier for the tech writers to clean up or rewrite a section of prose than to teach an engineer what to do, and most engineers trust the wordsmithing the tech writers produce more than their own.

When revising the content, the tech writer will create a new PR and send it to the original author to ensure that the content is technically correct; they may also ask a few clarifying questions, or add details such as diagrams or notes if needed. It’s not necessarily expected that tech writers will actually execute the steps of a tutorial — it’s expected that the SME is responsible for a working tutorial or how-to.

Tech Writer Guide

Type of documentation

Keep in mind the audience (Developers or Administrators) and type of document when organizing and reviewing documentation. See https://documentation.divio.com/ for a more in-depth discussion of documentation types.

Documentation Structure

TODO: link to intended documentation layout. A general warning about Conway’s Law: documents will naturally tend to be distributed by team that produced them. Try to fight this, and organize documents based on where the reader will look for them. (i.e. all tutorials together, maybe with indications as to which components they use, rather than putting all serving tutorials in one place)

Note that some reference documentation may be automatically generated and checked in to the docs repo. This should be indicated by both a README.md in the top-level directory where the generation happens, and by a header at the top of the documentation. The README.md should include documentation on the original source material for the documentation as well as the commands needed to regenerate the documentation. If possible, the generation of documentation the should be performed automatically via nightly (GitHub actions) automation.

In some cases, the right place for a document may not be on the docs website — a blog post, documentation within a code repo, or a vendor site may be the right place. Be generous with offering to link to such locations; documents in the main documentation come with an ongoing cost of keeping up to date.

Branches

Knative attempts to support the last 4 releases. By default, new documentation should be written on the master branch and then cherry-picked to the release branches if needed. Note that the default view of https://knative.dev/ is of the most recent release branch, which means that changes to master don’t show up unless explicitly cherrypicked. This also means that documentation changes for a release should be made during the development cycle, rather than at the last minute or after the release.

The /cherrypick tool can be use to automatically pull back changes from master to previous releases if necessary.

Tools and Style

Knative documentation follows the Google Developer Documentation Style Guide. Use this as a reference for writing style questions.

Knative uses several sets of tools to manage pull requests (PR)s and issues in a more fine-grained way than GitHub permissions allow. In particular, you’ll regularly interact with Prow to categorize and manage issues and PRs. Prow allows control of specific GitHub functionality without granting full “write” access to the repo (which would allow rewriting history and other dangerous operations). You’ll most often use the following commands, but Prow will also chime in on most bugs and PRs with a link to all the known commands:

Engineer Guide

Putting your docs in the right place

There are currently two general types of Knative docs, either contributor related content, or external-facing user content.

Contributor-focused content

User-focused content

While a sample might be out of date, it could still provide assistance and help you get up-and-running with certain use-cases. If you find that something is not right or contains outdated info, open an Issue. The sample might be fixed if bandwidth or available resource exists, or the sample might be taken down and archived into the last release branch where it worked.