Ansible-lint in pep8 jobs on tht master is failing

Bug #2004633 reported by Sofer Athlan-Guyot
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
tripleo
Fix Released
Critical
Unassigned

Bug Description

Hi,

something broke for ansible-lint in master:

    pep8: 53158 W commands[5]> ansible-lint -v [tox/tox_env/api.py:428]
    WARNING Ignore loading rule from /home/zuul/src/opendev.org/openstack/tripleo-heat-templates/.tox/pep8/lib/python3.10/site-packages/ansiblelint/rules/galaxy.py due to No module named 'pytest'
    INFO Set ANSIBLE_LIBRARY=/home/zuul/.cache/ansible-compat/a4a0a3/modules:/home/zuul/.ansible/plugins/modules:/usr/share/ansible/plugins/modules
    INFO Set ANSIBLE_COLLECTIONS_PATH=/home/zuul/.cache/ansible-compat/a4a0a3/collections:/home/zuul/.ansible/collections:/usr/share/ansible/collections
    INFO Set ANSIBLE_ROLES_PATH=/home/zuul/.cache/ansible-compat/a4a0a3/roles:roles:/home/zuul/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles
    INFO Discovered files to lint using: git -c safe.directory=/home/zuul/src/opendev.org/openstack/tripleo-heat-templates ls-files --cached --others --exclude-standard -z
    INFO Excluded removed files using: git -c safe.directory=/home/zuul/src/opendev.org/openstack/tripleo-heat-templates ls-files --deleted -z
    Traceback (most recent call last):
      File "/home/zuul/src/opendev.org/openstack/tripleo-heat-templates/.tox/pep8/bin/ansible-lint", line 8, in <module>
        sys.exit(_run_cli_entrypoint())
      File "/home/zuul/src/opendev.org/openstack/tripleo-heat-templates/.tox/pep8/lib/python3.10/site-packages/ansiblelint/__main__.py", line 349, in _run_cli_entrypoint
        sys.exit(main(sys.argv))
      File "/home/zuul/src/opendev.org/openstack/tripleo-heat-templates/.tox/pep8/lib/python3.10/site-packages/ansiblelint/__main__.py", line 244, in main
        result = _get_matches(rules, options)
      File "/home/zuul/src/opendev.org/openstack/tripleo-heat-templates/.tox/pep8/lib/python3.10/site-packages/ansiblelint/runner.py", line 220, in _get_matches
        lintables = ansiblelint.utils.get_lintables(opts=options, args=options.lintables)
      File "/home/zuul/src/opendev.org/openstack/tripleo-heat-templates/.tox/pep8/lib/python3.10/site-packages/ansiblelint/utils.py", line 870, in get_lintables
        lintables.append(Lintable(path))
      File "/home/zuul/src/opendev.org/openstack/tripleo-heat-templates/.tox/pep8/lib/python3.10/site-packages/ansiblelint/file_utils.py", line 245, in __init__
        self._guess_kind()
      File "/home/zuul/src/opendev.org/openstack/tripleo-heat-templates/.tox/pep8/lib/python3.10/site-packages/ansiblelint/file_utils.py", line 249, in _guess_kind
        if isinstance(self.data, list) and "hosts" in self.data[0]:
    IndexError: list index out of range
    pep8: 101338 C exit 1 (48.18 seconds) /home/zuul/src/opendev.org/openstack/tripleo-heat-templates> ansible-lint -v pid=2539 [tox/execute/api.py:275]
    .pkg: 101339 W _exit> python /home/zuul/.local/tox/lib/python3.10/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__ [tox/tox_env/api.py:428]

From the last succesful check build[1] the difference seems to be the new line:

    WARNING Ignore loading rule from /home/zuul/src/opendev.org/openstack/tripleo-heat-templates/.tox/pep8/lib/python3.10/site-packages/ansiblelint/rules/galaxy.py due to No module named 'pytest'

[1] https://zuul.opendev.org//t/openstack/builds?job_name=openstack-tox-pep8&project=openstack/tripleo-heat-templates&branch=master

Revision history for this message
Sofer Athlan-Guyot (sofer-athlan-guyot) wrote :
tags: added: pro
tags: added: promotion-blocker
removed: pro
Changed in tripleo:
milestone: none → antelope-1
Revision history for this message
Sandeep Yadav (sandeepyadav93) wrote :
Download full text (4.0 KiB)

Hello,

The latest affected job is using ansible-lint-6.12.1 [1]. Last good was using ansible-lint-6.11.0.

ansible-6.12.0/.1 was recently released(4 days ago): https://github.com/ansible/ansible-lint/releases. 6.12.0 is affected as well.

I was able to reproduce the issue locally with the latest ansible-lint 6.12.1:

Passes with ansible-lint 6.11.0
~~~
$ ansible-lint --version
ansible-lint 6.11.0 using ansible 2.14.2

A new release of ansible-lint is available: 6.11.0 → 6.12.1
(pep8) [sandeepyadav@localhost tripleo-heat-templates]$ ansible-lint -v
INFO Set ANSIBLE_LIBRARY=/home/sandeepyadav/.cache/ansible-compat/a4a0a3/modules:/home/sandeepyadav/.ansible/plugins/modules:/usr/share/ansible/plugins/modules
INFO Set ANSIBLE_COLLECTIONS_PATH=/home/sandeepyadav/.cache/ansible-compat/a4a0a3/collections:/home/sandeepyadav/.ansible/collections:/usr/share/ansible/collections
INFO Set ANSIBLE_ROLES_PATH=/home/sandeepyadav/.cache/ansible-compat/a4a0a3/roles:roles:/home/sandeepyadav/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles
INFO Discovered files to lint using: git -c safe.directory=/tmp/tripleo-heat-templates ls-files --cached --others --exclude-standard -z
INFO Excluded removed files using: git -c safe.directory=/tmp/tripleo-heat-templates ls-files --deleted -z
INFO Executing syntax check on common/deploy-steps-playbooks-common.yaml (0.55s)
WARNING Unable to resolve FQCN for module tripleo_all_nodes_data
~~~

