Skip to content
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

Allow falling back to secondary (permalink) target when primary target is 404. #1059

Closed
RokeJulianLockhart opened this issue Jul 10, 2024 · 3 comments

Comments

@RokeJulianLockhart
Copy link

RokeJulianLockhart commented Jul 10, 2024

All of my links go to GitLab documents. As https://forum.gitlab.com/t/can-i-explicitly-ask-the-gitlab-web-gui-to-load-the-latest-version-of-a-file-in-the-uri/102524/3?u=rokejulianlockhart explains, because these documents may change, I use a combination of an explicit command to utilize the latest version (the HEAD - the main/master branch) and a fragment directive pointing to the heading so that if that heading changes, the match merely doesn't occur, and the document shall be presented gracefully. An example is https://dub.sh/jga, which links to /blob/HEAD/ with ?plain=0#:~:text=list%2Dstyle%2Dtype:%20none;%20%7D-,Profiles,-Table%20of%20Contents.

However, there have been instances in which the filename of the document has changed. I utilize a path naming convention which is unusually resilient to this, but it still occurs. Consequently, I would like to provide the opposite kind of URI as a fallback - versioned and pointing to specific lines, like /blob/8adbfd946684a3aa6f70b6e55322fdfda96d1eeb/ with ?plain=1#L110-753. (Note that these don't render due to a temporary issue in GitLab, but they work if you remove the fragment directive. Though, it might even be fixed by the time you see this.)

Summarily, I'd like to set a versioned URI as a fallback to my vanity URI.

Copy link

linear bot commented Jul 10, 2024

@RokeJulianLockhart RokeJulianLockhart changed the title Fallback URIs when primary is 404. Allow falling back to secondary (permalink) target when primary target is 404. Aug 10, 2024
@steven-tey
Copy link
Collaborator

This might be a bit tricky to implement in an on-demand fashion since we'll need to first make a request to see if the URL returns a 404 status code, and then fallback to the backup URL.

An alternative is to incorporate this as part of #417 (WIP) where we notify you when a URL 404s. Will close this issue for now in favor of that PR!

@steven-tey steven-tey closed this as not planned Won't fix, can't repro, duplicate, stale Aug 11, 2024
@RokeJulianLockhart
Copy link
Author

RokeJulianLockhart commented Aug 11, 2024

#1059 (comment)

@steven-tey, that's a great feature, but it's not of much use to me. The reason I want this is that when I do training exercises, or am deployed somewhere, I can't respond to a URI going down. I don't believe that these should be mutually exclusive.

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

No branches or pull requests

2 participants