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

Parse nested assumes expressions #940

Merged
merged 2 commits into from Sep 1, 2023
Merged

Conversation

cderici
Copy link
Member

@cderici cderici commented Aug 29, 2023

Description

This adds support for nested assumes expression. Without this change, pylibjuju could only parse 1-level of assumes, with this change, we can support assumes expression that look like:

assumes:
  - juju
  - any-of:
      - all-of:
          - juju >= 2.9
          - juju < 3
      - all-of:
          - juju >= 3.1
          - juju < 4

Fixes #938

QA Steps

Unfortunately it's not trivial to write an integration test for this, as the code that's been changed is part of the facade api. So we'll use the mysql-k8s charm that's been used in #938.

 $ juju version
2.9.x
 $ juju bootstrap microk8s micro28
 $ juju add-model assumes-test
 $ python -m asyncio
asyncio REPL 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0] on linux
Use "await" directly instead of "asyncio.run()".
Type "help", "copyright", "credits" or "license" for more information.
>>> import asyncio
>>> from juju import model;m=model.Model();await m.connect();await m.deploy("mysql-k8s", channel="8.0/edge", trust=True)
<Application entity_id="mysql-k8s">
>>>
exiting asyncio REPL...

Notes & Discussion

JUJU-4562

@cderici cderici added enhancement 2.9 forward port please remove label after ported labels Aug 29, 2023
@cderici cderici added this to the 2.9.44.1 milestone Aug 29, 2023
@cderici cderici requested a review from anvial August 31, 2023 19:11
Copy link
Member

@anvial anvial left a comment

Choose a reason for hiding this comment

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

lg2m

@cderici
Copy link
Member Author

cderici commented Sep 1, 2023

/merge

@jujubot jujubot merged commit b8fde2e into juju:2.9 Sep 1, 2023
11 of 12 checks passed
@cderici cderici removed the forward port please remove label after ported label Sep 4, 2023
jujubot added a commit that referenced this pull request Sep 6, 2023
#943

#### Description

This forward ports the fix for nested assume expressions from #940 into the master branch.

Fixes #938 for `3.x`.

#### QA Steps

Same QA steps can be followed from #940, so copy/pasting the manual QA steps below:

----- 

Unfortunately it's not trivial to write an integration test for this, as the code that's been changed is part of the facade api. So we'll use the `mysql-k8s` charm that's been used in #938.

```
 $ juju version
3.x
 $ juju bootstrap microk8s micro28
 $ juju add-model assumes-test
```

```python
 $ python -m asyncio
asyncio REPL 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0] on linux
Use "await" directly instead of "asyncio.run()".
Type "help", "copyright", "credits" or "license" for more information.
>>> import asyncio
>>> from juju import model;m=model.Model();await m.connect();await m.deploy("mysql-k8s", channel="8.0/edge", trust=True)
<Application entity_id="mysql-k8s">
>>>
exiting asyncio REPL...
```

#### Notes & Discussion

JUJU-4562
jujubot added a commit that referenced this pull request Sep 6, 2023
#944

## What's Changed

This is a patch release on the `2.9` track. Most significant change is the added support for nested `assumes` expressions in #940.

* Cleanup release process by @cderici in #921
* [JUJU-4488] Add licence headers to source files by @cderici in #933
* Parse nested assumes expressions by @cderici in #940

[JUJU-4488]: https://warthogs.atlassian.net/browse/JUJU-4488?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants