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

Won’t allow hyphens in application ID #12

Closed
Jacalz opened this issue Dec 21, 2020 · 5 comments
Closed

Won’t allow hyphens in application ID #12

Jacalz opened this issue Dec 21, 2020 · 5 comments

Comments

@Jacalz
Copy link

Jacalz commented Dec 21, 2020

Hi there. Thank you for creating this great piece of software.
I was looking at using it for creating appstream metadata for my application called wormhole-gui. When I entered the unique identifier for it (com.github.jacalz.wormhole-gui), it complained about hyphens not being allowed.

I know that websites allow hyphens (https://wi-fi.org) and I couldn’t find any information about hyphens not being allowed for unique software identifiers (or appID). Is this something that is specific to the appstream specification or am I just missing something obvious here? I would greatly appreciate if someone could clear up the situation for me :)

@ximion ximion changed the title Won’t allow hymen’s in application ID Won’t allow hyphens in application ID Dec 22, 2020
@ximion
Copy link
Owner

ximion commented Dec 22, 2020

While AppStream historically allows hyphens in component-IDs, today we try to align the component-ID with other commonly used IDs for the application, like the AppID and D-Bus interface names. The latter is especially relevant because many new apps support being launched by D-Bus (see https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#dbus ).
The benefit of having only one name is obviously to reduce confusion and needless renaming. So, while AppStream does support hyphens, D-Bus doesn't (and also no parts of the string starting with numbers). We can't remove support for hyphens from AppStream completely, as that would break backwards compatibility, but for new metadata we strongly discourage using them, and appstreamcli validate will throw an INFO-type hint if your component-ID contains one.
You can read more about this in the specification, see the info-box at https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html#tag-id-generic

I hope that clarifies things :-)

@ximion ximion closed this as completed Dec 22, 2020
@ximion
Copy link
Owner

ximion commented Dec 22, 2020

Btw, your ID could be io.github.jacalz.wormhole_gui or maybe io.github.jacalz.wormholegui. In the past, there was some debate around using the com.github namespace, as that would be reserved for GitHub apps themselves, while user-created stuff would be under io.github, but I do not recall anyone from GitHub ever weighing in on that discussion. So, using either is probably fine (the metainfo-creator will generate the .io variant regardless after entering the URL, just in case).

@Jacalz
Copy link
Author

Jacalz commented Dec 22, 2020

Thanks for taking your time with the detailed answer. It certainly does clarify things a lot. It is greatly appreciated 👍
Yeah, you are probably right that it makes more sense to use io.github over com.github and it makes even more sense since I am planning on creating my own jacalz.github.io website.

There is one issue though, fyne (the ui toolkit that I used for creating the application) uses the application id in it's local storage of settings. The problem is that just moving over to io.github.jacalz.wormhole_gui would be a breaking change as all the user's settings would be lost. That would warrant a 3.0.0 release, which feels a bit drastic when I recently released 2.0.0. I understand that this probably isn't something you would suggest, but would it work to create the metadata as com.github.jacalz.wormhole_gui and then manually rename and modify the file as com.github.jacalz.wormhole-gui until I can change the id entirely? As my software is cross-platform (thus no dbus support), it could work as a temporary solution?

@ximion
Copy link
Owner

ximion commented Dec 22, 2020

You don't have to have your component-ID match all the other IDs - it's certainly nicer that way, but if doing so would result in breakage, it's better to have two separate IDs (ideally only temporarily).
So you could give your metadata an io.github.jacalz.wormhole_gui component-ID and just leave all other identifier as they are (you could even have a component-ID with a hyphen, but I would advise against that, just to be future-proof).

For AppStream, that ID is really only just an identification string that is used to make your app uniquely known to operating systems and software centers, and is used to associate extra data (like ratings and reviews) with it. It's not, unlike with D-Bus, used for any code generation and may differ from other IDs used in the app with the only drawback of then having in-app ID inconsistencies that may confuse the developer :-P

@Jacalz
Copy link
Author

Jacalz commented Dec 22, 2020

Alright. Thank you for the response 🙂

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