Skip to content
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

Create Plainbox Provider plugin #364

Closed
wants to merge 1 commit into from

Conversation

jocave
Copy link
Contributor

@jocave jocave commented Mar 3, 2016

lp: #1552369

It would be useful if this plugin could be released on to the 1.x series as well.

@snappy-m-o
Copy link

Can one of the admins verify this patch?

1 similar comment
@snappy-m-o
Copy link

Can one of the admins verify this patch?

@jocave jocave force-pushed the plainbox-provider-plugin branch 2 times, most recently from 9c04b9e to cf09fe5 Compare March 3, 2016 16:03
deb http://${security}.ubuntu.com/${suffix} ${release}-security main restricted
deb http://${security}.ubuntu.com/${suffix} ${release}-security universe
deb http://${security}.ubuntu.com/${suffix} ${release}-security multiverse
deb http://ppa.launchpad.net/checkbox-dev/ppa/ubuntu ${release} main
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd use stable PPA here really or make this customizable with an explicit knob.

@jocave
Copy link
Contributor Author

jocave commented Mar 4, 2016

I've updated the code to make it possible to disable the Checkbox Development PPA. Also, switched to using an explicit namespace (kept the provider name "Simple" though").

@come-maiz
Copy link
Contributor

OK to test

@come-maiz
Copy link
Contributor

retest this please

@coveralls
Copy link

Coverage Status

Coverage remained the same at 95.213% when pulling 1b738a2 on jocave:plainbox-provider-plugin into 3cc0049 on ubuntu-core:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 95.213% when pulling 2f45197 on jocave:plainbox-provider-plugin into 3cc0049 on ubuntu-core:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 95.213% when pulling db13ab5 on jocave:plainbox-provider-plugin into 3cc0049 on ubuntu-core:master.

@jocave
Copy link
Contributor Author

jocave commented Mar 21, 2016

retest this please

1 similar comment
@come-maiz
Copy link
Contributor

retest this please

@come-maiz
Copy link
Contributor

add to whitelist

@come-maiz
Copy link
Contributor

retest this please

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 95.325% when pulling 27bacbd on jocave:plainbox-provider-plugin into 889fe87 on ubuntu-core:master.

super().__init__(name, options)
self.build_packages.extend(['python3-plainbox', 'intltool'])
if self.options.checkbox_dev_ppa:
self._PLUGIN_STAGE_SOURCES = self._DEV_PPA_PLUGIN_STAGE_SOURCES
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this _PLUGIN_STAGE_SOURCES is not a constant, so it shouldn't be all capital letters.
_plugin_stage_sources.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, not from your branch. After you merge I'll propose something to change it.

For you, it seems safer to overwrite the PLUGIN_STAGE_SOURCES @Property, instead of dealing with the internal attribute.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, don't take advantage of internal implementation details which are subject to change 😉

@come-maiz
Copy link
Contributor

👍 from me.
Can you please remove the icon? It's not needed, and I think it's better to keep the test snaps with only the required bits.

description: |
Create a snap of a very simple plainbox that could
then be used by a checkbox application
icon: icon.png
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this entry please

@sergiusens
Copy link
Collaborator

git rm integration_tests/snaps/simple-plainbox-provider/icon.png

@jocave
Copy link
Contributor Author

jocave commented Mar 23, 2016

Pushed commit with icon file removed from simple-plainbox-provider integration test.

@sergiusens
Copy link
Collaborator

git mv integration_tests/test_plainbox_provider_plugin.py integration_tests/test_plugin_plainbox_provider.py

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 95.325% when pulling 885ef55 on jocave:plainbox-provider-plugin into 889fe87 on ubuntu-core:master.

schema['properties']['checkbox-dev-ppa'] = {
'type': 'boolean',
'default': 'true',
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since you aren't overriding properties it seems you are making use of the common source options, can you add that piece of information to the doc string?

@sergiusens
Copy link
Collaborator

Thanks for this, I have a bunch of open questions in there though.

Also, does this rely on python provided by the os snap? It is fine from my PoV, just want to make sure.

@sergiusens
Copy link
Collaborator

Given the previous comment I would like to see an example and an example_test (which would run on a snappy system)

@come-maiz
Copy link
Contributor

The example test would be so nice, indeed.
@jocave take a look at the examples_tests dir. Give me a shout if you need a hand with that one.

@jocave
Copy link
Contributor Author

jocave commented Mar 23, 2016

Thank you for the reviews, I will put an example together and try and address the questions ASAP.

@jocave jocave force-pushed the plainbox-provider-plugin branch 2 times, most recently from e76d48a to 318332b Compare March 24, 2016 14:18
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 95.739% when pulling 318332b on jocave:plainbox-provider-plugin into 3c2081a on ubuntu-core:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 95.739% when pulling 0b894a7 on jocave:plainbox-provider-plugin into 3c2081a on ubuntu-core:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 95.744% when pulling 19140e7 on jocave:plainbox-provider-plugin into 56894e8 on ubuntu-core:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 95.744% when pulling 6b1bde0 on jocave:plainbox-provider-plugin into 56894e8 on ubuntu-core:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 95.744% when pulling 5b07527 on jocave:plainbox-provider-plugin into 56894e8 on ubuntu-core:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 95.753% when pulling aad99ce on jocave:plainbox-provider-plugin into b18e4e9 on ubuntu-core:master.

@jocave jocave force-pushed the plainbox-provider-plugin branch from aad99ce to 6d62c48 Compare May 6, 2016 13:28
lp: #1552369

Integration tests provided that check the plugin can be
used in several common Checkbox use cases.
@jocave jocave force-pushed the plainbox-provider-plugin branch from 6d62c48 to af05e90 Compare May 6, 2016 16:05
@jocave
Copy link
Contributor Author

jocave commented May 9, 2016

I have added integration tests to cover a set of what I think are expected use cases for this plugin. One of these fails with a python import error for module 'plainbox'. This is provided by the package python3-plainbox which is explicitly added to the build-package list by the plugin.

I would like to know how to guarantee that 'build-package' works as advertised.

@sergiusens
Copy link
Collaborator

@jocave build-packages will just land on the host and be used to build the system, there is additional magic to crawl everything ELF and bring in any .so it needs not provided in the snap/part area.

stage-packages however, which is what you use in your examples are a bit tricky, specially when it comes to python as you will need to define a PYTHONPATH for this.

Given this still needs a few twists and turns I am going to close it for now. Feel free to reopen when ready.

@sergiusens sergiusens closed this May 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants