Problem/Motivation
The current model for App data provision - the use of app servers providing data in a custom format - presents numerous issues.
- Apps don't function offline; see #1621474: Allow Apps to function when offline .
- Data duplication and busy work. Currently distro developers using Apps have to repeat the same information in multiple places and different formats. For the distro, they need to use .make files. In some cases, e.g., Panopoly, each app has its own .make file. But for Apps support, they need to maintain the manifest format required by Apps. Depending on requirements, this second format may be needed in two distinct places, each with its own variant format: in an app server (typically handled by editing a node body) and, if #1621474: Allow Apps to function when offline is applied, in the app's .info file. This duplication leads to significant extra work for apps developers without clear payoffs.
- Available apps lack effective versioning. An app server typically provides the latest app versions, even if these may be incompatible with a given (past) distro release.
- Apps require external infrastructure, arguably detracting from drupal.org based visibility and interoperability; see #1733748: [meta] Enable drupal.org based apps.
Proposed resolution
Allow apps to read the information they need directly from install profiles or apps connector modules in a lightly enhanced version of the existing standard format, the .make file.
In a new Apps branch, refactor to remove use of the manifest format. Instead:
- Apps reads available apps from the a make-format file that ships with either a distro or an apps connector module to determine available apps. In the case of the apps connector module, the make file would have a standard name e.g. apps.make to avoid being handled by drush (since we don't actually want the files downloaded).
- Rename hook_apps_servers_info() to hook_apps_sets_info() and replace the 'manifest' key with 'makefile'. Example for an apps connector module:
function hook_apps_sets_info() { return array( 'example' => array( 'title' => t('Apps set title'), 'description' => t('A description of the apps set.'), 'makefile' => drupal_get_path('module', 'example_apps') . '/apps.make', ), ); }Example for an install profile. The makefile can be one actually used in building a distribution, as in this example, or one that contains relevant information but is not actually used (in the case that the distro doesn't actually package the app):
function hook_apps_servers_info() { return array( 'example' => array( 'title' => t('Apps set title'), 'description' => t('A description of the apps set.'), 'makefile' => drupal_get_path('profile', 'my_profile') . '/drupal-org.make', ), ); } - Define apps-specific keys to enhance the .make format, e.g.:
projects[my_app][apps][screenshot] = "http://drupalcode.org/project/my_app.git/blob_plain/refs/heads/7.x-1.x:/screenshot.png" projects[my_app][apps][name] = "My app" projects[my_app][apps][description] = "My app does stuff." // Optional; can be used to override what's defined in the make file e.g. // to provide an apps-compatible library download or when the make // format uses git or another method that isn't supported by the upload // module's limited install functionality. projects[my_app][apps][downloadable] = "http://example.com/my_file.tar.gz" - When an app is downloaded, any .make file in the app's directory is parsed and then the relevant download files determined through querying the drupal.org update server; this code can be adapted from what's in drush make. All files are downloaded before the app is enabled, ensuring that dependencies are met. (One issue to be addressed here is that the update install functionality assumes a particular directory structure, and so won't work with all whitelisted library downloads. See #1571428-4: Cannot use archives that do not extract to folder named after downloadable.)
Implementing this approach could render #1621474: Allow Apps to function when offline unnecessary, as all App data would be available through the .make file. It could also significantly simplify the Apps module code.
Remaining tasks
User interface changes
The user experience for browsing and installing apps would be practically unchanged. The app ranking/voting functionality could be hived off into a separate module.
API changes
Developers would define available apps directly in the code of make files shipping with a distro or an apps connector module.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | apps_make-files-natively_1905718_2.patch | 5.14 KB | snig |
Comments
Comment #0.0
nedjoFlesh out implications for make files. Fix error in draft code for screenshot paths--they need to be absolute.
Comment #0.1
nedjoAdd optional "downloadable" key to apps make format. Flesh out what's needed for determining file download paths.
Comment #1
dsnopek+1 - this sounds brilliant!
Comment #1.0
dsnopekFix typo.
Comment #2
snig commentedIt's pity that the issue is not moving.
It would be great to have an option for concurrent usage of the .make file for describing the manifest.
This patch allow to use description at the .make file in the following format:
Comment #3
nedjoThanks for starting in with a patch!
On reflection, the one - potentially significant - issue I'm seeing with the approach I outlined is that it wouldn't provide a way for an install to discover newly available apps--apps made available subsequent to the last download that included the .make file. Unless, perhaps, the .make file itself was remote?
Comment #4
snig commentedhi, ty for response.
I am not sure that I understood current issue properly, but there are some points I followed while writing this patch:
1) I wanted to remove an odd remote system. I do not like the idea to put the structure on remote server that is completely available at Drupal.org (I put examples with Admin menu previously).
That means that system of Apps, that there are already at Drupal.org for example, is Main site -> App server -> get manifest from server -> load files -> apply apps
changed to: Main site -> get local .make -> load files -> apply apps
+ .make file will allow to work when apps server is offline.
2) Manifest as system of work with remote server, can be united with .make file. My patch aims at reading manifest file on the remote server at first, if it does exist, and then manifest file merge with data which were included in .make file.
This means that theoretically we would be able to update .make file only after updating of profile version (if we mean usage of .male file in profile)
We can add check that if there is the same module (with the same machine name) in manifest and if its version is higher than version of .make file, then we would use apps with higher version.
is it make sense?
Comment #5
wadmiraal commentedJust adding my 2 cents here: I think having an App server is no big deal. If the thing does go offline, it's certainly for a little time-frame. Apps could just display a message saying it cannot contact the app server, please try again (does it do that ?? never tried). It would still simplify the "grouping" of Apps (critical in a distribution context) and letting users know when new versions (or new Apps) are available.
Let's not forget the whole target audience for Apps: people that are less technically inclined. They don't necessarily understand the Drupal module approach, let alone that most modules don't work out of the box but need to be configured. Apps allows us to solve this. Having a remote App server simplifies this, as we don't expect users to update a module locally that just updates the app manifest.
Anyway, we've been discussing the .make file approach internally, and were already planning a proof of concept to submit to you guys. Which is not necessary anymore, I see :-). I think it would be huge step forward, simplifying the app server management (which is a pain). The new manifest would just list the apps, with versions (for several releases).
This would require some refactoring, obviously. And, while we're at it, we could also implement the update functionality.
For context: I'm one of the maintainers of the Opigno LMS distribution. We use the Apps infrastructure to allow end-users with little technical knowledge to download and install new modules. It's very much appreciated by our users, and we use it to provide new functionality to our users, without them having to upgrade their system.
Comment #6
budda@wadmiraal and anyone else -- has there been any internal movement on pushing these ideas forward over the past 12 months ?