Fails with ansible-lint 6.12.1
~~~
$ python3 -m pip install ansible-lint --upgrade
$ ansible-lint --version
ansible-lint 6.12.1 using ansible 2.14.2

]$ ansible-lint -v
WARNING Ignore loading rule from /tmp/tripleo-heat-templates/.tox/pep8/lib/python3.9/site-packages/ansiblelint/rules/galaxy.py due to No module named 'pytest'
INFO Set ANSIBLE_LIBRARY=/home/sandeepyadav/.cache/ansible-compat/a4a0a3/modules:/home/sandeepyadav/.ansible/plugins/modules:/usr/share/ansible/plugins/modules
INFO Set ANSIBLE_COLLECTIONS_PATH=/home/sandeepyadav/.cache/ansible-compat/a4a0a3/collections:/home/sandeepyadav/.ansible/collections:/usr/share/ansible/collections
INFO Set ANSIBLE_ROLES_PATH=/home/sandeepyadav/.cache/ansible-compat/a4a0a3/roles:roles:/home/sandeepyadav/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles
INFO Discovered files to lint using: git -c safe.directory=/tmp/tripleo-heat-templates ls-files --cached --others --exclude-standard -z
INFO Excluded removed files using: git -c safe.directory=/tmp/tripleo-heat-templates ls-files --deleted -z
Traceback (most recent call last):
  File "/tmp/tripleo-heat-templates/.tox/pep8/bin/ansible-lint", line 8, in <module>
    sys.exit(_run_cli_entrypoint())
  File "/tmp/tripleo-heat-templates/.tox/pep8/lib/python3.9/site-packages/ansiblelint/__main__.py", line 349, in _run_cli_entrypoint
    sys.exit(main(sys.argv))
  File "/tmp/tripleo-heat-templates/.tox/pep8/lib/python3.9/site-packages/ansiblelint/__main__.py", line 244, in main
    result = _get_matches(rules, options)
  File "/tmp/tripleo-heat-templates/.tox/pep8/lib/python3.9/site-packages/ansiblelint/runner.py", line 220, in _get_matches
    lintables = ansiblelint.utils.get_lintables(op...

Read more...

Changed in tripleo:
status: New → Triaged
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-heat-templates (master)
Changed in tripleo:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-heat-templates (master)

Reviewed: https://review.opendev.org/c/openstack/tripleo-heat-templates/+/872749
Committed: https://opendev.org/openstack/tripleo-heat-templates/commit/8d17681d3d630044456b5a0eb48d1ffeda75dd3d
Submitter: "Zuul (22348)"
Branch: master

commit 8d17681d3d630044456b5a0eb48d1ffeda75dd3d
Author: Jiri Podivin <email address hidden>
Date: Mon Feb 6 13:41:21 2023 +0100

    Capping ansible-lint version

    Closes-Bug: #2004633

    Signed-off-by: Jiri Podivin <email address hidden>
    Change-Id: I0b1a4a8d534ca985f7430255c8add86211e5ddab

Changed in tripleo:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-heat-templates (stable/zed)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-heat-templates (stable/zed)

Reviewed: https://review.opendev.org/c/openstack/tripleo-heat-templates/+/872870
Committed: https://opendev.org/openstack/tripleo-heat-templates/commit/c290ddf2dba4f1e9d6f523d60819caccbaf1c8e2
Submitter: "Zuul (22348)"
Branch: stable/zed

commit c290ddf2dba4f1e9d6f523d60819caccbaf1c8e2
Author: Jiri Podivin <email address hidden>
Date: Mon Feb 6 13:41:21 2023 +0100

    Capping ansible-lint version

    Closes-Bug: #2004633

    Signed-off-by: Jiri Podivin <email address hidden>
    Change-Id: I0b1a4a8d534ca985f7430255c8add86211e5ddab
    (cherry picked from commit 8d17681d3d630044456b5a0eb48d1ffeda75dd3d)

tags: added: in-stable-zed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to tripleo-heat-templates (stable/wallaby)

Related fix proposed to branch: stable/wallaby
Review: https://review.opendev.org/c/openstack/tripleo-heat-templates/+/872877

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to tripleo-heat-templates (stable/wallaby)

Reviewed: https://review.opendev.org/c/openstack/tripleo-heat-templates/+/872877
Committed: https://opendev.org/openstack/tripleo-heat-templates/commit/8f3f2855681a7e7ba1a93a7d10b8c69d35c09fcc
Submitter: "Zuul (22348)"
Branch: stable/wallaby

commit 8f3f2855681a7e7ba1a93a7d10b8c69d35c09fcc
Author: Jiri Podivin <email address hidden>
Date: Mon Feb 6 13:41:21 2023 +0100

    Capping ansible-lint version

    Related-Bug: #2004633

    Signed-off-by: Jiri Podivin <email address hidden>
    Change-Id: I0b1a4a8d534ca985f7430255c8add86211e5ddab
    (cherry picked from commit 8d17681d3d630044456b5a0eb48d1ffeda75dd3d)
    (cherry picked from commit c290ddf2dba4f1e9d6f523d60819caccbaf1c8e2)

tags: added: in-stable-wallaby
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.