-
Notifications
You must be signed in to change notification settings - Fork 31
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
Fail on Ansible collection dependency violations from Ansible 6.3.0 on #440
Fail on Ansible collection dependency violations from Ansible 6.3.0 on #440
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM though didn't test manually
@felixfontein thanks for implementing this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works like a charm! Thanks for the PR @felixfontein
To test the PR:
# Setup the test environment
docker pull python:3.10
docker run -it --name=antsibull_pr_440 python:3.10 bash
docker exec -it antsibull_pr_440 bash
# Install Ansible-core, antsibull, community.general collection
pip install ansible-core antsibull
ansible-galaxy collection install community.general
# Apply the PR 440 chnages
wget https://patch-diff.githubusercontent.com/raw/ansible-community/antsibull/pull/440.patch
patch /usr/local/lib/python3.10/site-packages/antsibull/build_ansible_commands.py < 440.patch
# Clone antsibull git repo
git clone https://github.com/ansible-community/antsibull.git; cd antsibull
# Run the build playbook with Ompragash/ansible-build-data fork which has conflicting ansible.netcommon version to test against this changes
ansible-playbook build-single-release.yaml -e antsibull_ansible_git_version=stable-2.13 -e antsibull_ansible_version=6.3.0 -e antsibull_data_git_repo="https://github.com/Ompragash/ansible-build-data" -e antsibull_data_version=antsibull_test
Failed playbook output
"stdout": "ERROR: found collection dependency errors!\nERROR: dellemc.enterprise_sonic version_conflict: ansible.netcommon-0.0.3 but needs >=2.0.0\nERROR: dellemc.os9 version_conflict: ansible.netcommon-0.0.3 but needs >=1.0.0\nERROR: dellemc.os10 version_conflict: ansible.netcommon-0.0.3 but needs >=1.0.0
...
...
"ERROR: splunk.es version_conflict: ansible.netcommon-0.0.3 but needs >=2.5.1"]}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes TypeError
fatal: [localhost]: FAILED! => {"attempts": 3, "changed": true, "cmd": ["antsibull-build", "rebuild-single", "6.3.0", "--data-dir", "/antsibull/build/ansible-build-data/6", "--sdist-dir", "/antsibull/build", "--build-file", "ansible-6.build", "--deps-file", "ansible-6.3.0.deps", "--debian"], "delta": "0:00:43.276248", "end": "2022-08-08 06:19:03.979211", "msg": "non-zero return code", "rc": 1, "start": "2022-08-08 06:18:20.702963", "stderr": "Traceback (most recent call last):\n File \"/usr/local/bin/antsibull-build\", line 8, in <module>\n sys.exit(main())\n File \"/usr/local/lib/python3.10/site-packages/antsibull/cli/antsibull_build.py\", line 416, in main\n return run(sys.argv)\n File \"/usr/local/lib/python3.10/site-packages/antsibull/cli/antsibull_build.py\", line 396, in run\n return ARGS_MAP[args.command]()\n File \"/usr/local/lib/python3.10/site-packages/antsibull/build_ansible_commands.py\", line 565, in rebuild_single_command\n is_error = app_ctx.extra[\"ansible_version\"].major >= PypiVer('6.3.0')\nTypeError: '>=' not supported between instances of 'int' and 'Version'", "stderr_lines": ["Traceback (most recent call last):", " File \"/usr/local/bin/antsibull-build\", line 8, in <module>", " sys.exit(main())", " File \"/usr/local/lib/python3.10/site-packages/antsibull/cli/antsibull_build.py\", line 416, in main", " return run(sys.argv)", " File \"/usr/local/lib/python3.10/site-packages/antsibull/cli/antsibull_build.py\", line 396, in run", " return ARGS_MAP[args.command]()", " File \"/usr/local/lib/python3.10/site-packages/antsibull/build_ansible_commands.py\", line 565, in rebuild_single_command", " is_error = app_ctx.extra[\"ansible_version\"].major >= PypiVer('6.3.0')", "TypeError: '>=' not supported between instances of 'int' and 'Version'"], "stdout": "", "stdout_lines": []}
@Andersson007 @Ompragash thanks a lot for testing and reviewing this! |
@felixfontein thanks for working on this! |
This implements ansible-community/community-topics#94.