[all] pep8 results for maintenance branches over time
What are projects doing about new linters working only with newer deps or even python3 only? For example [1] [2]. Might it be OK to ignore pep8 results on maintenance branches? Thanks, John [1] https://storage.gra.cloud.ovh.net/v1/AUTH_dcaab5e32b234d56b626f72581e3644c/z... Ignoring ruamel.yaml: markers 'python_version == "3.4"' don't match your environment ERROR: ansible-lint 4.2.0 has requirement ruamel.yaml<1,>=0.15.34; python_version < "3.7", but you'll have ruamel-yaml 0.13.14 which is incompatible. [2] https://zuul.opendev.org/t/openstack/build/82b01fb8a8c04068a906bf0cb888de58 AttributeError: module 'ruamel.yaml' has no attribute 'YAML' Examining undercloud-debug.yaml of type playbook Traceback (most recent call last): File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/bin/ansible-lint", line 8, in <module> sys.exit(main()) File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/lib/python3.5/site-packages/ansiblelint/__main__.py", line 187, in main matches.extend(runner.run()) File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/lib/python3.5/site-packages/ansiblelint/__init__.py", line 287, in run skip_list=self.skip_list)) File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/lib/python3.5/site-packages/ansiblelint/__init__.py", line 177, in run matches.extend(rule.matchtasks(playbookfile, text)) File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/lib/python3.5/site-packages/ansiblelint/__init__.py", line 87, in matchtasks yaml = ansiblelint.utils.append_skipped_rules(yaml, text, file['type']) File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/lib/python3.5/site-packages/ansiblelint/utils.py", line 596, in append_skipped_rules yaml_skip = _append_skipped_rules(pyyaml_data, file_text, file_type) File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/lib/python3.5/site-packages/ansiblelint/utils.py", line 606, in _append_skipped_rules yaml = ruamel.yaml.YAML() AttributeError: module 'ruamel.yaml' has no attribute 'YAML' Examining undercloud-service-status.yaml of type playbook Traceback (most recent call last): File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/bin/ansible-lint", line 8, in <module> sys.exit(main()) File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/lib/python3.5/site-packages/ansiblelint/__main__.py", line 187, in main matches.extend(runner.run()) File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/lib/python3.5/site-packages/ansiblelint/__init__.py", line 287, in run skip_list=self.skip_list)) File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/lib/python3.5/site-packages/ansiblelint/__init__.py", line 177, in run matches.extend(rule.matchtasks(playbookfile, text)) File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/lib/python3.5/site-packages/ansiblelint/__init__.py", line 87, in matchtasks yaml = ansiblelint.utils.append_skipped_rules(yaml, text, file['type']) File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/lib/python3.5/site-packages/ansiblelint/utils.py", line 596, in append_skipped_rules yaml_skip = _append_skipped_rules(pyyaml_data, file_text, file_type) File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/lib/python3.5/site-packages/ansiblelint/utils.py", line 606, in _append_skipped_rules yaml = ruamel.yaml.YAML() AttributeError: module 'ruamel.yaml' has no attribute 'YAML' /home/zuul/src/opendev.org/openstack/tripleo-validations ERROR: InvocationError for command /bin/bash tools/ansible-lint.sh (exited with code 1) pep8 finish: run-test after 45.18 seconds pep8 start: run-test-post pep8 finish: run-test-post after 0.00 seconds ___________________________________ summary ____________________________________ ERROR: pep8: commands failed
On 1/23/20 8:57 AM, John Fulton wrote:
What are projects doing about new linters working only with newer deps or even python3 only? For example [1] [2]. Might it be OK to ignore pep8 results on maintenance branches?
Thanks, John
[1] https://storage.gra.cloud.ovh.net/v1/AUTH_dcaab5e32b234d56b626f72581e3644c/z...
Ignoring ruamel.yaml: markers 'python_version == "3.4"' don't match your environment ERROR: ansible-lint 4.2.0 has requirement ruamel.yaml<1,>=0.15.34; python_version < "3.7", but you'll have ruamel-yaml 0.13.14 which is incompatible.
This actually isn't a pep8 issue, it's a pip install issue. It appears this job is installing a version of raumel that is not compatible with the Python version used. So it is rightly giving an error. It appears ansible-lint has a requirement for a version higher than the upper-constraint for stable/queens: https://opendev.org/openstack/requirements/src/branch/stable/queens/upper-co... We don't cap linters in the overall upper-constraints.txt file. It looks like the project may need to cap it at a version that is compatible with this stable branch version of things. Sean
On 23/Jan/2020 09:16, Sean McGinnis wrote:
On 1/23/20 8:57 AM, John Fulton wrote:
What are projects doing about new linters working only with newer deps or even python3 only? For example [1] [2]. Might it be OK to ignore pep8 results on maintenance branches?
Thanks, John
[1] https://storage.gra.cloud.ovh.net/v1/AUTH_dcaab5e32b234d56b626f72581e3644c/z...
Ignoring ruamel.yaml: markers 'python_version == "3.4"' don't match your environment ERROR: ansible-lint 4.2.0 has requirement ruamel.yaml<1,>=0.15.34; python_version < "3.7", but you'll have ruamel-yaml 0.13.14 which is incompatible.
This actually isn't a pep8 issue, it's a pip install issue.
It appears this job is installing a version of raumel that is not compatible with the Python version used. So it is rightly giving an error.
It appears ansible-lint has a requirement for a version higher than the upper-constraint for stable/queens:
https://opendev.org/openstack/requirements/src/branch/stable/queens/upper-co...
We don't cap linters in the overall upper-constraints.txt file. It looks like the project may need to cap it at a version that is compatible with this stable branch version of things.
Yes, that's the decision we've made. [1] Thanks for your analysis, Sean! [1] - https://review.opendev.org/#/c/703999/ Gaël, -- Gaël Chamoulaud (He/Him/His) .::. Red Hat .::. OpenStack .::.
While more or less complex fixes may be implemented to keep linting working on older branches we will clearly face an interesting challenge: - project adopts new syntax/linter, backporting a fix will need rewriting - outdated linters in maintenance branches will start to misbehave: false positives, failure to install, .... - unable to upgrade linters on maintenance branches due dependency conflicts, dropped py27 support, pip or other time-bombs My gut feeling about it is that sooner or later we may be forced to silence `tox -e linters` on old branches. This is easily achievable via tox.ini even without changing any jobs, I will give an example: ``` [linters:venv] commands = flake8 ``` If you add a minus before flake8, tox will ignore the exit code of flake8, but it will still run it. This is not an invitation to use this as a general practice, just an idea about how to unblock backports in some unfortunate cases. Cheers Sorin Sbarnea
On 23 Jan 2020, at 14:57, John Fulton <johfulto@redhat.com> wrote:
What are projects doing about new linters working only with newer deps or even python3 only? For example [1] [2]. Might it be OK to ignore pep8 results on maintenance branches?
Thanks, John
[1] https://storage.gra.cloud.ovh.net/v1/AUTH_dcaab5e32b234d56b626f72581e3644c/z...
Ignoring ruamel.yaml: markers 'python_version == "3.4"' don't match your environment ERROR: ansible-lint 4.2.0 has requirement ruamel.yaml<1,>=0.15.34; python_version < "3.7", but you'll have ruamel-yaml 0.13.14 which is incompatible.
[2] https://zuul.opendev.org/t/openstack/build/82b01fb8a8c04068a906bf0cb888de58 AttributeError: module 'ruamel.yaml' has no attribute 'YAML' Examining undercloud-debug.yaml of type playbook Traceback (most recent call last): File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/bin/ansible-lint", line 8, in <module> sys.exit(main()) File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/lib/python3.5/site-packages/ansiblelint/__main__.py", line 187, in main matches.extend(runner.run()) File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/lib/python3.5/site-packages/ansiblelint/__init__.py", line 287, in run skip_list=self.skip_list)) File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/lib/python3.5/site-packages/ansiblelint/__init__.py", line 177, in run matches.extend(rule.matchtasks(playbookfile, text)) File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/lib/python3.5/site-packages/ansiblelint/__init__.py", line 87, in matchtasks yaml = ansiblelint.utils.append_skipped_rules(yaml, text, file['type']) File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/lib/python3.5/site-packages/ansiblelint/utils.py", line 596, in append_skipped_rules yaml_skip = _append_skipped_rules(pyyaml_data, file_text, file_type) File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/lib/python3.5/site-packages/ansiblelint/utils.py", line 606, in _append_skipped_rules yaml = ruamel.yaml.YAML() AttributeError: module 'ruamel.yaml' has no attribute 'YAML' Examining undercloud-service-status.yaml of type playbook Traceback (most recent call last): File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/bin/ansible-lint", line 8, in <module> sys.exit(main()) File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/lib/python3.5/site-packages/ansiblelint/__main__.py", line 187, in main matches.extend(runner.run()) File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/lib/python3.5/site-packages/ansiblelint/__init__.py", line 287, in run skip_list=self.skip_list)) File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/lib/python3.5/site-packages/ansiblelint/__init__.py", line 177, in run matches.extend(rule.matchtasks(playbookfile, text)) File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/lib/python3.5/site-packages/ansiblelint/__init__.py", line 87, in matchtasks yaml = ansiblelint.utils.append_skipped_rules(yaml, text, file['type']) File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/lib/python3.5/site-packages/ansiblelint/utils.py", line 596, in append_skipped_rules yaml_skip = _append_skipped_rules(pyyaml_data, file_text, file_type) File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/lib/python3.5/site-packages/ansiblelint/utils.py", line 606, in _append_skipped_rules yaml = ruamel.yaml.YAML() AttributeError: module 'ruamel.yaml' has no attribute 'YAML' /home/zuul/src/opendev.org/openstack/tripleo-validations ERROR: InvocationError for command /bin/bash tools/ansible-lint.sh (exited with code 1) pep8 finish: run-test after 45.18 seconds pep8 start: run-test-post pep8 finish: run-test-post after 0.00 seconds ___________________________________ summary ____________________________________ ERROR: pep8: commands failed
On Thu, 2020-01-23 at 16:36 +0000, Sorin Sbarnea wrote:
While more or less complex fixes may be implemented to keep linting working on older branches we will clearly face an interesting challenge:
- project adopts new syntax/linter, backporting a fix will need rewriting - outdated linters in maintenance branches will start to misbehave: false positives, failure to install, .... - unable to upgrade linters on maintenance branches due dependency conflicts, dropped py27 support, pip or other time-bombs
My gut feeling about it is that sooner or later we may be forced to silence `tox -e linters` on old branches.
Before anyone does this, it's worth noting smcginnis' point that linters generally aren't versioned by upper-constraints so you can't rely on that to cap your versions for a given stable release. Instead, you should probably cap it at a given MINOR release and periodically update this range. Not only does this prevent a change in one of the linters breaking master, but it will ensure stable branches keep working as they did over the long term. We've done this in nova for years [1][2][3] and I'd just assumed everyone else was doing the same, to be honest :) Stephen [1] https://review.opendev.org/#/c/703405/ [2] https://github.com/openstack/nova/blob/19.0.0/test-requirements.txt#L5 [2] https://github.com/openstack/nova/blob/20.0.0/test-requirements.txt#L5 This is easily achievable via tox.ini even without changing any jobs, I will give an example: ``` [linters:venv] commands = flake8 ``` If you add a minus before flake8, tox will ignore the exit code of flake8, but it will still run it. This is not an invitation to use this as a general practice, just an idea about how to unblock backports in some unfortunate cases. Cheers Sorin Sbarnea On 23 Jan 2020, at 14:57, John Fulton <johfulto@redhat.com> wrote: What are projects doing about new linters working only with newer deps or even python3 only? For example [1] [2]. Might it be OK to ignore pep8 results on maintenance branches? Thanks, John [1] https://storage.gra.cloud.ovh.net/v1/AUTH_dcaab5e32b234d56b626f72581e3644c/z... Ignoring ruamel.yaml: markers 'python_version == "3.4"' don't match your environment ERROR: ansible-lint 4.2.0 has requirement ruamel.yaml<1,>=0.15.34; python_version < "3.7", but you'll have ruamel-yaml 0.13.14 which is incompatible. [2] https://zuul.opendev.org/t/openstack/build/82b01fb8a8c04068a906bf0cb888de58 AttributeError: module 'ruamel.yaml' has no attribute 'YAML' Examining undercloud-debug.yaml of type playbook Traceback (most recent call last): File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/bin/ansible-lint", line 8, in <module> sys.exit(main()) File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/lib/python3.5/site-packages/ansiblelint/__main__.py", line 187, in main matches.extend(runner.run()) File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/lib/python3.5/site-packages/ansiblelint/__init__.py", line 287, in run skip_list=self.skip_list)) File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/lib/python3.5/site-packages/ansiblelint/__init__.py", line 177, in run matches.extend(rule.matchtasks(playbookfile, text)) File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/lib/python3.5/site-packages/ansiblelint/__init__.py", line 87, in matchtasks yaml = ansiblelint.utils.append_skipped_rules(yaml, text, file['type']) File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/lib/python3.5/site-packages/ansiblelint/utils.py", line 596, in append_skipped_rules yaml_skip = _append_skipped_rules(pyyaml_data, file_text, file_type) File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/lib/python3.5/site-packages/ansiblelint/utils.py", line 606, in _append_skipped_rules yaml = ruamel.yaml.YAML() AttributeError: module 'ruamel.yaml' has no attribute 'YAML' Examining undercloud-service-status.yaml of type playbook Traceback (most recent call last): File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/bin/ansible-lint", line 8, in <module> sys.exit(main()) File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/lib/python3.5/site-packages/ansiblelint/__main__.py", line 187, in main matches.extend(runner.run()) File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/lib/python3.5/site-packages/ansiblelint/__init__.py", line 287, in run skip_list=self.skip_list)) File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/lib/python3.5/site-packages/ansiblelint/__init__.py", line 177, in run matches.extend(rule.matchtasks(playbookfile, text)) File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/lib/python3.5/site-packages/ansiblelint/__init__.py", line 87, in matchtasks yaml = ansiblelint.utils.append_skipped_rules(yaml, text, file['type']) File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/lib/python3.5/site-packages/ansiblelint/utils.py", line 596, in append_skipped_rules yaml_skip = _append_skipped_rules(pyyaml_data, file_text, file_type) File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/lib/python3.5/site-packages/ansiblelint/utils.py", line 606, in _append_skipped_rules yaml = ruamel.yaml.YAML() AttributeError: module 'ruamel.yaml' has no attribute 'YAML' /home/zuul/src/opendev.org/openstack/tripleo-validations ERROR: InvocationError for command /bin/bash tools/ansible-lint.sh (exited with code 1) pep8 finish: run-test after 45.18 seconds pep8 start: run-test-post pep8 finish: run-test-post after 0.00 seconds ___________________________________ summary ____________________________________ ERROR: pep8: commands failed
---- On Thu, 23 Jan 2020 11:34:23 -0600 Stephen Finucane <sfinucan@redhat.com> wrote ----
On Thu, 2020-01-23 at 16:36 +0000, Sorin Sbarnea wrote:
While more or less complex fixes may be implemented to keep linting working on older branches we will clearly face an interesting challenge:
- project adopts new syntax/linter, backporting a fix will need rewriting - outdated linters in maintenance branches will start to misbehave: false positives, failure to install, .... - unable to upgrade linters on maintenance branches due dependency conflicts, dropped py27 support, pip or other time-bombs
My gut feeling about it is that sooner or later we may be forced to silence `tox -e linters` on old branches.
Before anyone does this, it's worth noting smcginnis' point that linters generally aren't versioned by upper-constraints so you can't rely on that to cap your versions for a given stable release. Instead, you should probably cap it at a given MINOR release and periodically update this range. Not only does this prevent a change in one of the linters breaking master, but it will ensure stable branches keep working as they did over the long term. We've done this in nova for years [1][2][3] and I'd just assumed everyone else was doing the same, to be honest :)
I hope so until they have not removed the cap from when I did for many projects gate year ago. - https://review.opendev.org/#/q/topic:cap-hacking+(status:open+OR+status:merg...) -gmann
Stephen
[1] https://review.opendev.org/#/c/703405/ [2] https://github.com/openstack/nova/blob/19.0.0/test-requirements.txt#L5 [2] https://github.com/openstack/nova/blob/20.0.0/test-requirements.txt#L5
This is easily achievable via tox.ini even without changing any jobs,
I will give an example: ``` [linters:venv] commands = flake8 ``` If you add a minus before flake8, tox will ignore the exit code of flake8, but it will still run it.
This is not an invitation to use this as a general practice, just an idea about how to unblock backports in some unfortunate cases.
Cheers Sorin Sbarnea
On 23 Jan 2020, at 14:57, John Fulton <johfulto@redhat.com> wrote:
What are projects doing about new linters working only with newer deps or even python3 only? For example [1] [2]. Might it be OK to ignore pep8 results on maintenance branches?
Thanks, John
[1] https://storage.gra.cloud.ovh.net/v1/AUTH_dcaab5e32b234d56b626f72581e3644c/z...
Ignoring ruamel.yaml: markers 'python_version == "3.4"' don't match your environment ERROR: ansible-lint 4.2.0 has requirement ruamel.yaml<1,>=0.15.34; python_version < "3.7", but you'll have ruamel-yaml 0.13.14 which is incompatible.
[2] https://zuul.opendev.org/t/openstack/build/82b01fb8a8c04068a906bf0cb888de58 AttributeError: module 'ruamel.yaml' has no attribute 'YAML' Examining undercloud-debug.yaml of type playbook Traceback (most recent call last): File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/bin/ansible-lint", line 8, in <module> sys.exit(main()) File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/lib/python3.5/site-packages/ansiblelint/__main__.py", line 187, in main matches.extend(runner.run()) File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/lib/python3.5/site-packages/ansiblelint/__init__.py", line 287, in run skip_list=self.skip_list)) File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/lib/python3.5/site-packages/ansiblelint/__init__.py", line 177, in run matches.extend(rule.matchtasks(playbookfile, text)) File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/lib/python3.5/site-packages/ansiblelint/__init__.py", line 87, in matchtasks yaml = ansiblelint.utils.append_skipped_rules(yaml, text, file['type']) File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/lib/python3.5/site-packages/ansiblelint/utils.py", line 596, in append_skipped_rules yaml_skip = _append_skipped_rules(pyyaml_data, file_text, file_type) File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/lib/python3.5/site-packages/ansiblelint/utils.py", line 606, in _append_skipped_rules yaml = ruamel.yaml.YAML() AttributeError: module 'ruamel.yaml' has no attribute 'YAML' Examining undercloud-service-status.yaml of type playbook Traceback (most recent call last): File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/bin/ansible-lint", line 8, in <module> sys.exit(main()) File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/lib/python3.5/site-packages/ansiblelint/__main__.py", line 187, in main matches.extend(runner.run()) File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/lib/python3.5/site-packages/ansiblelint/__init__.py", line 287, in run skip_list=self.skip_list)) File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/lib/python3.5/site-packages/ansiblelint/__init__.py", line 177, in run matches.extend(rule.matchtasks(playbookfile, text)) File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/lib/python3.5/site-packages/ansiblelint/__init__.py", line 87, in matchtasks yaml = ansiblelint.utils.append_skipped_rules(yaml, text, file['type']) File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/lib/python3.5/site-packages/ansiblelint/utils.py", line 596, in append_skipped_rules yaml_skip = _append_skipped_rules(pyyaml_data, file_text, file_type) File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/lib/python3.5/site-packages/ansiblelint/utils.py", line 606, in _append_skipped_rules yaml = ruamel.yaml.YAML() AttributeError: module 'ruamel.yaml' has no attribute 'YAML' /home/zuul/src/opendev.org/openstack/tripleo-validations ERROR: InvocationError for command /bin/bash tools/ansible-lint.sh (exited with code 1) pep8 finish: run-test after 45.18 seconds pep8 start: run-test-post pep8 finish: run-test-post after 0.00 seconds ___________________________________ summary ____________________________________ ERROR: pep8: commands failed
While more or less complex fixes may be implemented to keep linting working on older branches we will clearly face an interesting challenge:
- project adopts new syntax/linter, backporting a fix will need rewriting
- outdated linters in maintenance branches will start to misbehave: false positives, failure to install, .... we have been pinning flake8 in nova for years. we have never had this happen and i dont think it will hapen unless you intentionall or unintentionlly make a backward impatable linter rule change. - unable to upgrade linters on maintenance branches due dependency conflicts, dropped py27 support, pip or other time- bombs we dont update linter on stable branches in general and typeically expect them to be frozen at the version they relased with.
My gut feeling about it is that sooner or later we may be forced to silence `tox -e linters` on old branches.
This is easily achievable via tox.ini even without changing any jobs,
I will give an example: ``` [linters:venv] commands = flake8 ``` If you add a minus before flake8, tox will ignore the exit code of flake8, but it will still run it. well the correct way to do that would really to be mark the jobs as non voting in the zuul.yaml but i dont think
On Thu, 2020-01-23 at 16:36 +0000, Sorin Sbarnea wrote: that should not really be the case. some linter might get stricter over time but when you backport you generally should not need to update the styple unless you are going form pyton3 only to python 2 compatible sysntax but that would be a require change regardless of the linter. this will be required unless project start removing old version from pypi. when project do that it breaks everyone and i think when that happens we need to explain the impact to the maintainer of the project and if they dont care consider should we replace that depency with an alternivite where the maintainer does care about legacy support.
This is not an invitation to use this as a general practice, just an idea about how to unblock backports in some unfortunate cases.
Cheers Sorin Sbarnea
On 23 Jan 2020, at 14:57, John Fulton <johfulto@redhat.com> wrote:
What are projects doing about new linters working only with newer deps or even python3 only? For example [1] [2]. Might it be OK to ignore pep8 results on maintenance branches?
Thanks, John
[1]
https://storage.gra.cloud.ovh.net/v1/AUTH_dcaab5e32b234d56b626f72581e3644c/z...
Ignoring ruamel.yaml: markers 'python_version == "3.4"' don't match your environment ERROR: ansible-lint 4.2.0 has requirement ruamel.yaml<1,>=0.15.34; python_version < "3.7", but you'll have ruamel-yaml 0.13.14 which is incompatible.
[2] https://zuul.opendev.org/t/openstack/build/82b01fb8a8c04068a906bf0cb888de58 AttributeError: module 'ruamel.yaml' has no attribute 'YAML' Examining undercloud-debug.yaml of type playbook Traceback (most recent call last): File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/bin/ansible-lint", line 8, in <module> sys.exit(main()) File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/lib/python3.5/site- packages/ansiblelint/__main__.py", line 187, in main matches.extend(runner.run()) File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/lib/python3.5/site- packages/ansiblelint/__init__.py", line 287, in run skip_list=self.skip_list)) File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/lib/python3.5/site- packages/ansiblelint/__init__.py", line 177, in run matches.extend(rule.matchtasks(playbookfile, text)) File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/lib/python3.5/site- packages/ansiblelint/__init__.py", line 87, in matchtasks yaml = ansiblelint.utils.append_skipped_rules(yaml, text, file['type']) File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/lib/python3.5/site- packages/ansiblelint/utils.py", line 596, in append_skipped_rules yaml_skip = _append_skipped_rules(pyyaml_data, file_text, file_type) File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/lib/python3.5/site- packages/ansiblelint/utils.py", line 606, in _append_skipped_rules yaml = ruamel.yaml.YAML() AttributeError: module 'ruamel.yaml' has no attribute 'YAML' Examining undercloud-service-status.yaml of type playbook Traceback (most recent call last): File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/bin/ansible-lint", line 8, in <module> sys.exit(main()) File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/lib/python3.5/site- packages/ansiblelint/__main__.py", line 187, in main matches.extend(runner.run()) File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/lib/python3.5/site- packages/ansiblelint/__init__.py", line 287, in run skip_list=self.skip_list)) File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/lib/python3.5/site- packages/ansiblelint/__init__.py", line 177, in run matches.extend(rule.matchtasks(playbookfile, text)) File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/lib/python3.5/site- packages/ansiblelint/__init__.py", line 87, in matchtasks yaml = ansiblelint.utils.append_skipped_rules(yaml, text, file['type']) File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/lib/python3.5/site- packages/ansiblelint/utils.py", line 596, in append_skipped_rules yaml_skip = _append_skipped_rules(pyyaml_data, file_text, file_type) File "/home/zuul/src/opendev.org/openstack/tripleo-validations/.tox/pep8/lib/python3.5/site- packages/ansiblelint/utils.py", line 606, in _append_skipped_rules yaml = ruamel.yaml.YAML() AttributeError: module 'ruamel.yaml' has no attribute 'YAML' /home/zuul/src/opendev.org/openstack/tripleo-validations ERROR: InvocationError for command /bin/bash tools/ansible-lint.sh (exited with code 1) pep8 finish: run-test after 45.18 seconds pep8 start: run-test-post pep8 finish: run-test-post after 0.00 seconds ___________________________________ summary ____________________________________ ERROR: pep8: commands failed
participants (7)
-
Gaël Chamoulaud
-
Ghanshyam Mann
-
John Fulton
-
Sean McGinnis
-
Sean Mooney
-
Sorin Sbarnea
-
Stephen Finucane