Copilot commented on code in PR #326:
URL: https://github.com/apache/ozone-site/pull/326#discussion_r2784472940
##########
docusaurus.config.js:
##########
@@ -148,7 +153,7 @@ const config = {
const items = await defaultCreateSitemapItems(rest);
// TODO Base URL must be updated when the new website's branch is
merged.
- const validUrlRegex = new
RegExp('^https://ozone-site-v2\.staged\.apache\.org/([a-z0-9][a-z0-9\./-]*[a-z0-9/])?$');
+ const validUrlRegex = new
RegExp('^https://ozone\.apache\.org/([a-z0-9][a-z0-9\./-]*[a-z0-9/])?$');
Review Comment:
The TODO comment about updating the base URL when the new website branch is
merged is now stale given the `url`/regex have been updated to
`ozone.apache.org`. Please remove or update the comment so it doesn’t suggest
additional required work that’s already done.
##########
docusaurus.config.js:
##########
@@ -148,7 +153,7 @@ const config = {
const items = await defaultCreateSitemapItems(rest);
// TODO Base URL must be updated when the new website's branch is
merged.
- const validUrlRegex = new
RegExp('^https://ozone-site-v2\.staged\.apache\.org/([a-z0-9][a-z0-9\./-]*[a-z0-9/])?$');
+ const validUrlRegex = new
RegExp('^https://ozone\.apache\.org/([a-z0-9][a-z0-9\./-]*[a-z0-9/])?$');
Review Comment:
The `validUrlRegex` is built via `new RegExp('...')`, but the pattern
contains `\.` sequences inside a JS string. In JS string literals `\.` does not
escape a dot for the RegExp engine (the backslash is consumed/ignored), so the
domain portion becomes too permissive (the `.` will match any character). Use a
regex literal or double-escape the backslashes so the RegExp receives `\.`
characters.
```suggestion
const validUrlRegex =
/^https:\/\/ozone\.apache\.org\/([a-z0-9][a-z0-9./-]*[a-z0-9/])?$/;
```
##########
docusaurus.config.js:
##########
@@ -123,13 +128,13 @@ const config = {
sidebarPath: undefined,
// TODO update this link when the new website's branch is merged.
editUrl:
- 'https://github.com/apache/ozone-site/tree/HDDS-9225-website-v2',
+ 'https://github.com/apache/ozone-site/tree/master',
},
blog: {
showReadingTime: true,
// TODO update this link when the new website's branch is merged.
editUrl:
- 'https://github.com/apache/ozone-site/tree/HDDS-9225-website-v2/',
+ 'https://github.com/apache/ozone-site/tree/master/',
Review Comment:
The TODO above `editUrl` says to update the link when the new website branch
is merged, but `editUrl` has already been updated to `master`. Please remove or
reword this TODO to avoid leaving misleading migration notes in the config.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]