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-3253] add missing force in bundle deployment #815

Merged

Conversation

juanmanuel-tirado
Copy link
Contributor

@juanmanuel-tirado juanmanuel-tirado commented Mar 14, 2023

Description

Fix #814

This PR propagates the force argument and use it to deploy bundles.

QA Steps

Following the example from #814

from juju.model import Model

model = Model()
await model.connect_current()
await model.deploy("weebl", series="jammy")

The code above will fail. Nevertheless, if we use force=True the deployment will be sucessful.

await model.deploy("weebl", series="jammy")

Notes & Discussion

A similar problem may occur for other use cases.
This has to be propagated to the master branch.

@juanmanuel-tirado juanmanuel-tirado added the hint/2.9 going on 2.9 branch label Mar 14, 2023
Copy link
Contributor

@cderici cderici left a comment

Choose a reason for hiding this comment

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

QA went well. Code LGTM 👍

@juanmanuel-tirado juanmanuel-tirado merged commit 9598a6e into juju:2.9 Mar 15, 2023
cderici pushed a commit to cderici/python-libjuju that referenced this pull request Apr 26, 2023
* Propagate force parameter to resolve function to enable force for remote bundles.
juanmanuel-tirado added a commit that referenced this pull request May 5, 2023
* [JUJU-3202] Add facades for 3.1.1. (#807)

* Add facades for 3.1.1.

* Update secrets backend test.

* Add destroy-units to destroy several units at once

Fixes #811

* Add integration test for destroy_units

* [JUJU-3517] Revisit _build_facades in connection (#826)

The main change here is that we no longer raise an exception in the
case of an unknown facade.

* Added 3.1.2 and 3.2-beta2 schemas.

* Add capability for deploying by revision

by passing the revision info through the ResolveCharm api call.

fixes #690

* Add example for deploy with revision

that deploys juju-qa-test --channel 2.0/stable --revision 22

* Add revision parameter in LocalDeployType.resolve

Note that --revision is only used for charmhub charms, so we're not
passing this info into the CharmOrigin for local charms.

* Add integration test for deploy by revision success

* Add validation for --revision flag to require --channel flag

This is needed because in libjuju we default to latest/stable if no
channel is specified. It is dangerous if we don't add this check
because without it the libjuju would deploy the wrong revision without
an exception if --revision is used but no --channel is given.

* Add validation for bundles to require either --revision or --channel

Otherwise fail early without making any additional API calls.

* Add integration test for making sure the --required and --channel
flags are validated before deploying charms or bundles

* [JUJU-3253] add missing force in bundle deployment (#815)

* Propagate force parameter to resolve function to enable force for remote bundles.

* Pass series info into origin for ResolveCharm

Without the series the ResolveCharm will select the latest base for
the charm. E.g. even if we want focal, the ResolveCharm will return
22.04 (jammy) for the base channel in the resulting origin if the
charm supports both jammy and focal.

This communicates the series info with the ResolveCharm via the
inputted origin so the resulting origin will have the correct base
channel.

Fixes #822

* Fix _resolve_charm errors

That are accidentally introduced in #825.

* _resolve_charm's force parameter is made optional
* fixed the _resolve_charm calls in bundle.py to have less number of
variables to unpack onto

* Change charm channel in bundle for test

* Rename example with consistent name

* Implement series selector for charm resolution

This selector will be used after the ResolveCharms api call, and use
the supported series and the base information returned to select the
appropriate series to construct the correct base for the charm. Then
it's given to the AddCharm in normal the deploy process.

* Add unit tests for series selector functionality

* Utilize the series selector to construct the correct base for charms

The main change is in the _resolve_charm that's used in the model and
bundle deploy code path. We pass in the series info whenever we can
into the ResolveCharm call, then use its result to run the series
selector, then construct the base using that and finally pass the
origin to the AddCharm. Note that the ResolveCharm API call is made no
more than once.

* Fix unit tests for bundle change runs

* Add integration test to challenge the resolver to find an old corrrect revision

This is basically testing what is manually reported by
@juanmanuel-tirado in the following review:

#830 (comment)

* [JUJU-3552] Prepare 3.1.2.1 release (#836)

* Add juju 3.1.2 missing facades. 
* Fix secrets-bakend-lifecycle test.
* Increase testing timeouts.
* Revisit postgresql charm to be downloaded.
---------

Co-authored-by: Juju bot <[email protected]>
Co-authored-by: Caner Derici <[email protected]>

* Prepare release notes for 3.1.2.0. (#843)

* Prepare release notes for 3.1.2.0.

---------

Co-authored-by: Caner Derici <[email protected]>
Co-authored-by: Juju bot <[email protected]>
jujubot added a commit that referenced this pull request May 11, 2023
#848

## What's Changed
* [JUJU-3253] add missing force in bundle deployment by @juanmanuel-tirado in #815
* [JUJU-3348] Fix assumes parsing by @juanmanuel-tirado in #820
* [JUJU-3404] Pass series info into origin for ResolveCharm by @cderici in #825
* Fix _resolve_charm errors by @cderici in #834
* [JUJU-3583] wait_for_idle to not block when enough units are ready by @cderici in #840
* [JUJU-3565] Expect and handle exceptions from the AllWatcher task by @cderici in #833
* Fixes to pass the CI problems regarding missing postgresql charm. by @juanmanuel-tirado in #847
* [JUJU-3641] Fix local charm base channel discovery by @cderici in #846


[JUJU-3253]: https://warthogs.atlassian.net/browse/JUJU-3253?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[JUJU-3348]: https://warthogs.atlassian.net/browse/JUJU-3348?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[JUJU-3404]: https://warthogs.atlassian.net/browse/JUJU-3404?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[JUJU-3583]: https://warthogs.atlassian.net/browse/JUJU-3583?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[JUJU-3565]: https://warthogs.atlassian.net/browse/JUJU-3565?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[JUJU-3641]: https://warthogs.atlassian.net/browse/JUJU-3641?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
@cderici cderici added the area/forward-port to be forward ported - remove label after port label May 31, 2023
@cderici cderici removed the area/forward-port to be forward ported - remove label after port label Jun 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hint/2.9 going on 2.9 branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants