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

Use backwards incompatible change from ansible-compat 4.0.1 #3904

Merged
merged 7 commits into from
Jun 7, 2023

Conversation

asmacdo
Copy link
Contributor

@asmacdo asmacdo commented May 1, 2023

Fixes #3903

ansible/ansible-compat#256

I made this change direct in my site-packages and it fixed the issue i was having. (3903)

Let me know if it needs anything else!

@asmacdo asmacdo requested review from a team as code owners May 1, 2023 18:29
@asmacdo asmacdo requested review from Shaps, apatard, cidrblock, priyamsahoo and shatakshiiii and removed request for a team May 1, 2023 18:29
@github-actions github-actions bot added the bug label May 1, 2023
@asmacdo
Copy link
Contributor Author

asmacdo commented May 1, 2023

Bump to ansible-compat 4.0.1 causes other dependency issues. I guess we could require ansible-compat<=4.0.0

I'll wait for a maintainer to suggest what to do next. (I'm happy to do it, but if you'd rather not wait go ahead :)

bodsch added a commit to bodsch/ansible-openvpn that referenced this pull request May 2, 2023
bodsch added a commit to bodsch/ansible-openvpn that referenced this pull request May 2, 2023
* change openvpn push information
* add molecule test for unconfigured role
test some molecule THINGS (see ansible-community/molecule-plugins#148, ansible/molecule#3904)
vitabaks added a commit to vitabaks/autobase that referenced this pull request May 2, 2023
There is an improperly handled breaking change in ansible-compat, which causes a malfunction in molecule. As a result, you should enforce the usage of ansible-compat==3.0.1 instead of version 4.0.1 (at least until the necessary fix is provided in molecule ansible/molecule#3904 ).
@ssbarnea
Copy link
Member

ssbarnea commented May 3, 2023

@asmacdo Please continue on this, we do want to switch to the new version and the API changes are not so many, mainly is about switching to Path objects for paths and exec being renamed to run.

For the moment I made a v.5.0.1 hotfix which prevents used of newer compat, at least until we can get your fix in.

hswong3i added a commit to alvistack/ansible-community-molecule that referenced this pull request May 4, 2023
    git clean -xdf
    tar zcvf ../python-molecule_5.0.1.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp python-molecule.spec ../python-molecule_5.0.1-1.spec
    mv ../python*-molecule*5.0.1*.{gz,xz,spec,dsc} /osc/home\:alvistack/ansible-community-molecule-5.0.1/
    rm -rf ../python*-molecule*5.0.1*.*

See ansible#3904

Signed-off-by: Wong Hoi Sing Edison <[email protected]>
hswong3i added a commit to alvistack/ansible-community-molecule that referenced this pull request May 4, 2023
    git clean -xdf
    tar zcvf ../python-molecule_5.0.0.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp python-molecule.spec ../python-molecule_5.0.0-1.spec
    mv ../python*-molecule*5.0.0*.{gz,xz,spec,dsc} /osc/home\:alvistack/ansible-community-molecule-5.0.0/
    rm -rf ../python*-molecule*5.0.0*.*

See ansible#3904

Signed-off-by: Wong Hoi Sing Edison <[email protected]>
hswong3i added a commit to alvistack/ansible-community-molecule that referenced this pull request May 5, 2023
    git clean -xdf
    tar zcvf ../python-molecule_5.0.0.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp python-molecule.spec ../python-molecule_5.0.0-1.spec
    mv ../python*-molecule*5.0.0*.{gz,xz,spec,dsc} /osc/home\:alvistack/ansible-community-molecule-5.0.0/
    rm -rf ../python*-molecule*5.0.0*.*

See ansible#3904

Signed-off-by: Wong Hoi Sing Edison <[email protected]>
hswong3i added a commit to alvistack/ansible-community-molecule that referenced this pull request May 5, 2023
    git clean -xdf
    tar zcvf ../python-molecule_5.0.1.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp python-molecule.spec ../python-molecule_5.0.1-1.spec
    mv ../python*-molecule*5.0.1*.{gz,xz,spec,dsc} /osc/home\:alvistack/ansible-community-molecule-5.0.1/
    rm -rf ../python*-molecule*5.0.1*.*

See ansible#3904

Signed-off-by: Wong Hoi Sing Edison <[email protected]>
@asmacdo asmacdo changed the title One more s/exec/run/ Use backwards incompatible change from ansible-compat 4.0.1 May 8, 2023
@asmacdo asmacdo force-pushed the fix-ansible-compat branch 3 times, most recently from 56b7b8b to d41d195 Compare May 8, 2023 15:49
@asmacdo
Copy link
Contributor Author

asmacdo commented May 8, 2023

@ssbarnea I think we're good to merge!

hswong3i added a commit to alvistack/ansible-community-molecule that referenced this pull request May 10, 2023
    git clean -xdf
    tar zcvf ../python-molecule_5.0.0.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp python-molecule.spec ../python-molecule_5.0.0-1.spec
    mv ../python*-molecule*5.0.0*.{gz,xz,spec,dsc} /osc/home\:alvistack/ansible-community-molecule-5.0.0/
    rm -rf ../python*-molecule*5.0.0*.*

See ansible#3904

Signed-off-by: Wong Hoi Sing Edison <[email protected]>
hswong3i added a commit to alvistack/ansible-community-molecule that referenced this pull request May 10, 2023
    git clean -xdf
    tar zcvf ../python-molecule_5.0.1.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp python-molecule.spec ../python-molecule_5.0.1-1.spec
    mv ../python*-molecule*5.0.1*.{gz,xz,spec,dsc} /osc/home\:alvistack/ansible-community-molecule-5.0.1/
    rm -rf ../python*-molecule*5.0.1*.*

See ansible#3904

Signed-off-by: Wong Hoi Sing Edison <[email protected]>
@ziegenberg
Copy link
Contributor

I think, as soon as we have ansible-compat 4.1.2 in here it's good to go.

.config/requirements.in Outdated Show resolved Hide resolved
ansible-compat 4.0.1 included a breaking change. If we want to use
latest, minimum version must be at least 4.0.1.

ansible-compat < 4.1.2 has an issue that causes an unhandled exception
for certain log levels. ansible/ansible-lint#3522
Since this issue caused CI trouble, we go ahead and bump to 4.1.2.
asmacdo and others added 3 commits June 5, 2023 12:58
=== Do not change lines below ===
{
 "chain": [],
 "cmd": "pip-compile --no-annotate --output-file=.config/requirements-lock.txt --resolver=backtracking --strip-extras --unsafe-package=ruamel-yaml-clib pyproject.toml",
 "exit": 0,
 "extra_inputs": [],
 "inputs": [],
 "outputs": [],
 "pwd": "."
}
^^^ Do not change lines above ^^^
Currently the tests fail for `test_command_init_role` and
`test_command_init_scneario`. The tests execute `ansible-lint` on the
newly-created roles and the linter recently got more restrictive, so we
now have to adapt.
@asmacdo
Copy link
Contributor Author

asmacdo commented Jun 5, 2023

bumped, recompiled requirements, rebased. Should be good to go if CI is happy 🤞

ty @zhan9san @ziegenberg

@ziegenberg
Copy link
Contributor

Did you miss updating .config/requirements.txt?

@ziegenberg
Copy link
Contributor

@asmacdo could you have a look and fix the CI problems?

=== Do not change lines below ===
{
 "chain": [],
 "cmd": "pip-compile --extra=docs --extra=test --no-annotate --output-file=.config/requirements.txt --resolver=backtracking --strip-extras pyproject.toml",
 "exit": 0,
 "extra_inputs": [],
 "inputs": [],
 "outputs": [],
 "pwd": "."
}
^^^ Do not change lines above ^^^
Copy link
Contributor

@ziegenberg ziegenberg left a comment

Choose a reason for hiding this comment

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

@asmacdo CI is now almost happy.

.config/requirements-lock.txt Outdated Show resolved Hide resolved
.config/requirements.txt Outdated Show resolved Hide resolved
I used 3.10, but CI will run this on 3.9, and fail if there is a diff.
This means it is safe to change this by hand, since it will be checked.
@ziegenberg ziegenberg self-requested a review June 6, 2023 14:29
@zhan9san zhan9san merged commit 3f97a41 into ansible:main Jun 7, 2023
@alessfg
Copy link

alessfg commented Jun 19, 2023

Any chance you could create a new release to allow us to use the latest versions of Molecule and Ansible Lint simultaneously? 😄

@hswong3i
Copy link
Contributor

@alessfg you may manually patch the installed molecule v5.0.1, e.g.

$ sudo -E podman run -ti --rm ubuntu:22.04 bash

root@38a5c29f4af4:/# apt update && apt -y full-upgrade && apt -y install python3-dev python3-pip python3-venv patchutils curl

root@38a5c29f4af4:/# pip install pipx

root@38a5c29f4af4:/# pipx install --include-deps molecule

root@38a5c29f4af4:/# cd /root/.local/pipx/venvs/molecule/lib/python3.10/site-packages/molecule/

# We need `patch -p3 -f` here because different folder structure after install by pip
root@38a5c29f4af4:~/.local/pipx/venvs/molecule/lib/python3.10/site-packages/molecule# curl -skL https://github.com/ansible-community/molecule/pull/3904.patch | patch -p3 -f

root@38a5c29f4af4:~/.local/pipx/venvs/molecule/lib/python3.10/site-packages/molecule# fgrep -nH app.runtime.run util.py
util.py:149:    result = app.runtime.run(

Well, I had a patched version with .deb/.rpm here, if you could agree with my greedy installation method, too (use with caution, you were warned):

@alessfg
Copy link

alessfg commented Jun 21, 2023

I could, but it would be even nicer to get a new official release! 😛

giner added a commit to giner/ansible-role-barman that referenced this pull request Jun 22, 2023
Unfreeze when molecule >= 5.0.2 is released

Links:
- ansible/molecule#3926
- ansible/molecule#3904
giner added a commit to giner/ansible-role-tfenv that referenced this pull request Jun 23, 2023
Unfreeze when molecule >= 5.0.2 is released

Links:
- ansible/molecule#3926
- ansible/molecule#3904
hswong3i added a commit to alvistack/ansible-community-molecule that referenced this pull request Jan 20, 2024
    git clean -xdf
    tar zcvf ../python-molecule_5.0.0.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp python-molecule.spec ../python-molecule_5.0.0-1.spec
    cp ../python*-molecule*5.0.0*.{gz,xz,spec,dsc} /osc/home\:alvistack/ansible-community-molecule-5.0.0/
    rm -rf ../python*-molecule*5.0.0*.*

See ansible#3904

Signed-off-by: Wong Hoi Sing Edison <[email protected]>
hswong3i added a commit to alvistack/ansible-community-molecule that referenced this pull request Jan 20, 2024
    git clean -xdf
    tar zcvf ../python-molecule_5.0.1.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp python-molecule.spec ../python-molecule_5.0.1-1.spec
    cp ../python*-molecule*5.0.1*.{gz,xz,spec,dsc} /osc/home\:alvistack/ansible-community-molecule-5.0.1/
    rm -rf ../python*-molecule*5.0.1*.*

See ansible#3904

Signed-off-by: Wong Hoi Sing Edison <[email protected]>
hswong3i added a commit to alvistack/ansible-community-molecule that referenced this pull request Feb 9, 2024
    git clean -xdf
    tar zcvf ../python-molecule_5.0.0.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp python-molecule.spec ../python-molecule_5.0.0-1.spec
    cp ../python*-molecule*5.0.0*.{gz,xz,spec,dsc} /osc/home\:alvistack/ansible-community-molecule-5.0.0/
    rm -rf ../python*-molecule*5.0.0*.*

See ansible#3904

Signed-off-by: Wong Hoi Sing Edison <[email protected]>
hswong3i added a commit to alvistack/ansible-community-molecule that referenced this pull request Feb 9, 2024
    git clean -xdf
    tar zcvf ../python-molecule_5.0.1.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp python-molecule.spec ../python-molecule_5.0.1-1.spec
    cp ../python*-molecule*5.0.1*.{gz,xz,spec,dsc} /osc/home\:alvistack/ansible-community-molecule-5.0.1/
    rm -rf ../python*-molecule*5.0.1*.*

See ansible#3904

Signed-off-by: Wong Hoi Sing Edison <[email protected]>
hswong3i added a commit to alvistack/ansible-community-molecule that referenced this pull request Feb 28, 2024
    git clean -xdf
    tar zcvf ../python-molecule_5.0.0.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp python-molecule.spec ../python-molecule_5.0.0-1.spec
    cp ../python*-molecule*5.0.0*.{gz,xz,spec,dsc} /osc/home\:alvistack/ansible-community-molecule-5.0.0/
    rm -rf ../python*-molecule*5.0.0*.*

See ansible#3904

Signed-off-by: Wong Hoi Sing Edison <[email protected]>
hswong3i added a commit to alvistack/ansible-community-molecule that referenced this pull request Feb 28, 2024
    git clean -xdf
    tar zcvf ../python-molecule_5.0.1.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp python-molecule.spec ../python-molecule_5.0.1-1.spec
    cp ../python*-molecule*5.0.1*.{gz,xz,spec,dsc} /osc/home\:alvistack/ansible-community-molecule-5.0.1/
    rm -rf ../python*-molecule*5.0.1*.*

See ansible#3904

Signed-off-by: Wong Hoi Sing Edison <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

molecule broken with latest version of ansible-compat
6 participants