Implement skills (the migration-skill) and remove support for legacy assets in meta #278

Merged
merged 1 commit into from Feb 2, 2016

Conversation

Projects
None yet
4 participants
Collaborator

sergiusens commented Jan 28, 2016

This adds functionality for the migration-skill and effectively removes
support for caps, security-override, security-policy and security-template
as part of the app definition.

In addition to that, package.yaml and readme.md support is also removed.

LP: #1539122

schema/snapcraft.yaml
+ enum:
+ - migration-skill
+ security-policy:
+ ref: "#definitions/security-policy"
@zyga

zyga Jan 28, 2016

Contributor

ref or $ref?

@sergiusens

sergiusens Jan 28, 2016

Collaborator

Ah, nice catch

@sergiusens

sergiusens Jan 29, 2016

Collaborator

Now I see this is a classic press of x by mistake 😞

snapcraft/meta.py
+def _copy_security_profiles(meta_dir, uses):
+ # TODO: remove once skills are implemented.
+ for slot in uses:
+ if uses[slot]['type'] != 'migration-skill':
@zyga

zyga Jan 28, 2016

Contributor

if slot name itself is migration-skill then this should work too (type defaults to slot name)

@sergiusens

sergiusens Jan 28, 2016

Collaborator

Right, I made type mandatory in the schema (I think). Will look into how this can be done

snapcraft/tests/test_meta.py
+ }
+ self.config_data['uses'] = {
+ 'migration': {
+ 'type': 'migration-skillz',
@zyga

zyga Jan 28, 2016

Contributor

skillz?

if this is a negative test I'd rather make this more explicit.

@sergiusens

sergiusens Jan 28, 2016

Collaborator

Yeah, I'll change the type to something more obvious

Contributor

zyga commented Jan 28, 2016

A few comments inline, otherwise +1

Collaborator

sergiusens commented Jan 28, 2016

@zyga thanks for the review

+
+ if 'uses' in config_data:
+ snap_yaml['uses'] = \
+ _copy_security_profiles(meta_dir, config_data['uses'])
@kyrofa

kyrofa Jan 29, 2016

Member

Should you also copy over the offers here since, as you mentioned, you don't want to block them from being used even if we don't have a good definition for them?

@sergiusens

sergiusens Jan 29, 2016

Collaborator

There are no offers to copy. The migration-skill only applies to uses. In theory it could for frameworks, but we removed support for them in snapcraft.

This code will go away as soon as skill types start landing into the os and the migration-skill is gone.

Member

kyrofa commented Jan 29, 2016

Yeah this looks good to me. Consider changing the PR title, but 👍 !

@sergiusens sergiusens changed the title from Feature/1539122/implement skills to Implement skills (the migration-skill) and remove support for legacy assets in meta Jan 29, 2016

+ uniqueItems: true
+ items:
+ type: string
+ offers:
@mvo5

mvo5 Jan 29, 2016

Contributor

Fwiw, we don't have code for this in snappy yet.

@@ -661,6 +661,12 @@ def test_valid_security_policy_for_apps(self):
self.data['apps'] = {
'app1': {
'command': 'binary',
+ 'uses': ['migration'],
@mvo5

mvo5 Jan 29, 2016

Contributor

It says uses "migration" but the skill is called "file-migration" below?

@sergiusens

sergiusens Jan 29, 2016

Collaborator

Thanks for catching this!

Contributor

mvo5 commented Jan 29, 2016

Looks good, just one question in the tests.

Remove legacy formatting and implement skills
This adds functionality for the migration-skill and effectively removes
support for caps, security-override, security-policy and security-template
as part of the app definition.

In addition to that, package.yaml and readme.md support is also removed.

LP: #1539122
Collaborator

sergiusens commented Feb 2, 2016

Confirmed working on the latest image

sergiusens added a commit that referenced this pull request Feb 2, 2016

Merge pull request #278 from sergiusens/feature/1539122/implement_skills
Implement skills (the migration-skill) and remove support for legacy assets in meta

@sergiusens sergiusens merged commit 78ca2b2 into snapcore:master Feb 2, 2016

1 of 2 checks passed

coverage/coveralls Coverage decreased (-0.1%) to 93.19%
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@sergiusens sergiusens deleted the sergiusens:feature/1539122/implement_skills branch Feb 2, 2016

smoser pushed a commit to smoser/snapcraft that referenced this pull request Sep 14, 2016

Merge pull request #278 from brendandixon/terminate
Forward SIGTERM to spawned child process

kalikiana pushed a commit to kalikiana/snapcraft that referenced this pull request Apr 6, 2017

Merge pull request #278 from sergiusens/feature/1539122/implement_skills
Implement skills (the migration-skill) and remove support for legacy assets in meta
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment