Conversation
10dde28 to
f427dce
Compare
mr-cal
left a comment
There was a problem hiding this comment.
Looking good!
I'm not sure if the criteria for this task is to upstream or upstream and de-duplicate redundant code. My comments are based on the latter.
The de-duplication is only possible now that this is internal to craft-providers and therefore can import other internal modules.
Either way, I would like to have an integration test for the configure and remove hooks.
cmatsuoka
left a comment
There was a problem hiding this comment.
The way the module data is organized is making the code hard to read, I think we can refactor this to make it easier for our future selves to rework this if needed. Also please add a description of the problem being solved to the PR so we can check if the implementation is doing everything that it's supposed to do.
@cmatsuoka I reworked the description to add more detail, how does that look now? |
Awesome - based on the task pointage I was just going to upstream, not deduplicate. I also didn't realize there would be so much deduplication possible - thanks for pointing all that out! I'll open another ticket to capture your knowledge drop. Re: integration tests, the private repo that this originated from has spread tests that do this, I'll see if I can rework those into integration tests here. |
Lightly modified to remove proprietary identifiers, not functional in this state.
- This way is also simpler in the code, with a slight performance hit for the regex. - There's no way to get the full compat tag without having a fully-instantiated application. - Also fixed some debug output.
42c5ae1 to
077854f
Compare
* feat: mknod intercepts now configurable from LXDProvider * fix: unit test * fix: lint * docs: update changelog (also includes item from #710)
…ks in Rockcraft. (#721) * ci: install lxd on ubuntu 24.04 Signed-off-by: Callahan Kovacs <callahan.kovacs@canonical.com> * ci: install lxd from the candidate channel Signed-off-by: Callahan Kovacs <callahan.kovacs@canonical.com> * docs: remove starter pack submodule (#713) Signed-off-by: Callahan Kovacs <callahan.kovacs@canonical.com> * fix: use Multipass-compatible instance names (#712) Signed-off-by: Callahan Kovacs <callahan.kovacs@canonical.com> * feat: upstream snap hooks (#710) * feat: add hookutil from downstream repo Lightly modified to remove proprietary identifiers, not functional in this state. * feat: make hookutil work generically * chore: disable lint check - may change approach later * feat: add unit tests from downstream * chore: linter issues * fix: craft-providers CI doesn't have lxd, mock it out * chore(style): rename per code review * chore(style): rename per code review * chore(style): rename per code review * chore: update changed names in test * refactor: remove globals, let LXDInstances keep project_name * chore: autoformat * fix: compat tag structure had been dependent on craft-application - This way is also simpler in the code, with a slight performance hit for the regex. - There's no way to get the full compat tag without having a fully-instantiated application. - Also fixed some debug output. * feat(tests): add configure hook integration test * feat: added remove hook test and beefed up configure hook test * chore: autoformat * fix: unit tests for changed interface * chore: autoformat, this time with the other tool! * chore: autoformat the third * fix: use the superior is-installed check from c-prov proper * fix: lint * feat: mknod intercepts now configurable from LXDProvider (#717) * feat: mknod intercepts now configurable from LXDProvider * fix: unit test * fix: lint * docs: update changelog (also includes item from #710) * feat: add modify_file method to Executor class * feat: add properties for getting setting pro services applied to environment * feat: make pull optional in Executor.modify_file * fix(LXDInstance): missing pro_services file returns none * trigger ci * refactor: adjustments to satisfy linters --------- Signed-off-by: Callahan Kovacs <callahan.kovacs@canonical.com> Co-authored-by: Callahan Kovacs <callahan.kovacs@canonical.com> Co-authored-by: Matt Culler <matt.culler@canonical.com>
…ks in Rockcraft. (canonical#721) * ci: install lxd on ubuntu 24.04 Signed-off-by: Callahan Kovacs <callahan.kovacs@canonical.com> * ci: install lxd from the candidate channel Signed-off-by: Callahan Kovacs <callahan.kovacs@canonical.com> * docs: remove starter pack submodule (canonical#713) Signed-off-by: Callahan Kovacs <callahan.kovacs@canonical.com> * fix: use Multipass-compatible instance names (canonical#712) Signed-off-by: Callahan Kovacs <callahan.kovacs@canonical.com> * feat: upstream snap hooks (canonical#710) * feat: add hookutil from downstream repo Lightly modified to remove proprietary identifiers, not functional in this state. * feat: make hookutil work generically * chore: disable lint check - may change approach later * feat: add unit tests from downstream * chore: linter issues * fix: craft-providers CI doesn't have lxd, mock it out * chore(style): rename per code review * chore(style): rename per code review * chore(style): rename per code review * chore: update changed names in test * refactor: remove globals, let LXDInstances keep project_name * chore: autoformat * fix: compat tag structure had been dependent on craft-application - This way is also simpler in the code, with a slight performance hit for the regex. - There's no way to get the full compat tag without having a fully-instantiated application. - Also fixed some debug output. * feat(tests): add configure hook integration test * feat: added remove hook test and beefed up configure hook test * chore: autoformat * fix: unit tests for changed interface * chore: autoformat, this time with the other tool! * chore: autoformat the third * fix: use the superior is-installed check from c-prov proper * fix: lint * feat: mknod intercepts now configurable from LXDProvider (canonical#717) * feat: mknod intercepts now configurable from LXDProvider * fix: unit test * fix: lint * docs: update changelog (also includes item from canonical#710) * feat: add modify_file method to Executor class * feat: add properties for getting setting pro services applied to environment * feat: make pull optional in Executor.modify_file * fix(LXDInstance): missing pro_services file returns none * trigger ci * refactor: adjustments to satisfy linters --------- Signed-off-by: Callahan Kovacs <callahan.kovacs@canonical.com> Co-authored-by: Callahan Kovacs <callahan.kovacs@canonical.com> Co-authored-by: Matt Culler <matt.culler@canonical.com>
tox?Applications using craft-providers may inadvertently leave around lxc instances, either when new base instances supersede old ones, or when the application is uninstalled. Add a module implementing logic that applications can use in configure and remove snap hooks to prune these unneeded lxc instances.