Skip to content
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

Docusaurus Upgrade v3.1.1 #1139

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Conversation

sunilarjun
Copy link
Contributor

@sunilarjun sunilarjun commented Feb 22, 2024

Description

Upgrades the Docusaurus version to 3.1.1. The following actions were performed to facilitate the upgrade:

Your local machine will need to have installed node.js >=18.x.

The docs, i18n/zh, and versioned_docs folders all received markdown fixes against the Docusaurus upgrade from MDX v2 to MDX v3. The new version has stricter linting rules, and the following guide was used to assist with upgrading: https://docusaurus.io/docs/migration/v3.

The package.json file had the core Docusaurus dependencies updated as well as React and Postcss:

"@docusaurus/core": "^3.1.1"
"@docusaurus/plugin-client-redirects": "^3.1.1"
"@docusaurus/preset-classic": "^3.1.1"
"@mdx-js/react": "^3.0.1"
"react": "^18.0.0"
"react-dom": "^18.2.0"
"@docusaurus/module-type-aliases": "^3.1.1"

Additionally, the heap size was increased in the deploy.yml and test-deploy.yml workflow files to fix a JS heap OOM error being seen.

Comments

I think due to the large amount of files changed, reviewers can call out the sections they are reviewing in the comments so as to not double up on sections reviewed.

…for upgrading Docusaurus to 3.1.1

Signed-off-by: Sunil Singh <sunil.singh@suse.com>
Signed-off-by: Sunil Singh <sunil.singh@suse.com>
Signed-off-by: Sunil Singh <sunil.singh@suse.com>
Signed-off-by: Sunil Singh <sunil.singh@suse.com>
@btat btat mentioned this pull request Feb 23, 2024
@sunilarjun sunilarjun marked this pull request as ready for review February 26, 2024 18:58
@martyav
Copy link
Contributor

martyav commented Feb 26, 2024

I'm going to check out the branch and look at a local build of the site. For my initial pas, I'll cover the pages in How-to Guides and Integrations in the English version of latest

Copy link
Contributor

@martyav martyav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was my first pass at it, covering 8 pages in the English version of latest. I'll return for more passes, probably taking on ~10-20 pages at a time

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having some trouble flagging this, but the example on line 158 needs backticks:

You can generate a key/certificate pair using an openssl command. For example:

openssl req -x509 -sha256 -nodes -days 365 -newkey rsa:2048 -keyout myservice.key -out myservice.cert

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 27 needs backticks:

If you do not specify a pre-shared secret, RKE2 will generate one and place it at /var/lib/rancher/rke2/server/node-token.

token: my-shared-secret
server: https://<DNS-DOMAIN>:9345
tls-san:
- my-kubernetes-domain.com
- another-kubernetes-domain.com
```

After that, you need to run the installer and enable, then start, rke2:

curl -sfL https://get.rke2.io | sh -
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line needs triple backticks

    curl -sfL https://get.rke2.io | sh -

@@ -222,15 +222,17 @@ Authorized Cluster Endpoint (ACE) support has been added for registered RKE2 and
```

2. Add the following to the config file (or create one if it doesn’t exist); note that the default location is `/etc/rancher/{rke2,k3s}/config.yaml`:
```yaml
```console
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is console the Docusaurus3 equivalent for yaml?

| `HTTP_PROXY` | http://<PROXY_IP>:8888 |
| `HTTPS_PROXY` | http://<PROXY_IP>:8888
| `HTTP_PROXY` | `http://<PROXY_IP>:8888` |
| `HTTPS_PROXY` | `http://<PROXY_IP>:8888`|
| `NO_PROXY` | 127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,.svc,.cluster.local |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It feels like each of the values listed here should have backticks:

127.0.0.0/8, 10.0.0.0/8, etc

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section (Node Network Packet) has strikethroughs:

image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Node Network I/O also has strikethroughs.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Congrats on fixing these, btw, HTML tables within tables are not easy to read!

