-
Notifications
You must be signed in to change notification settings - Fork 407
refactor: move some files around, fix loose ends and fix broken redirect #970
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
refactor: move some files around, fix loose ends and fix broken redirect #970
Conversation
|
|
| "^https://(?:www\\.)dvc\\.org/(.+)? https://dvc.org/$1", | ||
| "^https://man\\.dvc\\.org/(.+)? https://dvc.org/doc/command-reference/$1 303", | ||
| "^https://error\\.dvc\\.org/(.+)? https://dvc.org/user-guide/troubleshooting#$1 303", | ||
| "^https://error\\.dvc\\.org/(.+)? https://dvc.org/doc/user-guide/troubleshooting#$1 303", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops. Maybe we should try to thoroughly test redirects manually (sanity check) even if we have tests because manually you can come up with ways to try to break the logic 😋 This is because publishing incorrect redirects (especially 301) causes almost permanent "damage" to new users browser cache. Just a thought
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needless to say I'm available to do this but just need to prioritize as I've been struggling with switching from task to task recently.
|
looks good! @fabiosantoscode please add those failed links to the exclusion list please. |
shcheklein
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check the comment please, just a minor thingy
|
Cool! I've also used |
scripts/exclude-links.txt
Outdated
| https://github.com/iterative/dvc.org/blob/master/public$ | ||
| https://github.com/iterative/dvc/releases/download/$ | ||
| https://github.com/myaccount/myproject.git | ||
| https://dvc.org/user-guide/troubleshooting |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so, where does this link come from? I don't quite understand
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removing this for now and merging the PR
jorgeorpinel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this is merged but for the record I approve haha. I do have some JS code suggestions thought, may open a separate PR or include in my current regular updates one (#966)
|
@jorgeorpinel because it's website global config. It's a regular thing to have some redirects file in the root. e.g. Netlify, as far as I remember is just one of the examples. |
please, if it's possible let's not do this unless they are just stylistic changes (like reoder ifs, or something) that are not directly related to this PR. Otherwise, please leave some comments here - we'll try to address this while we still have context. cc @jorgeorpinel |
They are small refactors and language/stylistic changes indeed. They don't change the behavior. I can open a sample draft PR so you guys see them... ⏳ Also, I do still find the space separation in the JSON file strange. Why not instead of: [
"^https://(?:www\\.)dvc\\.org/(.+)? https://dvc.org/$1",
...do something like [
["^https://(?:www\\.)dvc\\.org/(.+)?", "https://dvc.org/$1", 308],
...? |
|
I thin think is Ivan's logic on the redirects JSON file:
So why use JSON at all? Probably a regular redirect file is just plan text? Even simpler. Up to you guys... p.s. re I won't touch this file in my small refactoring suggestion though. Let's see what Fabio prefers 🙂 |
if they are not related to this PR at all - include them to the regular updates, up to you!
simpler to deal with in JS
one line array instead of a string might work fine as well, don't have a strong opinion here |
would probably still personally prefer a simple string, just don't see a reason to write all these additional symbols in this case :) |
They're related, see https://github.com/iterative/dvc.org/pull/973/files Thanks |
|
@jorgeorpinel I've added the spaces because it was pretty hard to read the big-picture of the file without them. I'm happy to remove if you feel strongly against them. I also think arrays would be fine. Maybe the space alignment would be more natural in that situation, or we could do something like this to make it more readable, even if it's taller: |
|
In my case my IDE wraps at 80 chars so taller is easier to read in cases like this. ESLint would probably reformat it that way anyway. Again, it's not a strong opinion but I do think it's a better format and less error prone for later edits (how many spaces should I add? space typos, etc.) |
|
still prefer compact vs very tall - it's just hard to see the whole picture when it's tall, means hard to catch errors. In this case you just see clearly one block that looks exactly like: it's super easy to read and see all at once. Especially if you start grouping them by the first string. |
|
BTW lines 4 and 5 don't have the same space alignment on the 2nd column: "^https://error\\.dvc\\.org/(.+)? https://dvc.org/doc/user-guide/troubleshooting#$1 303",
"^https://(code|data|remote)\\.dvc\\.org/(.+) https://s3-us-east-2.amazonaws.com/dvc-public/$1/$2 303", |
|
I'm not sure 100% but my intuition is that you don't set auto-wrapping for code related stuff - it's extremely dangerous. |
|
also, you at least have a chance to make it wider for a moment, in case it's long - no one has a chance whatsoever to see it all at once, group it, etc |
|
editor line wrapping = extremely dangerous? 😱 well I need some adrenaline in life Didn't quite get that last comment about "see it all at once, group it, etc" but OK, those are all my arguments and still my position isn't very strong about this, plus I'm not convincing anyone, so let's just move on 🙂 |
* server: reformat/refactor code and comments around new redirects as mentioned in #970 (review) * links: addresses #973 PR feedback per #973 (review) through #973 (review)

Fixing some loose ends with #943, addressing @jorgeorpinel and @shcheklein's feedback. Also fixed the troubleshooting redirect URL which was missing the
/docprefix.❗ Please read the guidelines in the Contributing to the Documentation list if you make any substantial changes to the documentation or JS engine.
🐛 Please make sure to mention
Fix #issue(if applicable) in the description of the PR. This causes GitHub to close it automatically when the PR is merged.Please chose to
allow us
to edit your branch when creating the PR.
Thank you for the contribution - we'll try to review it as soon as possible. 🙏