Skip to content

Commit ce67136

Browse files
chore: Update repo README and CONTRIBUTING section (#1439)
* Update README.md * Update CONTRIBUTING section Add more details about where to make changes, apply-patch script, and creating a new release * Update pull_request_template.md * Fix typo
1 parent 48aa20c commit ce67136

File tree

3 files changed

+79
-9
lines changed

3 files changed

+79
-9
lines changed

.github/pull_request_template.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ Please fill in this template:
1818
Select one of these and delete the others:
1919

2020
If updating the documentation for the most recent release of k6:
21-
- [ ] I have made my changes in the `docs/sources/v{most_recent_release}` folder of the documentation.
22-
- [ ] I have reflected my changes in the `docs/sources/next` folder of the documentation.
21+
- [ ] I have made my changes in the `docs/sources/next` folder of the documentation.
22+
- [ ] I have reflected my changes in the `docs/sources/v{most_recent_release}` folder of the documentation.
2323
- [ ] I have reflected my changes in the relevant (*e.g.* when correcting a documentation error) folders of the previous k6 versions of the documentation.
24+
<!-- You can use the scripts/apply-patch scripts to help you port changes from one version folder to another. For more details, refer to [Use the `apply-patch` script](../CONTRIBUTING/README.md#use-the-apply-patch-script). -->
2425

2526
If updating the documentation for the next release of k6:
2627
- [ ] I have made my changes in the `docs/sources/next` folder of the documentation.

CONTRIBUTING/README.md

Lines changed: 71 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@ When you contribute to the docs, it helps to know how things work.
1010
- [Before you begin](#before-you-begin)
1111
- [Build and preview](#build-and-preview)
1212
- [Write](#write)
13+
- [Where to make updates](#where-to-make-updates)
14+
- [Updates and fixes to the latest version of k6](#updates-and-fixes-to-the-latest-version-of-k6)
15+
- [Updates and fixes to the next major release of k6](#updates-and-fixes-to-the-next-major-release-of-k6)
16+
- [Use the `apply-patch` script](#use-the-apply-patch-script)
1317
- [Style Guides](#style-guides)
1418
- [Shortcodes](#shortcodes)
1519
- [Deploy](#deploy)
16-
- [Upgrade a main release](#upgrade-a-main-release)
20+
- [Create a new release](#create-a-new-release)
1721

1822
<!-- markdown-toc end -->
1923

@@ -23,6 +27,7 @@ For writers, these are the most important directories:
2327

2428
- [`docs/sources`](../docs/sources) is where the docs live.
2529
- `docs/sources/VERSION/shared` has Markdown files that can be reused across multiple pages by using the [`shared` shortcode](https://grafana.com/docs/writers-toolkit/write/shortcodes/#docsshared).
30+
- `src/data/markdown` contains the Markdown files for the legacy version of the docs, available at https://k6.io/docs. **You do not need to update these files if you're making changes to the current or next version of the docs, available at https://grafana.com/docs/k6/latest/**.
2631

2732
## Build locally
2833

@@ -72,6 +77,55 @@ description: <summary text for search engines and social shares. Aim for 170 cha
7277
---
7378
```
7479

80+
You can find the Markdown file for the docs in the [`docs/sources`](../docs/sources) folder. In that folder you'll find:
81+
82+
- A `next` folder, which represents the docs for the next major release of k6.
83+
- Multiple version folders (for example, v0.47.x), which represents the docs for that specific version of k6.
84+
85+
Depending on the type of update you need to make, you'll want to make updates to different folders.
86+
87+
### Where to make updates
88+
89+
#### Updates and fixes to the latest version of k6
90+
91+
If you're making any updates or fixes that apply to the latest version of k6, you'll need to:
92+
93+
- Update the Markdown files in the `docs/sources/next` folder.
94+
- Update the Markdown files in the `docs/sources/v{LATEST_VERSION}` folder.
95+
- You can do this manually or by using the [`apply-patch`](../scripts/apply-patch) script from the `scripts` folder. Refer to the [Use the `apply-patch` script](#use-the-apply-patch-script) section for more details.
96+
97+
This is to make sure that any changes you make are also brought over to the next major release version of k6.
98+
99+
#### Updates and fixes to the next major release of k6
100+
101+
If you're making any updates or fixes that only apply to the next major release of k6, you'll need to:
102+
103+
- Update the Markdown files in the `docs/sources/next` folder.
104+
105+
Once you make any changes and open a PR, and that PR is reviewed, you can merge it without having to worry about those changes showing up in the `latest` version of the docs. The `latest` version will always display the highest numbered version folder of the docs.
106+
107+
### Use the `apply-patch` script
108+
109+
You can use the `apply-patch script` to port changes from one version folder to another. This is especially helpful if you're making updates or fixes to the latest version of k6, and want to make sure they're also reflected in the `next` version folder.
110+
111+
To use the script, make sure you're in the root of the k6-docs folder and run:
112+
113+
```bash
114+
scripts/apply-patch <COMMIT> <SOURCE> <DESTINATION>
115+
```
116+
117+
For example, if you'd like to apply the changes from your last commit, from the `docs/sources/next` folder to the `docs/sources/v0.47.x`, you can run:
118+
119+
```bash
120+
scripts/apply-patch HEAD~ docs/sources/next docs/sources/v0.47.x
121+
```
122+
123+
Or if you'd like to apply the changes from your previous three commits, you can run:
124+
125+
```bash
126+
scripts/apply-patch HEAD~3 docs/sources/next docs/sources/v0.47.x
127+
```
128+
75129
### Style guides
76130

77131
- k6 follows the style prescribed in the [Grafana Writers' Toolkit](https://grafana.com/docs/writers-toolkit/), which itself inherits most of its rules from the [Google developer documentation style guide](https://developers.google.com/style).
@@ -86,10 +140,22 @@ Refer to [Writers' Toolkit, Write documentation](https://grafana.com/docs/writer
86140

87141
Once a PR is merged to the main branch, if there are any changes made to the `docs/sources` folder, the GitHub Action [`publish-technical-documentation.yml`](https://github.com/grafana/k6-docs/blob/main/.github/workflows/publish-technical-documentation.yml) will sync the changes with the grafana/website repository, and the changes will be deployed to production soon after.
88142

89-
### Upgrade a main release
143+
## Create a new release
90144

91-
> #### ⚠️ Versions
145+
> ### ⚠️ Versions
92146
>
93-
> Versions follow the same major and minor numbers as github.com/grafana/k6.
147+
> Versions follow the same major numbers as github.com/grafana/k6.
148+
149+
When a new major version of k6 is released, you need to create a new folder for it in the [`docs/sources`](../docs/sources) folder.
150+
151+
The process for creating a new release should be:
152+
153+
- Review any open PRs that relate to the next major release, and merge them if they have been reviewed and approved.
154+
- `git pull` the latest version of the k6-docs repository.
155+
- In the `docs/sources` folder:
156+
- Duplicate the `next` folder.
157+
- Rename the `next copy` folder to match the next major release version. For example, if the next release is `v0.48`, the folder should be renamed to `v0.48.x`.
158+
- Build the docs locally to check that the latest version matches the new version folder.
159+
- Commit and push your changes.
94160

95-
TODO: Add step-by-step instructions for creating a new major version release.
161+
Once your changes are automatically deployed, you should be able to see the new version live by going to https://grafana.com/docs/k6/latest/.

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Some key facts:
1212
- The docs are written in Markdown and built with Hugo.
1313
- The [Contributor's guide](./CONTRIBUTING) has meta-documentation about building locally, using special components and styling, deploying, troubleshooting, and more.
1414
- We have a [Code of conduct](https://github.com/grafana/k6-docs/blob/main/CODE_OF_CONDUCT.md).
15+
- We follow the Grafana Style Guide, and you can find more information about it in the [Writers' Toolkit](https://grafana.com/docs/writers-toolkit/).
1516

1617
## Contributing
1718

@@ -24,13 +25,15 @@ Markdown files for the documentation are located in the [`docs/sources/`](docs/s
2425

2526
For small changes and spelling fixes, the GitHub UI is the most convenient way to contribute.
2627
For larger contributions, consider running the project locally to see how the changes look like before making a pull request.
27-
28+
2829
The following docs cover the different stages of the writing workflow:
2930

3031
- [Local development](#local-development). For any large changes, being able to see a preview of the site can help make sure things are rendered correctly, and spot any issues before they're deployed to production.
3132
- [Writers' Toolkit](https://grafana.com/docs/writers-toolkit/). Learn more about the Grafana writing style guide, front matter properties, how to upload and add images, and much more.
3233
- [Preview and deploy](./CONTRIBUTING#deploy). Changes made to the files inside of `docs/sources` are automatically deployed to production once they're merged to the main branch.
3334

35+
For more details, refer to the [CONTRIBUTING](./CONTRIBUTING/README.md) section.
36+
3437
## Local development
3538

3639
### Before you begin
@@ -64,4 +67,4 @@ View documentation locally:
6467
Press Ctrl+C to stop the server
6568
```
6669

67-
Go to http://localhost:3002/docs/k6/, and you should be able to see a preview of the docs.
70+
Go to http://localhost:3002/docs/k6/, and you should be able to see a preview of the docs.

0 commit comments

Comments
 (0)