token: my-shared-secret
server: https://<DNS-DOMAIN>:9345
tls-san:
- my-kubernetes-domain.com
- another-kubernetes-domain.com
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
```
```

Misaligned with the starting set of backticks.

@@ -99,15 +99,15 @@ title: PromQL 表达式参考

| Catalog | 表达式 |
| --- | --- |
| 详情 | <table><tr><td>receive-dropped</td><td><code>sum(rate(node_network_receive_drop_total{device!~"lo &#124; veth.&ast; &#124; docker.&ast; &#124; flannel.&ast; &#124; cali.&ast; &#124; cbr.&ast;",instance=~"$instance"}[5m])) by (device)</code></td></tr><tr><td>receive-errs</td><td><code>sum(rate(node_network_receive_errs_total{device!~"lo &#124; veth.&ast; &#124; docker.&ast; &#124; flannel.&ast; &#124; cali.&ast; &#124; cbr.&ast;",instance=~"$instance"}[5m])) by (device)</code></td></tr><tr><td>receive-packets</td><td><code>sum(rate(node_network_receive_packets_total{device!~"lo &#124; veth.&ast; &#124; docker.&ast; &#124; flannel.&ast; &#124; cali.&ast; &#124; cbr.&ast;",instance=~"$instance"}[5m])) by (device)</code></td></tr><tr><td>transmit-dropped</td><td><code>sum(rate(node_network_transmit_drop_total{device!~"lo &#124; veth.&ast; &#124; docker.&ast; &#124; flannel.&ast; &#124; cali.&ast; &#124; cbr.&ast;",instance=~"$instance"}[5m])) by (device)</code></td></tr><tr><td>transmit-errs</td><td><code>sum(rate(node_network_transmit_errs_total{device!~"lo &#124; veth.&ast; &#124; docker.&ast; &#124; flannel.&ast; &#124; cali.&ast; &#124; cbr.&ast;",instance=~"$instance"}[5m])) by (device)</code></td></tr><tr><td>transmit-packets</td><td><code>sum(rate(node_network_transmit_packets_total{device!~"lo &#124; veth.&ast; &#124; docker.&ast; &#124; flannel.&ast; &#124; cali.&ast; &#124; cbr.&ast;",instance=~"$instance"}[5m])) by (device)</code></td></tr></table> |
| 摘要 | <table><tr><td>receive-dropped</td><td><code>sum(rate(node_network_receive_drop_total{device!~"lo &#124; veth.&ast; &#124; docker.&ast; &#124; flannel.&ast; &#124; cali.&ast; &#124; cbr.&ast;",instance=~"$instance"}[5m]))</code></td></tr><tr><td>receive-errs</td><td><code>sum(rate(node_network_receive_errs_total{device!~"lo &#124; veth.&ast; &#124; docker.&ast; &#124; flannel.&ast; &#124; cali.&ast; &#124; cbr.&ast;",instance=~"$instance"}[5m]))</code></td></tr><tr><td>receive-packets</td><td><code>sum(rate(node_network_receive_packets_total{device!~"lo &#124; veth.&ast; &#124; docker.&ast; &#124; flannel.&ast; &#124; cali.&ast; &#124; cbr.&ast;",instance=~"$instance"}[5m]))</code></td></tr><tr><td>transmit-dropped</td><td><code>sum(rate(node_network_transmit_drop_total{device!~"lo &#124; veth.&ast; &#124; docker.&ast; &#124; flannel.&ast; &#124; cali.&ast; &#124; cbr.&ast;",instance=~"$instance"}[5m]))</code></td></tr><tr><td>transmit-errs</td><td><code>sum(rate(node_network_transmit_errs_total{device!~"lo &#124; veth.&ast; &#124; docker.&ast; &#124; flannel.&ast; &#124; cali.&ast; &#124; cbr.&ast;",instance=~"$instance"}[5m]))</code></td></tr><tr><td>transmit-packets</td><td><code>sum(rate(node_network_transmit_packets_total{device!~"lo &#124; veth.&ast; &#124; docker.&ast; &#124; flannel.&ast; &#124; cali.&ast; &#124; cbr.&ast;",instance=~"$instance"}[5m]))</code></td></tr></table> |
| 详情 | <table><tr><td>receive-dropped</td><td><code>sum(rate(node_network_receive_drop_total&#123;device!~"lo &#124; veth.&ast; &#124; docker.&ast; &#124; flannel.&ast; &#124; cali.&ast; &#124; cbr.&ast;",instance=~"$instance"&#125;[5m])) by (device)</code></td></tr><tr><td>receive-errs</td><td><code>sum(rate(node_network_receive_errs_total&#123;device!~"lo &#124; veth.&ast; &#124; docker.&ast; &#124; flannel.&ast; &#124; cali.&ast; &#124; cbr.&ast;",instance=~"$instance"&#125;[5m])) by (device)</code></td></tr><tr><td>receive-packets</td><td><code>sum(rate(node_network_receive_packets_total&#123;device!~"lo &#124; veth.&ast; &#124; docker.&ast; &#124; flannel.&ast; &#124; cali.&ast; &#124; cbr.&ast;",instance=~"$instance"&#125;[5m])) by (device)</code></td></tr><tr><td>transmit-dropped</td><td><code>sum(rate(node_network_transmit_drop_total&#123;device!~"lo &#124; veth.&ast; &#124; docker.&ast; &#124; flannel.&ast; &#124; cali.&ast; &#124; cbr.&ast;",instance=~"$instance"&#125;[5m])) by (device)</code></td></tr><tr><td>transmit-errs</td><td><code>sum(rate(node_network_transmit_errs_total&#123;device!~"lo &#124; veth.&ast; &#124; docker.&ast; &#124; flannel.&ast; &#124; cali.&ast; &#124; cbr.&ast;",instance=~"$instance"&#125;[5m])) by (device)</code></td></tr><tr><td>transmit-packets</td><td><code>sum(rate(node_network_transmit_packets_total&#123;device!~"lo &#124; veth.&ast; &#124; docker.&ast; &#124; flannel.&ast; &#124; cali.&ast; &#124; cbr.&ast;",instance=~"$instance"&#125;[5m])) by (device)</code></td></tr></table> |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is tilde an invalid character itself or does it depend on the context around it?

Earlier occurrences of device!~"lo were changed to device!&#126;"lo, but the occurrences in this block aren't changed. Also, there are many occurrences of instance=~ if the character itself is the issue.

This is likely applicable for the English docs as well.

token: my-shared-secret
server: https://<DNS-DOMAIN>:9345
tls-san:
- my-kubernetes-domain.com
- another-kubernetes-domain.com
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
```
```

Copy link
Contributor

@martyav martyav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Covered up to i18n/zh/docusaurus-plugin-content-docs/current/how-to-guides/new-user-guides/authentication-permissions-and-global-configuration/authentication-config/configure-keycloak-saml.md (14 pages)

I noticed a strange problem with how section headers that contain colons are handled. For the purposes of the right-hand TOC and links, everything after the colon is ignored until there's a space and then it's rendered as normal, so things like "1.1.2 Ensure that the API server pod specification file ownership is set to root:root (Automated)" get rendered as "[...] set to root (Automated)". This isn't a huge deal, but it could break bookmarks to the affected sections.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I compared this page with the current page, there was a tiny difference in the right TOC. For some reason, the term "root:root" is only rendering as "root" (nothing after colon) there.

Also, the URLs for those sections differ from the current. "112-ensure-that-the-api-server-pod-specification-file-ownership-is-set-to-rootroot-automated" for current, "112-ensure-that-the-api-server-pod-specification-file-ownership-is-set-to-root-automated" for 3.1.1. This is not hugely important except it could break users' bookmarks.

v3.1.1 ->
image

Current ->
image

@@ -123,7 +123,7 @@ chown root:root /etc/kubernetes/manifests/etcd.yaml

**Remediation:**
Run the below command (based on the file location on your system) on the control plane node.
For example, chmod 644 <path/to/cni/files\>
For example, `chmod 644 <path/to/cni/files\>`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are numerous examples throughout the page similar to this line, and imo either they should all get backticks or none of them should. Same with the other markup added. It's a long page and the current version doesn't include that markup, however since these are all commands to enter verboten, they should have backticks according to our style guide. I'm not sure if it's worth the effort unless you can use regex to find all the commands and apply the proper markup.

Copy link
Contributor

@martyav martyav Feb 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This page has similar issues as noted for the previous one, including how headings with colons are being rendered in a weird way in the sidebar/urls.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And same as the previous 2. I'm not sure if updating this page with coding backticks is worth the amount of time involved. The section links differing from the current is more of a concern, but if we can't figure out why "root:root" is being rendered in a weird way, at least the user will land on the correct page (if not the correct part of the page)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like all of the self-assessment guides have similar minor issues, so I won't repeat myself. Just making a note of it.

@btat
Copy link
Contributor

btat commented Feb 27, 2024

For the self-assessment pages, we'll want to sync with the Security team. They use a script to generate that content, so if it can be fixed at the source that'll be better than us trying to manually catch it a new guide comes out.

@btat
Copy link
Contributor

btat commented Feb 27, 2024

Covered up to i18n/zh/docusaurus-plugin-content-docs/current/how-to-guides/new-user-guides/authentication-permissions-and-global-configuration/authentication-config/configure-keycloak-saml.md (14 pages)

I noticed a strange problem with how section headers that contain colons are handled. For the purposes of the right-hand TOC and links, everything after the colon is ignored until there's a space and then it's rendered as normal, so things like "1.1.2 Ensure that the API server pod specification file ownership is set to root:root (Automated)" get rendered as "[...] set to root (Automated)". This isn't a huge deal, but it could break bookmarks to the affected sections.

The colon issue is likely https://docusaurus.io/docs/next/migration/v3#unintended-usage-of-directives.

token: my-shared-secret
server: https://<DNS-DOMAIN>:9345
tls-san:
- my-kubernetes-domain.com
- another-kubernetes-domain.com
```
运行安装程序,然后启用并启动 RKE2:

curl -sfL https://get.rke2.io | sh -
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should get backticks

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

节点网络数据包 suffers from the strikethrough problem. 节点网络 I/O too

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The command, openssl req -x509 -sha256 -nodes -days 365 -newkey rsa:2048 -keyout myservice.key -out myservice.cert (in an admonition) should get backticks

token: my-shared-secret
server: https://<DNS-DOMAIN>:9345
tls-san:
- my-kubernetes-domain.com
- another-kubernetes-domain.com
```
运行安装程序,然后启用并启动 RKE2:

curl -sfL https://get.rke2.io | sh -
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line should get backticks

| `HTTP_PROXY` | http://<PROXY_IP>:8888 |
| `HTTPS_PROXY` | http://<PROXY_IP>:8888 |
| `HTTP_PROXY` | `http://<PROXY_IP>:8888` |
| `HTTPS_PROXY` | `http://<PROXY_IP>:8888` |
| `NO_PROXY` | 127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,.svc,.cluster.local |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar comment as elsewhere about surrounding these values with backticks

@martyav
Copy link
Contributor

martyav commented Feb 28, 2024

I covered up through i18n/zh/docusaurus-plugin-content-docs/version-2.6/integrations-in-rancher/fleet-gitops-at-scale/use-fleet-behind-a-proxy.md (about 15 files), but since they're the same files (just in Chinese), they have similar issues.

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.

None yet

3 participants