CDCgov / template

Template repository with rules, practices, and privacy, license, records notices to help people use the CDCgov GitHub organization.
Apache License 2.0
30 stars 38 forks source link

Links in `README.md` and `CONTRIBUTING.md` use absolute paths with previous default branch name #98

Closed dylanhmorris closed 5 months ago

dylanhmorris commented 6 months ago

README.md

https://github.com/CDCgov/template/blob/3c681a9faf77f564cdd57b6e810e3ab9ac8609ec/README.md?plain=1#L53-L54

https://github.com/CDCgov/template/blob/3c681a9faf77f564cdd57b6e810e3ab9ac8609ec/README.md?plain=1#L74-L78

CONTRIBUTING.md

https://github.com/CDCgov/template/blob/3c681a9faf77f564cdd57b6e810e3ab9ac8609ec/CONTRIBUTING.md?plain=1#L7-L9

Suggestion

For most of these links, I'd suggest relative paths like those used earlier in README.md: https://github.com/CDCgov/template/blob/3c681a9faf77f564cdd57b6e810e3ab9ac8609ec/README.md?plain=1#L11-L18

If is important to have an absolute link to the default branch of this template repo on Github (e.g. if L76-78 of README.md are intended to make derived repos link back to this template by default), then the branch name should to be updated to the current name (main).

leebrian commented 6 months ago

I think this is just due to how GitHub links to assets. We should use relative paths within our repo, but that doesn’t help all the other repos, policies, and documents that link to the master path.

As a result, we should minimize renaming branches, especially for repos like template that have 10 years of people linking to it. Because it’s hard to find all the inbound links and fix them to the new branch name. I don’t think GitHub gives any web analytics to help find them either.

So cosmetic name changes are anti-user in that they will likely result in people cursing the 404s they experience. Same thing with repo renames, etc etc.

With branch names we can partially protect by generating sites with pages and have people link to that instead.

leebrian commented 6 months ago

Maybe for backwards compatibility, we can keep the default branch as main, but still keep a master with either an old copy of the files that get linked to with a message pointing folks over to main.

dylanhmorris commented 6 months ago

Since the default branch is now named main, your logic above would support support updating the links, no?

RE: your second post, Github has good support for forwarding when default branch names are changed (the links we're discussing do currently forward correctly), so unless/until that breaks I don't think we need our own backward compatibility branch.

leebrian commented 6 months ago

I think to prevent errors, we should change branch name back to master. At least until someone does the work to look up all the existing links hardcodes in CDC policy.

That seems like the easiest “fix.”

for the backwards compatibility, I was talking about a doc linking directly to a file in the master branch. Will GitHub redirect those?

dylanhmorris commented 6 months ago

I'm not an admin so it's not my decision, but I would caution against reverting the default branch name. It was likely updated to conform to current GitHub standard practices: https://github.com/github/renaming

for the backwards compatibility, I was talking about a doc linking directly to a file in the master branch. Will GitHub redirect those?

Yes, if you try out the absolute path links I mentioned above you'll see they successfully redirect to main. Again, see here: https://github.com/github/renaming

I proposed changing them going forward not because they're currently broken but because I thought it would be clearer and more future-proof.

leebrian commented 6 months ago

Oh, that’s not so bad then. If users don’t get a 404, then it doesn’t really matter and has no downside. So I get you now. Probably just send a PR or leave it.

dylanhmorris commented 5 months ago

Closed by #99