canonical / canonical/jhack

Specify a relative path to charm using `jhack sync`

Open
#238 7 comments 0 reactions 1 assignee Claimed by @PietroPasotti View on GitHub
Dominant language
Python
Stars
60
Forks
31
Avg merge
2d 15h
Merged PRs (30d)
1

Description

Hello ! I have a small feature request regarding the `jhack sync` command. In some charms in the Data Platform team we are using a concept called single-kernel where we have a pip package holding most of the charm code and use it in different charm substrates. For instance in opensearch we have [opensearch_single_kernel](https://github.com/canonical/opensearch-single-kernel-library), so if I have a running instance of the charm and want to sync it with local code I would have to do the following
`jhack sync --source ./opensearch_single_kernel/ --remote-root /var/lib/juju/agents/unit-opensearch-0/charm/venv/lib/python3.12/site-packages/opensearch/0`

While this is actually fine, it is still bothering that I have to specify the full path which depends on the unit name each time I want to sync. Therefore I would like to know if it would be possible to have a different parameter to specify the relative path to the actual charm directory. I saw there is an option to specify __venv__ but this would sync all the venv folder which is not really what we want here.

I had a discussion with @Gu1nness as well, and it seems it would be a a good add-ons to have since we are also following the same architecture for [Mongodb](https://github.com/canonical/mongo-single-kernel-library).

Thank you !

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.