Merge lp://qastaging/~michael-sheldon/ubuntu-download-manager/qml-api-improvements into lp://qastaging/ubuntu-download-manager

Proposed by Michael Sheldon
Status: Merged
Approved by: Jonas G. Drange
Approved revision: 365
Merged at revision: 364
Proposed branch: lp://qastaging/~michael-sheldon/ubuntu-download-manager/qml-api-improvements
Merge into: lp://qastaging/ubuntu-download-manager
Diff against target: 739 lines (+404/-33)
12 files modified
src/common/public/ubuntu/transfers/metadata.cpp (+35/-4)
src/common/public/ubuntu/transfers/metadata.h (+7/-2)
src/downloads/qml/metadata.cpp (+39/-0)
src/downloads/qml/metadata.h (+10/-0)
src/downloads/qml/single_download.cpp (+49/-3)
src/downloads/qml/single_download.h (+10/-0)
tests/downloads/daemon/test_metadata.cpp (+59/-18)
tests/downloads/daemon/test_metadata.h (+10/-6)
tests/downloads/qml/test_metadata.cpp (+51/-0)
tests/downloads/qml/test_metadata.h (+6/-0)
tests/downloads/qml/test_single_download.cpp (+122/-0)
tests/downloads/qml/test_single_download.h (+6/-0)
To merge this branch: bzr merge lp://qastaging/~michael-sheldon/ubuntu-download-manager/qml-api-improvements
Reviewer Review Type Date Requested Status
system-apps-ci-bot continuous-integration Needs Fixing
Jonas G. Drange (community) Needs Information
PS Jenkins bot continuous-integration Approve
Review via email: mp+291894@code.qastaging.launchpad.net

Commit message

Expose post-processing command to unconfined clients via QML, expose hashing support via QML and allow clients to set custom metadata.

Description of the change

Expose post-processing command to unconfined clients via QML, expose hashing support via QML and allow clients to set custom metadata.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
363. By Michael Sheldon

Merge from trunk

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
364. By Michael Sheldon

Add tests for new QML API and custom metadata

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Jonas G. Drange (jonas-drange) wrote :

I've encountered a couple of issues in using this new qml feature that might be caused by ignorance on my part, please bear with me.

First, when I create a SingleDownload and add a Metadata object to it, no matter what values I set on the Metadata object, it is ignored. E.g., I do:

    Component { id: sdl; SingleDownload {} }
    Component { id: mdt; Metadata {} }

    var singleDownloadObj = sdl.createObject(UpdateManager, {
        "autoStart": false,
        "hash": hash,
        "algorithm": algorithm,
        "headers": headers // A QVariantMap of headers
    });

    var metadataObj = mdt.createObject(UpdateManager, metadata); // QVariantMap of metadata
    singleDownloadObj.metadata = metadataObj;
    singleDownloadObj.download(url);

What I get in the downloads.sql database is:

    sqlite> select * from SingleDownload;
    a634b6f8888d48309f51f2d9d3b960d4|unconfined|http://localhost:9009/download|/com/canonical/applications/download/a634b6f8888d48309f51f2d9d3b960d4|/home/jonas/.local/share/ubuntu-download-manager/Downloads/download (11)|1232223sdfdsffs|sha512|idle|0|0|{
        "app-id": "/usr/bin/system-settings"
    }
    |{
    }

This seems to happen because in qml/single_download.cpp:232 we have:
    SingleDownload::download(QString url)
    …
    Metadata metadata;
    QMap<QString, QString> headers;
    DownloadStruct dstruct(url, m_hash, m_algorithm, metadata.map(), headers);
    m_manager->createDownload(dstruct);

I.e. m_metadata and m_headers are ignored. Am I not supposed to call SingleDownload.download?

Secondly, even though the sqlite output from above have “app-id” set to “/usr/bin/system-settings”, the sqlite “appId” field is set to “unconfined”. For the QML plugin to returned unconfined downloads (not using u-a-l), I have to specifically set APP_ID=unconfined. Is this expected?

review: Needs Information
Revision history for this message
system-apps-ci-bot (system-apps-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
365. By Michael Sheldon

Invalidate internal download object when an error occurs as the remote end will have removed the download, and always keep a copy of metadata available for reading after an error or when a download has finished

Revision history for this message
system-apps-ci-bot (system-apps-ci-bot) wrote :

FAILED: Continuous integration, rev:365
https://jenkins.canonical.com/system-apps/job/lp-ubuntu-download-manager-ci/5/
Executed test runs:
    FAILURE: https://jenkins.canonical.com/system-apps/job/build/945/console
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-0-fetch/945
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-1-sourcepkg/release=vivid+overlay/850
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-1-sourcepkg/release=xenial+overlay/850
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-1-sourcepkg/release=yakkety/850
    FAILURE: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/847/console
    FAILURE: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial+overlay/847/console
    FAILURE: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=yakkety/847/console
    FAILURE: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/847/console
    FAILURE: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial+overlay/847/console
    FAILURE: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=yakkety/847/console
    FAILURE: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/847/console
    FAILURE: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial+overlay/847/console
    FAILURE: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=yakkety/847/console

Click here to trigger a rebuild:
https://jenkins.canonical.com/system-apps/job/lp-ubuntu-download-manager-ci/5/rebuild

review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches