haiku / haikudepotserver

Haiku Depot Server
Other
15 stars 10 forks source link

Convenience URLs #8

Open andponlin opened 9 years ago

andponlin commented 9 years ago

Issue #3 was misread as being to clean-up the links so they had have real hyperlinks because they were previously given an href of an empty string. This was mentioned at the tail end of the issue description. This issue is to support more tidy looking URLs for external reference as was also mentioned in #3.

andponlin commented 9 years ago

Hi @diversys; (commit coming soon...) The "/#/..." thing is a bit hard to work around at this stage because the java-script framework uses this path construct for it's routing (mapping URL paths to 'pages').

I did change the URL to "other versions" as you had suggested as this is a good idea and is logical.

I also implemented a fallback so that URLs of the form "https://depot.haiku-os.org/vision" will act as an easy way to reach a package. The logic around that will try to be smart about using an architecture and a version. This is not used in generally browsing the site though.

When viewing a "package", the whole coordinates to the specific version and architecture are required because it is really showing data that ultimately maps to a specific ".hpkg" in the repository including things like file size etc... and that has to be identified with as a specific version in a specific architecture.

diversys commented 9 years ago

When viewing HDS main page the url looks the same. Is there a way to show clean urls when viewing a package? This was the main point of this enhancement... Thanks for the fallback!

andponlin commented 9 years ago

Hi @diversys; I do understand the changes in #8 do not provide for compact URLs as you had suggested. The following are the sorts of things that would need to happen to further reduce the verboseness of the URLs' paths...

Remove "/#/..."

I do not think that I can prevent the "/#/X" prefix because the javascript framework that drives the UI uses the "#" as a delimiter for separating the application-server's path from the single-page path in order to map "X" to a page.

Remove "/#/pkg/.."

I can't safely remove "pkg" because there may be paths in-use that would conflict with a package name now or in the future and create ambiguity. The "pkg" provides a namespace for the packages within the URL path. For example, a package called "about", "reports", "jobs" or "users" could cause a problem now.

Not Specifying a Version Such as "..1/10/-/x86_gcc2"

I could introduce something like "/#/pkg/beae/latest" which could guess the architecture you might want (x86_gcc2) and show data for the latest version in that architecture. "/#/pkg/beae" is now utilized for showing all of the versions of a package so the "/latest" suffix would be necessary. Do you think there is enough value in doing that?

diversys commented 9 years ago

Remove "/#/..." Bummer :/

Remove "/#/pkg/.." How about changing "about", "reports", "jobs" and "users" to clearly separate them from packages?

Not Specifying a Version Maybe "/#/pkg/beae" can be utilized for showing the latest version while "/versions" suffix can be used for showing all of the versions?

diversys commented 9 years ago

Or even better - move "about", "reports", "jobs" and "users" to a separate name space.

andponlin commented 9 years ago

Hi @diversys; Are you able to give an example?

diversys commented 9 years ago

http://depot.haiku-os.org/#/hds/about - something like this?

andponlin commented 9 years ago

Hi @diversys; If there were a package called "hds" could there be a future ambiguity?

diversys commented 9 years ago

Possibly. Maybe use some characters in "hds" part that are not allowed as a package name?

andponlin commented 9 years ago

The regex for validating package names is ^[^\s/=!<>-]+$. See "B_HPKG_ATTRIBUTE_ID_PACKAGE_NAME" here. I guess something like hds- could be used as a delimiter for non-package, but then I would prefer to have /#/pkg/apr/... than introduce unusual characters into the path.

diversys commented 9 years ago

It is a matter of how often a certain type of urls will be shared on the web and presented to a user in the address bar. I guess urls to packages would be shared, but not to internal pages...

diversys commented 9 years ago

Shall we reopen this issue? URLs still don't look clean.

andponlin commented 9 years ago

Hi @diversys; Yes I will re-open this issue. I am going to focus on "multiple repositories" support for a while and will come back to this a bit later.

diversys commented 9 years ago

Cool, thanks! :)

diversys commented 7 years ago

Any ideas on this one?

andponlin commented 7 years ago

Hi @diversys ; yes it's still on the list, but I haven't had time.

andponlin commented 7 years ago

I've just had another look. I think it should be possible with some re-factoring work to move other URLs in the SPA to make the SPA paths to a package-version come out as...

https://depot.haiku-os.org/#/lbreakout2/haikuports/2/6/5/-/1/x86_gcc2

...without the "pkg" segment. It would be difficult to do...

https://depot.haiku-os.org/#/lbreakout2/latest

...because there are packages that are duplicated between repositories so it would be ambiguous as to which package-version should be viewed in which repository. Maybe something like...

https://depot.haiku-os.org/#/haikuports/lbreakout2/latest

...might work with the repository as well, but would still be a fair but of refactoring.

As an alternative, how about I add a more visible link...

https://depot.haiku-os.org/lbreakout2

...to the top area of the package-version view page for people to bookmark and reference as a convenience perma-link?

diversys commented 7 years ago

Sounds good enough. How about https://depot.haiku-os.org/#/haikuports/lbreakout2 to always point to latest?

diversys commented 5 years ago

Any news on this one?

andponlin commented 5 years ago

Hi @diversys - this just hasn't come to the top of my list yet. It would require quite a bit of re-factoring work and doesn't fit well with what has been built to date.

andponlin commented 5 years ago

...to the top area of the package-version view page for people to bookmark and reference as a convenience perma-link?

I can probably do that fairly quickly -- I'll see what I can do soon.