Closed Bug 642156 Opened 14 years ago Closed 14 years ago

Validator messages for bootstrapped add-ons

Categories

(addons.mozilla.org Graveyard :: Developer Pages, enhancement, P4)

enhancement

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: kmag, Assigned: kmag)

References

()

Details

(Whiteboard: [ReviewTeam])

Attachments

(2 files)

User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:2.0b13pre) Gecko/20110310 Firefox/4.0b13pre Build Identifier: I think that it would be a good idea to flag certain actions in bootstrapped add-ons so that editors know to make sure that they're properly reversed at shutdown. Obviously the signal to noise ratio would be way too high if we flagged everything that could conceivably require cleanup, but I think the following should be safe: • nsIComponentRegistrar.registerFactory • nsICategoryManager.addCategoryEntry (especially when the 4th argument is not false) • Observers: nsIObserverService.addObserver, nsIWindowWatcher.registerNotification, nsIPrefBranch2.addObserver, nsIWindowMediator.addListener • nsIResProtocolHandler.setSubstitution • nsIStyleSheetService.loadAndRegisterSheet • nsIStringBundleService.createBundle, nsIStringBundleService.createExtensibleBundle • nsIComponentRegistrar.autoRegister (this should never be used in bootstrapped extensions, for now) Reproducible: Always
I believe this was filed under the wrong product, as the Add-ons SDK would be where your code execution occurs. The Builder just allows you to construct an add-on using the SDK, it has no ability to wrap actions at runtime/unload with the flags you are suggesting. I am going to switch this ticket to the Add-on SDK.
Component: Add-on Builder → General
Product: addons.mozilla.org → Add-on SDK
QA Contact: add-on-builder → general
Daniel: I may have misfiled it, but this bug is for the AMO validator and isn't especially related to SDK add-ons.
Component: General → Admin/Editor Tools
Product: Add-on SDK → addons.mozilla.org
Oops, thought you were asking for the Add-ons SDK to wrap unload logging around those JS service calls if it came across them, sorry for the confusion!
a?jorge
Assignee: nobody → mbasta
QA Contact: general → admin-tools
I'm in favor of this, but it's low priority.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P4
Whiteboard: [required amo-editors]
If it's low priority, I can submit a patch. It should be fairly simple and I've been intending to modify the validator to run some particular tests on my code anyway.
Awesome, thanks.
Assignee: mbasta → maglione.k
Attaching first draft patch. Also fixes a bug that prevents errors from being reported for more than one XPCOM instance and adds handling for getService calls similar to getInstance calls. This really requires that any call to QueryInterface or getInterface have the same semantics as Cc.*.createInstance to function adequately for all cases, but that's another bug I think.
Attachment #520003 - Flags: review?(mbasta)
Hi Kris. Thanks for the patch. It looks pretty good to me but it needs some tests (unless I missed them). Matt Basta can help you with that. Can you submit a pull request on github? https://github.com/mozilla/amo-validator There are a few other comments I have and Matt should r it as well. Regarding printing out the traceback in the except block: I'd rather see that except block get more specific since, as you point out, it's a little too loose right now.
Kumar: I have informal tests but I wanted to get feedback before I formalize them. Especially relating to the lack of QI support, since the final tests will depend on it and fail without it. And re the traceback, I think that the exception should at least be printed in all cases so that we know something unexpected is going on (a single typo was causing silent failures for me), but it would probably be better to also trigger a test failure.
r+ for the patch, didn't see anything off the wall. Let me know if/when you want me to pull it in.
Argh. I see you merged already. This patch adds QueryInterface and getInterface support for XPCOM interface tests. It also refactors part of the previous patch to better match the style of the rest of the file. Let me know if this is alright and I'll add formal tests.
Attachment #520111 - Flags: review?(mbasta)
No worries. r+; I like what you did with the xpcom_constructor stuff. Also, you might find the work on doing on my javascript-newhooks branch useful/helpful: https://github.com/mattbasta/amo-validator/commit/3f360614dc29e0fd33658165fd4b30535ba0f423
Yes, that definitely does look useful. Given that, I might actually make QueryInterface additive/mutative which I was going to leave for you in another bug. :)
I have four relevant commits in a fork: This adds QueryInterface support: https://github.com/kmaglione/amo-validator/commit/eb2e1d0f11a0815d1310e4b97cb945d5ed4a957c This makes QueryInterface additive and mutative. I added it as a separate changeset because I think it may be slightly dodgy and should be reviewed separately: https://github.com/kmaglione/amo-validator/commit/10ce51a444ac90dbc86d68126828c39179d24638 These adds tests (and fix a small bug): https://github.com/kmaglione/amo-validator/commit/557350d511b04f85f46b0693fa5769ebd3468793 https://github.com/kmaglione/amo-validator/commit/bd3b8758fe36271e683d1af65c5d5bf73bcb8bee
They look good to me, but I don't do official code reviews. Feel free to make a pull request and one of the Python Gods will reach down with their noodley appendages and inspect your work.
(In reply to comment #16) > They look good to me, but I don't do official code reviews. Feel free to make a > pull request and one of the Python Gods will reach down with their noodley > appendages and inspect your work. You're welcome to review code! Just so long as two eyes are on it, that's really what I'm after. Please do.
Component: Admin/Editor Tools → Developer Pages
QA Contact: admin-tools → developers
Target Milestone: --- → 6.0.7
er, two *sets* of eyes. four total please. :)
Reviewed and pushed. Looks good!
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Attachment #520003 - Flags: review?(mattbasta)
Attachment #520111 - Flags: review?(mattbasta)
Reclassifying editor bugs and changing to a new whiteboard flag. Spam, spam, spam, spam...
Whiteboard: [required amo-editors] → [ReviewTeam]
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: