Skip to content

Conversation

vi-nastya
Copy link
Contributor

@vi-nastya vi-nastya commented May 3, 2021

This PR adds setup for versioning javascript api section

Deployed: https://mdr-ci.staging.k6.io/docs/refs/pull/283/merge/javascript-api/

How it works
Currently we only support versioning for Javascript API section of the docs.
Files for the latest version are located in src/data/markdown/docs/02 javascript api and page URLs have no version prefix.

Other versions are located in src/data/markdown/versioned-js-api and URLs for versioned pages contain the version number (e.g. https://k6.io/docs/javascript-api/v0-31/,https://k6.io/docs/javascript-api/v0-31/k6-crypto/createhash-algorithm/)

How to add a new version
Let's say the v0.33 is released and we want to add docs for it and make it the new latest version.

  1. Run npm run archive-version v0.32 (you might need to run chmode +x ./archive-js-api-version.sh first)
    This script will create a new folder inside src/data/markdown/versioned-js-api named v0.32 and copy the content of src/data/markdown/docs/02 javascript api there.
    It would also replace internal links in md files for javascript api section to point to v0.32 pages.
    If any pages had a custom slug set in the frontmatter, the value would also be updated to include version number

  2. Go to src/utils/versioning.js and add v0.32 to SUPPORTED_VERSIONS. Set LATEST_VERSION = v0.33.

  3. Add docs for v0.33 to src/data/markdown/docs/02 javascript api

Screenshot
image

@github-actions
Copy link
Contributor

github-actions bot commented May 3, 2021

There's a version of the docs published here:

https://mdr-ci.staging.k6.io/docs/refs/pull/283/merge

It will be deleted automatically in 30 days.

@vi-nastya vi-nastya changed the title [WIP] Add Javascript API versioning Add Javascript API versioning May 19, 2021
@ppcano
Copy link
Collaborator

ppcano commented May 19, 2021

@vi-nastya Please, can you rebase master and fix the conflicts. Then, I will do the final testing.

I'd like to launch with:

  • latest/0.32 -> available in master branch.
  • v.0.31 -> which is previous to 0b7459c

@vi-nastya
Copy link
Contributor Author

vi-nastya commented May 19, 2021

@ppcano the master is already merged into this branch and the conflicts are resolved. Would you like me to add the correct file versions for v.0.31 and v.0.32?

@ppcano ppcano merged commit c1a4804 into master May 21, 2021
@simskij simskij deleted the javascript-api-versioning branch May 21, 2021 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants