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

plugins: introduce v2.PluginV2 and v2.NilPlugin #3022

Merged
merged 19 commits into from Apr 10, 2020

Conversation

sergiusens
Copy link
Collaborator

There's just enough scaffolding in place to allow for the plugin to
load.

PluginHandler has been extended to determine when a PluginV2 is being
used (PluginHandler should be renamed to PartHandler).

Some extra attribute were added to PluginV2 to minimize the changes
required in PluginHandler.

Old code handling state file migration in PluginHandler._do_build was
removed as that was done before the migration to bases (meaning that
no base using Snapcraft project needs this).

Signed-off-by: Sergio Schvezov sergio.schvezov@canonical.com

  • Have you followed the guidelines for contributing?
  • Have you signed the CLA?
  • Have you successfully run ./runtests.sh static?
  • Have you successfully run ./runtests.sh tests/unit?

Rely less on setting from the plugin and remove duplicate attributes
already held by Project and Project._snap_meta.

This involved a general cleanup.

Signed-off-by: Sergio Schvezov <sergio.schvezov@canonical.com>
There's just enough scaffolding in place to allow for the plugin to
load.

PluginHandler has been extended to determine when a PluginV2 is being
used (PluginHandler should be renamed to PartHandler).

Some extra attribute were added to PluginV2 to minimize the changes
required in PluginHandler.

Old code handling state file migration in PluginHandler._do_build was
removed as that was done before the migration to bases (meaning that
no base using Snapcraft project needs this).

Signed-off-by: Sergio Schvezov <sergio.schvezov@canonical.com>
@cjp256
Copy link
Contributor

cjp256 commented Apr 9, 2020

@sergiusens
Copy link
Collaborator Author

@cjp256 yeah, fixed them earlier, my push got stuck on my ssh keys...

isinstance(self.plugin, plugins.v1.PluginV1)
and self.plugin.out_of_source_build
):
if os.path.exists(self.part_build_dir):
Copy link
Contributor

Choose a reason for hiding this comment

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

so this will always happen with v2?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I suppose this is what we just discussed not doing and you were going to look into. I can remove the rm entirely and we can see what happens

Copy link
Contributor

Choose a reason for hiding this comment

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

i thought we discussed the opposite. v2 would leave the build directory alone and incremental builds would work?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

exactly, but I did this before that conversation, that's all I am saying :-)

Copy link
Contributor

Choose a reason for hiding this comment

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

I say let's make the change now :)

cjp256
cjp256 previously approved these changes Apr 10, 2020
Copy link
Contributor

@cjp256 cjp256 left a comment

Choose a reason for hiding this comment

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

if you want to change the v2 build clean... i'd suggest doing it now, but otherwise lgtm

isinstance(self.plugin, plugins.v1.PluginV1)
and self.plugin.out_of_source_build
):
if os.path.exists(self.part_build_dir):
Copy link
Contributor

Choose a reason for hiding this comment

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

I say let's make the change now :)

@sergiusens sergiusens merged commit 629169d into canonical:master Apr 10, 2020
@sergiusens sergiusens deleted the plugin-v2 branch April 10, 2020 22:17
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

2 participants