Closed
Bug 567904
Opened 15 years ago
Closed 15 years ago
Add self.addonId
Categories
(Add-on SDK Graveyard :: General, defect)
Add-on SDK Graveyard
General
Tracking
(Not tracked)
RESOLVED
WONTFIX
0.5
People
(Reporter: adw, Assigned: adw)
Details
Attachments
(1 file)
4.51 KB,
patch
|
avarma
:
review-
|
Details | Diff | Splinter Review |
self.id is the JID, but modules sometimes need the add-on ID -- simple storage for example, when it talks to the extension manager. We should add an `addonId` to the self module.
This patch also turns self.id into a getter, since people shouldn't be able to overwrite it. And it updates simple storage to use the new property.
Attachment #447228 -
Flags: review?(avarma)
Comment 1•15 years ago
|
||
What's the difference between these two forms of id? self.id was intended to be the add-on ID, and was renamed from "jetpackID" to "addonID" to finally just "id" because there didn't seem to be any necessary qualifiers for it.
Hm, do you mean that self.id looks like "jid0-XYZ", whereas the add-on-id is like "jid0-XYZ@jetpack" (one is derived from the other by appending a suffix to make it email-like?).
Hm, in that case, yeah, I think self.id ought to be the -jetpack form: identical to what the add-on manager thinks. That would make it different than what package.json contains, which is the non-suffixed form.
Assignee | ||
Comment 2•15 years ago
|
||
(In reply to comment #1)
> Hm, do you mean that self.id looks like "jid0-XYZ", whereas the add-on-id is
> like "jid0-XYZ@jetpack" (one is derived from the other by appending a suffix to
> make it email-like?).
Right.
> Hm, in that case, yeah, I think self.id ought to be the -jetpack form:
> identical to what the add-on manager thinks. That would make it different than
> what package.json contains, which is the non-suffixed form.
In that case would the JID be exposed at all? I presume not. That might be a better solution, yeah, but since simple storage is already using the JID, we'd need to switch ASAP and block 0.4 on it to avoid a transition in 0.5.
Atul?
Comment 3•15 years ago
|
||
Hmm. Now I'm uncertain. The JID (being the shortest string around) is sort of the seed from which all these other ID strings are derived. If we only send one thing into harness-options.json, I'd like it to be the short JID, and then derive the longer things (including the addon id) as necessary. (I'm happy to see browser-side code which adds prefixes and suffixes to transform this seed into the right format, but I'd like to avoid having that code trim/remove a suffix to achieve similar things).
That makes me lean towards having "packaging.jetpackID", "self.id", and "self.addonid" . The use of the word "jetpack" in the internal-only "packaging" object feels ok. I know that we were trying to keep "jetpack" out of any of the "self.*" property names. Is the same true with the word "addon"? Will it be weird to have jetpack/addon/extension/whatever code that uses "self.addonid" when this code is not actually a FF addon?
(one reason we went with self.id is that it avoids all of these problems, but of course, There Can Be Only One, at least only one with a short name like "id"...)
Comment 4•15 years ago
|
||
I think that self.id and self.addonID are fine, personally.
Comment 5•15 years ago
|
||
Ok, let's go with self.id = packaging.jetpackID = "jid0-XYZ", and self.addonID = packaging.addonID = "jid0-XYZ@jetpack". The diff from your patch would be to set harness_options["addonID"] = addon_id in python-lib/cuddlefish/__init__.py at line 485, and then reference packaging.addonID instead of packagind.jetpackID+"@jetpack" in self.js .
Assignee | ||
Comment 6•15 years ago
|
||
Thanks guys. Removing from 0.4 blocker list, since it's only cleanup and the solution doesn't impact simple storage.
No longer blocks: 566904
Target Milestone: -- → 0.5
Comment 7•15 years ago
|
||
I hesitate to suggest this, since the shed has already been well painted, but given that the ID in question is the one used by the Toolkit API <https://developer.mozilla.org/en/Toolkit_API> to identify the installable bundle <https://developer.mozilla.org/en/Bundles> by which an addon is installed, the most appropriate name for this would probably be bundleID. And that name would also be compatible with uses of the SDK to build XULRunner applications.
Comment 9•15 years ago
|
||
I'm ok with bundleID. I'd still put it in self.bundleID and packaging.bundleID , and continue to have the cuddlefish/__init__.py code take responsibility for computing it and storing it in harness_options[]
Comment 10•15 years ago
|
||
Oh, had no idea about the 'bundle' terminology--I'm fine with it, though we may also want to add it to our SDK documentation glossary, and possibly start using the word in contexts where it's appropriate.
Comment 11•15 years ago
|
||
(In reply to comment #10)
> Oh, had no idea about the 'bundle' terminology--I'm fine with it, though we may
> also want to add it to our SDK documentation glossary, and possibly start using
> the word in contexts where it's appropriate.
Yup, yup. FWIW, I used to call them packages, and that's still a common way of describing them, but since we use "package" to mean something else, and we use it a lot, it would be better to use a different word here.
Updated•15 years ago
|
Attachment #447228 -
Flags: review?(avarma) → review-
Comment 12•15 years ago
|
||
Comment on attachment 447228 [details] [diff] [review]
patch
Looks good, but change addonId -> bundleId?
Comment 13•15 years ago
|
||
However, nit: bundleId -> bundleID, for consistency with packaging.jetpackID as well as usage of contractID, classID, and timerID.
Assignee | ||
Comment 14•15 years ago
|
||
Bug 549324 landed and added packaging.bundleID, per Brian's comment 9 here. self.bundleID is no longer necessary, and adding it would be redundant, so resolving wontfix.
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → WONTFIX
Comment 15•15 years ago
|
||
The Add-on SDK is no longer a Mozilla Labs experiment and has become a big enough project to warrant its own Bugzilla product, so the "Add-on SDK" product has been created for it, and I am moving its bugs to that product.
To filter bugmail related to this change, filter on the word "looptid".
Component: Jetpack SDK → General
Product: Mozilla Labs → Add-on SDK
QA Contact: jetpack-sdk → general
Version: Trunk → unspecified
You need to log in
before you can comment on or make changes to this bug.
Description
•