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
Plugin system #491
Plugin system #491
Conversation
…den in the environment.
Provide an error message if installation fails (eg. when you send text instead of a dmg file). Additionally, allow the update to run in "silent mode". QS will restart automatically as soon as an update is installed.
…ication without intervention.
…real set of plugins being downloaded.
This means people who have secret plugins installed can't access the plugin repository before this version.
It never worked correctly. Reachability only checks if a given host *could* be reached, not if it *can* be reached. So it's better to just try checking for updates anyway.
Doesn't handle QS updates (yet).
…(hardcoded for now).
Reduced the wait time for a server response when fetching plugin info to as not to leave QS hanging (line 168) Removed some commented lines (line 172ish) Added some task statuses when downloading plugins. I'm not sure if they do anything (the blue status bar doesn't fill) (lines 240, 287) Alerts and logs (most other lines)
…alled Only try to delete the old (existing) if it actually exists
Hi Patrick, great to see you being back from your vacation and kicking things into high gear. :-) Just to be clear: This does include requirements checking on the application side, even if it is somehow screwy on the web interface? So it wont show me the old AirPort module, when I'm using QS on SL, but instead it will show me the new one? |
Hi there :) From what I've gathered from Etienne's work, the only version checking that exists in this system is for plugin versions. There's nothing within the application to check if plugins are compatible with certain OSes. This isn't ideal, but as it stands: This system will be for QS v61+ which is 10.6+ only. If/When we get plugins that only work with 10.6 or 10.7, that's when we could start thinking about this... hopefully we'd get round to it before that. For the time being, we'd have a working plugins system, a new QS version out the door, and hopefully a lot less questions from lost users :) |
hmmm...so there's no version compatibility checking. Neither for QS version nor for OS version, right? Ok, so we just have to be sure that we only publish SL+ plugins this way. And that we have a way to extend the update protocol without to much trouble, once it's needed. |
I have tested the QS version requirements part by artificially setting QS version requirements for plugins. It works as expected - the plugins will not show up in the plugins preference pane. Reading Etienne's first post in the dev groups:
Leads me to believe he has thought about OS version, but QS never sends the OS version to the server, and there's nothing in the databases for it so I don't think it works. ASIDE: For those with some PHP skills: If somebody knows how to propogate $prop to be an array containing the fieldnames of the SQL table then step through them that'd be great. |
OK the database does include minHostVersion and minOSVersion (as well as max) so the server side stuff looks like it can run fine on this. |
So it should get a list of fields from the database instead of using the hard-coded |
I kind of already tried playing with this, and almost got it to work, but I was at a loss so stopped there. On 28 September 2011 16:27, Rob McBroom <
|
I’ve tested D and E. Everything seems to work as is should. There is a possible issue with the preference NIB. In the other (clean) account, I can’t enable the Dock icon. (It’s off and the checkbox is greyed out.) It’s fine in my main account though, so I need to do some more checking. |
Clean install from master has the Dock icon enabled, but you still can’t change the setting in Preferences. Weird, but clearly not the fault of this change. UPDATE: Since the Dock icon business requires modifying the application bundle, you’d need to be an admin user. That’s why the setting is disabled for the other account. |
For some reason this email hasn't shown up here: Only thing I can think of is that in order to change the Dock icon setting you have to change QS.app/Contents/Info.plist I'm thinking it's greyed out because QS has already done the check to see if you can edit QS.app and seen that you can't (that's how it is if you run QS from the .dmg - no write permissions) Good about D and E. I'll do a few more tests, and hopefully another person will. The web side of things is pretty fragile - I wouldn't be confident with many people other people uploading plugins as it breaks quite a bit. It may be worth us fixing those first These include: a) Uploading a plugin to replace an older one using the rb script: The script should check to see if min/maxHostVersion and min/maxOSVersion are the same for the new and old plugins. If so, it should delete the old one. Believe it or not, but some magic {(my PHP is pretty much non-existant) I've managed to fix a) Please let there be someone better than me at PHP. @skurfer ? @HenningJ ?, @tiennou ? - @...anyone?! :P |
Only thing I can think of is that in order to change the Dock icon setting I'm thinking it's greyed out because QS has already done the check to see if Good about D and E. I'll do a few more tests, and hopefully another person The web side of things is pretty fragile - I wouldn't be confident with many These include: a) Uploading a plugin to replace an older one using the rb script: The On 29 September 2011 20:56, Rob McBroom <
|
IRC time ! ;-) |
For the record : plugins identifiers can appear multiple time because you have to handle multiple version of a plugin, e.g. the Airport Module vX works in 10.4 but not in 10.5/6/7, so there's another vY plugin for those. Technically, you get a Plugin with You're right about the OS version check : this is TODO but doable, now that the User Agent contains OS X version. The harder part is fetching the current architecture and put it in the User Agent, so that the system knows which plugins can be used by the client. I have found this snippet lurking on the web that seems to do that, but I have yet to check its return values : cpu_type_t GetProcessArchitecture(pid_t pid)
{
cpu_type_t cputype;
size_t cpusz = sizeof(cputype);
// Default values
#if __i386__
cputype = CPU_TYPE_X86;
#else
cputype = CPU_TYPE_POWERPC;
#endif
if (sysctlbyname_with_pid("sysctl.proc_cputype", pid, &cputype, &cpusz, NULL, 0) == -1) {
fprintf(stderr, "proc_cputype: sysctlbyname_with_pid failed: %s\n", strerror(errno));
}
return cputype;
} |
I've jumped on IRC. Not sure how long I can be on for: I've moved into a new
Do we need to do this? We're not going to be building plugins with PPC, and On 3 October 2011 10:55, Etienne Samson <
|
I think I see the problem. It seems that on startup, QS must be getting mixed up with which plugin it should delete. Previously, the old and new plugins would have the same name, but @ddl_smurf altered this to give the plugins the format: PluginID.Version.qsplugin, which I guess means that the old plugins are staying. There must be a problem with the bit that sniffs for old plugins and deletes them. I have just run through the steps with my 1Password plugin, and QS did in fact delete the old plugin when QS relaunched, and kept the new one. Perhaps QS is deleting the wrong one with the Mail plugin. I am not sure as to where this takes place (probably in QSPluginManager.m somewhere). I will hopefully be able to assess a bit more this evening. |
QSPluginManager.m:565 |
Fixed the application download stuff. That's the part of the code that's the most messy, because I got distracted by the fact that QS supported various distribution formats (ditto/qspkg, dmg, zip). Right now it's fixed to qspkg for plugins, and dmg for app updates. Does that fit everybody ? I'm on IRC btw |
…vailable locally. Now the system checks the local plugins instead of only plugins about to be loaded. The difference is that plugins that have dependencies don't get added to the about to be loaded list, and thus the first one found gets loaded (which might not be the latest). Also, log an error in case an old plugin can't be removed.
Pushed a commit to my branch that fixes the duplicate plugin problem. The system was failing to register duplicates if their dependencies weren't met, and loaded the first one unconditionally when the dependency would get resolved. Since the first one is usually the one with the lower version number, it would always end up loading the older version... Example with Apple Mail Module (since I think my explanation is sketchy ;-)) :
Hope that makes more sense ;-). Now, it has a few shortcomings : |
Once again, bd81fb3 is Etienne's work and not mine. I have not checked over it... yet :) |
I don’t have a complete picture here, so I don’t know how complicated what I’m suggesting is, but perhaps the decision to delete should require both bundle ID and path to match? I was going to say maybe we should never delete from I do think we should never delete from |
At this moment the plugin is deleted, we have a complete plugin object with version et al. Adding a whitelist at this point would be easy enough. My opinion was a dialog asking the user with a "Always delete silently" checkbox, but I guess it would require a nib blah blah. I think QS handles translations on the fly, so maybe... I discussed it a little on IRC with Patrick, and we agreed that deleting wasn't really appropriate in some places, like /Applications/Quicksilver.app. It also poses problems if someone use Dropbox to sync its QS configuration with different QS versions, but that is highly doubtful. Handling that correctly would require adding min/max checking to QS (which I thought was, but it only checks for min). |
I think a dialogue would be too far and require too much user input. Plus, as you've said – QS seems to handle things pretty well at the moment already :) I think the business with different QS versions requiring different plugin versions is also far-fetched (now I've thought about it) so I don't think we have too much to worry about on that front. I will test the 'two mail plugins installed' bug that Etienne says he's now fixed, then I'm happy with all of this :D |
OK a few notes/bugs:
Other than that, it all looks good! :D I'm on IRC now if you'd like to talk! |
OK I have fixed:
Problems I can't sold (perhaps @tiennou ?!)
Final push! :D |
Seems like the functions.php (send_file function) is sending the right file size with the content-length header, but for some reason it isn't getting through to QS |
OK so after much testing it seems like it's QS's fault (B60 works fine). I'm currently running a As for the other two problems:
Almost done the |
OK.... so the bad commit IS the `Application update paths' commit. This means it's a problem with the remote PHP end and NOT Quicksilver. @tiennou - would you be able to shed any light on this? I've checked to see that the Content-Length is getting set correctly, but where could it be going wrong? I've even tried a |
...OK finally! So it's no show stopped. It seems to be a problem with just QSApp.com not giving out the data. If I manually change the location to point to GitHub it works beautifully. this'll be the case for all end-users, so we don't have to worry. I've submitted a support ticket to the hosts none-the-less. Right: |
I have to say I’ve only tested this briefly. There’s a merge conflict with the featureLevel branch, and I’d rather keep that merged in so I can make sure it’s stable. (It appears to be.) The conflict is in a XIB, so it’s nearly impossible to resolve in a text editor. Anyway, I’ll try to test it out over the weekend, but really, my priority now is getting repos set up for the new plug-ins. (I’m currently running an iTunes plug-in that I built. Unbelievable.) |
...could you make testing this and giving it the 'ok' the priority for one Once we've got this merged and the next version the world is absolutely 100% If not, then I'd say that I could merge it, seeing as 99% of the work is I can't wait to get this out! On 21 October 2011 20:44, Rob McBroom <
|
The whole point of my last message (which I forgot to include) was “don’t wait for me” because you guys have more knowledge of what’s going on than I do and my testing would just be icing on the cake. If you feel good about it, go for it. |
…dates (even if 'QSDownloadUpdatesInBackground' is not set)
Sorry, didn't realise that's what you meant! Sounds good though :)
If you're too busy/don't feel like it, I'll merge and go ahead with it all! On 22 October 2011 05:26, Rob McBroom <
|
Gah, more and more questions ! Here are a few answers (from a little while ago, sorry). (IRC time if you want, too ;-)). :
Hmm... I'll double-check that, but saving a plugin through the admin pages ought to update its timestamp. Will check that...
qs-push-plugin hasn't been updated yet, but it works through the add page if you check Application Update and provide the dmg and Info.plist.
Yes, there's a logging level for that. Right now it defaults to DEBUG, but I plan on changing it to ERROR before publicizing this.
The Info.plist are wrong. The REAL, integer base 10 number is the one in the database. Everything else lies ;-).
Right now you can access older versions by using the links on a plugin's update page. But a direct link ought to be nicer...
I'm checking... Okay, this one is hard ;-). It seems the qsapp.com host gz-compress the downloaded plugin on the file. I'm sending the Content-Length with the correct file size set, but the host deletes it afterwards, since it recompress the qspkg file... That explains why I don't get the same filesize value from PHP and at download time.
Plugins are quite small. I'm not sure about how to handle it on GitHub without a binary git repository...
Cool :p
It works, but you won't get a direct confirmation that the deletion had taken place. Note also that an older version of the plugin will be shown if available, so it could look like nothing was deleted.
It also delete uploaded files (both qspkg/dmg and qsinfo). Note, this looks broken at the moment. I can't download a plugin from the qsapp.com/plugins.php page (the download.php page sends me the QS dmg everytime...). EDIT Found out about that ;-). |
OK, got it built, it saw the update. I removed a plug-in and redownloaded it. I got the correct (newer) version. The interface still showed old versions for plug-ins that weren’t installed, but a refresh fixed that. All seems to work so far. Won’t be able to check much else until later tonight (EST). |
Great - all sounds good :) I've just upgraded to Lion (finally - had to delete my bootcamp partition), On 22 October 2011 21:34, Rob McBroom <
|
For those whom it may concern: I've moved the 'delete' button from the main index.php admin page to within On 22 October 2011 21:43, Patrick Robertson robertson.patrick@gmail.comwrote:
|
Here it is. Believe it or not...
I've merged in Etienne's things, and added a few changes of my own.
What I suggest we do now is
a) Check over all the commits. Etienne's and mine included (@tiennou - you might like to look over mine, esp. the qs-push-plugin script ones)
b) Merge and build this
c) Play around with it to make sure you can pull the list of plugins from qsapp.com, you don't get any errors when you have no internet etc., can download new plugins, can update existing plugins (I suggest you download some old ones from http://qsapp.com/plugins/archived then try to update them), anything else you can think of
d) Play around with this on a clean install (I have not done this yet)
e) check plugin installing from the setup wizard (not tested)
A few things of note:
Good luck everyone with testing. It feels so strange to actually send out a pull request on this... should it ever happen?!