Skip to content

Conversation

@fabiosantoscode
Copy link
Contributor

Fixing some loose ends with #943, addressing @jorgeorpinel and @shcheklein's feedback. Also fixed the troubleshooting redirect URL which was missing the /doc prefix.


❗ 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. 🙏

@fabiosantoscode
Copy link
Contributor Author

link-check-git-diff is failing because I've removed the broken redirects, and it thinks those were links that worked.

"^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",
Copy link
Contributor

Choose a reason for hiding this comment

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

good catch!

Copy link
Contributor

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

Copy link
Contributor

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.

@shcheklein
Copy link
Contributor

looks good!

@fabiosantoscode please add those failed links to the exclusion list please.

Copy link
Contributor

@shcheklein shcheklein left a 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

@fabiosantoscode
Copy link
Contributor Author

Cool! I've also used sed to remove the hash part, instead of adding three links which differ only by hash but are the same document.

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
Copy link
Contributor

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

Copy link
Contributor

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

@shcheklein shcheklein merged commit e71c7b3 into treeverse:master Feb 4, 2020
Copy link
Contributor

@jorgeorpinel jorgeorpinel left a 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)

@shcheklein
Copy link
Contributor

@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.

@shcheklein
Copy link
Contributor

shcheklein commented Feb 4, 2020

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)

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

@jorgeorpinel
Copy link
Contributor

jorgeorpinel commented Feb 4, 2020

let's not do this unless they are just stylistic changes

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],
  ...

?

@jorgeorpinel
Copy link
Contributor

jorgeorpinel commented Feb 4, 2020

I thin think is Ivan's logic on the redirects JSON file:

From #943 (comment)
we had an iteration like this and I didn't like it (not sure about @fabiosantoscode :) ) - it's 1000 lines vs 10. It's way easier to read line by line. It's very regular format for redirects files - one rule a line. There should be very strong reasons to complicate this.

So why use JSON at all? Probably a regular redirect file is just plan text? Even simpler. Up to you guys...

p.s. re it's 1000 lines vs 10: Not sure how though. See my suggestion in #970 (comment) above.

I won't touch this file in my small refactoring suggestion though. Let's see what Fabio prefers 🙂

@shcheklein
Copy link
Contributor

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... ⏳

if they are not related to this PR at all - include them to the regular updates, up to you!

So why use JSON at all?

simpler to deal with in JS

do something like array of fields

one line array instead of a string might work fine as well, don't have a strong opinion here

@shcheklein
Copy link
Contributor

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 :)

@jorgeorpinel
Copy link
Contributor

if they are not related to this PR at all - include them to the regular updates, up to you!

They're related, see https://github.com/iterative/dvc.org/pull/973/files

Thanks

@fabiosantoscode
Copy link
Contributor Author

@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:

[
  [
    "/from",
    "/to",
    308
  ],
[...]

@jorgeorpinel
Copy link
Contributor

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.)

@shcheklein
Copy link
Contributor

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:

string     string
string     string
string     string

it's super easy to read and see all at once. Especially if you start grouping them by the first string.

@jorgeorpinel
Copy link
Contributor

This is how it looks for me 😋

image

13" laptop screen, and clearly I like large fonts 😬

@jorgeorpinel
Copy link
Contributor

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",

@shcheklein
Copy link
Contributor

I'm not sure 100% but my intuition is that you don't set auto-wrapping for code related stuff - it's extremely dangerous.

@shcheklein
Copy link
Contributor

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

@jorgeorpinel
Copy link
Contributor

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 🙂

shcheklein pushed a commit that referenced this pull request Feb 19, 2020
* 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)
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.

3 participants