kubevirt / user-guide

This user guide will walk you through installation and various features.
https://kubevirt.io/user-guide
Apache License 2.0
64 stars 233 forks source link

netlify: break huge string #767

Closed victortoso closed 8 months ago

victortoso commented 8 months ago

What this PR does / why we need it: I was looking at the CI failure at https://github.com/kubevirt/user-guide/pull/751 and it complains about escaping, error is:

>   command = "source /opt/buildhome/python3.8/bin/activate; pip3 install mkdocs mkdocs-awesome-pages-plugin mkdocs-material; sed -i "s/site_url: https:\/\/kubevirt.io\/docs/site_url: https:\/\/kubevirt.io\//" /opt/build/repo/mkdocs.yml; sed -i "s/docs_dir: docs/docs_dir:/" /opt/build/repo/mkdocs.yml; echo "*** BEGIN /opt/build/repo/mkdocs.yml ***"; cat /opt/build/repo/mkdocs.yml; echo "*** END /opt/build/repo/mkdocs.yml ***"; mkdocs build -f /opt/build/repo/mkdocs.yml -d /opt/build/repo/site"
                                                                                                                                                          ^

Not easy to see the issue with a huge command line. This PR tries to break it down and fix the issue if any.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged): Fixes #

Special notes for your reviewer:

Checklist

This checklist is not enforcing, but it's a reminder of items that could be relevant to every PR. Approvers are expected to review this list.

Release note:

victortoso commented 8 months ago

Okay, now the logs are like:

Unknown escape character: 47 at row 6, col 28, pos 184:
5: pip3 install mkdocs mkdocs-awesome-pages-plugin mkdocs-material;
6> sed -i "s/site_url: https:\/\/kubevirt.io\/docs/site_url: https:\/\/kubevirt.io\//" /opt/build/repo/mkdocs.yml;
                              ^
7: sed -i "s/docs_dir: docs/docs_dir:/" /opt/build/repo/mkdocs.yml;

A clear improvement.

aburdenthehand commented 8 months ago

/lgtm Nice one. Thanks @victortoso While we're at it, do we want to change the delimiter character in those sed commands to something that is not used in the string sub? Maybe | ? WDYT?

victortoso commented 8 months ago

/lgtm Nice one. Thanks @victortoso

@aburdenthehand Thank you. I'm still fixing the sed. Not particularly expert in it so it might take a few tries :)

While we're at it, do we want to change the delimiter character in those sed commands to something that is not used in the string sub? Maybe | ? WDYT?

Sounds fine to me, I'll give a try after lunch!

victortoso commented 8 months ago
Unknown escape character: 49 at row 6, col 50, pos 206:
> sed -iE "s/(site_url: https:..kubevirt.io.)docs/\1/" /opt/build/repo/mkdocs.yml;
                                                  ^

Even when trying to fix the usage of \ I'm using \. :man_facepalming:

jean-edouard commented 8 months ago

/approve Yes please! Thank you :)

kubevirt-bot commented 8 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jean-edouard

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/kubevirt/user-guide/blob/main/OWNERS)~~ [jean-edouard] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
aburdenthehand commented 8 months ago

/lgtm Muuuch cleaner. Thanks Victor!