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

[JUJU-1671] Charmhub url from model config #724

Merged
merged 5 commits into from
Sep 6, 2022

Conversation

cderici
Copy link
Contributor

@cderici cderici commented Aug 31, 2022

Description

Before this change, the api host address for the charmhub was hard-coded. This change allows fetching the api address from the model config.

QA Steps

tox -e integration -- tests/integration/test_charmhub.py

@cderici cderici requested a review from jack-w-shaw August 31, 2022 22:40
@cderici cderici force-pushed the charmhub-url-from-model-config branch from e5885f1 to ffd8e17 Compare September 1, 2022 20:45
@cderici
Copy link
Contributor Author

cderici commented Sep 1, 2022

/build

url = "https://api.snapcraft.io/v2/charms/info/{}?fields=default-release.revision.subordinate".format(charm_name)
model_conf = await self.model.get_config()
charmhub_url = model_conf['charmhub-url']
url = "{}/v2/charms/info/{}?fields=default-release.revision.subordinate".format(charmhub_url.value, charm_name)
Copy link
Member

Choose a reason for hiding this comment

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

Now that we've dropped Python 3.5 support we can use fstrings right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I agree 👍 we should probably turn all the formattings into fstrings at some point

Copy link
Member

@jack-w-shaw jack-w-shaw left a comment

Choose a reason for hiding this comment

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

LGTM. One small q

@cderici
Copy link
Contributor Author

cderici commented Sep 2, 2022

I think there's something going on in the tests, none of them is finished, it's more than likely about this change, it's blocking for some reason. Will investigate 👍

@cderici
Copy link
Contributor Author

cderici commented Sep 6, 2022

/build

@cderici
Copy link
Contributor Author

cderici commented Sep 6, 2022

/merge

@jujubot jujubot merged commit 94a3677 into juju:master Sep 6, 2022
jujubot added a commit that referenced this pull request Oct 6, 2022
#739

## What's Changed

* Model name can now be accessed through model.name by @jack-w-shaw in #702
* [JUJU-1593] Fix `unit.run()` and update the old client codes by @cderici in #710
* Add py.typed marker by @sed-i in #709
* [JUJU-1664] Add force, no-wait, destroy-storage params to app.destroy by @cderici in #714
* snapcraft.io access should use https requests by @addyess in #715
* [JUJU-1680] Add issue and PR templates by @cderici in #718
* [JUJU-1681] Add --attach-storage parameter to model.deploy by @cderici in #720
* [JUJU-1706] Allow waiting for `wait_for_exact_units=0` by @cderici in #723
* [JUJU-1663] Drop Python 3.5 support from python-libjuju by @cderici in #722
* [JUJU-1671] Charmhub url from model config by @cderici in #724
* [JUJU-1733] Revisit unitrun example by @cderici in #725
* [JUJU-1800] Revise the `application.upgrade_charm()` (refresh) by @cderici in #729
* [JUJU-1893] Revisit `charmhub.info()` by @cderici in #737

[JUJU-1593]: https://warthogs.atlassian.net/browse/JUJU-1593?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[JUJU-1664]: https://warthogs.atlassian.net/browse/JUJU-1664?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[JUJU-1680]: https://warthogs.atlassian.net/browse/JUJU-1680?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[JUJU-1681]: https://warthogs.atlassian.net/browse/JUJU-1681?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[JUJU-1706]: https://warthogs.atlassian.net/browse/JUJU-1706?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[JUJU-1663]: https://warthogs.atlassian.net/browse/JUJU-1663?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[JUJU-1671]: https://warthogs.atlassian.net/browse/JUJU-1671?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
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.

3 participants