canonical / mysql-operator

Machine charm for MySQL following the operator framework
https://charmhub.io/mysql
Apache License 2.0
7 stars 10 forks source link

[DPE-3702] Add snap aliases for MySQL server / Router #417

Closed lucasgameiroborges closed 5 months ago

lucasgameiroborges commented 5 months ago

Issue

Missing snap aliases (ie using instead of charmed-msql.) for better tool usability inside VM.

Solution

Heavily inspired by ticket DPE-2090.

Testing

Since it is my first PR, here's how I went about testing my changes. Any feedback is appreciated!

# building local charm
tox run -e build-wrapper && mv requirements-last-build.txt requirements.txt && charmcraft pack

# deploy local charm
juju deploy ./mysql_ubuntu-22.04-amd64.charm 

# ssh into VM
juju ssh mysql/0 bash

# seeing snap aliases
snap aliases

With output:

Command                    Alias        Notes
charmed-mysql.mysql        mysql        manual
charmed-mysql.mysqlrouter  mysqlrouter  manual
charmed-mysql.mysqlsh      mysqlsh      manual
charmed-mysql.xbcloud      xbcloud      manual
charmed-mysql.xbstream     xbstream     manual
charmed-mysql.xtrabackup   xtrabackup   manual
lxd.lxc                    lxc          -
codecov[bot] commented 5 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 66.43%. Comparing base (76825fa) to head (591e79c).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #417 +/- ## ========================================== + Coverage 66.34% 66.43% +0.08% ========================================== Files 17 17 Lines 3153 3161 +8 Branches 418 418 ========================================== + Hits 2092 2100 +8 Misses 927 927 Partials 134 134 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

lucasgameiroborges commented 5 months ago

I see the check libraries test failing in every commit, including in other PRs. Is this expected?

dragomirp commented 5 months ago

I see the check libraries test failing in every commit, including in other PRs. Is this expected?

I think it's expected, since there are other outdated charm libraries.

carlcsaposs-canonical commented 5 months ago

Any feedback is appreciated! tox run -e build-wrapper && mv requirements-last-build.txt requirements.txt && charmcraft pack

would recommend pipx install charmcraftcache and tox run -e build-dev instead

(from https://github.com/canonical/mysql-operator/blob/main/CONTRIBUTING.md#developing)

lucasgameiroborges commented 5 months ago

I think I'll go ahead and merge it, then. Thanks everyone!