-
Notifications
You must be signed in to change notification settings - Fork 54
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
Adds workaround for requires_ansible
#811
Conversation
Actually I want to add a test for this collection.... Let me add that test now. |
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.
Feel free to merge with the test in place.
(I expect a pytest heavy test... OTOH we want to backport this.)
@@ -1046,7 +1046,9 @@ def _post_save(self, batch): | |||
) | |||
if runtime_metadata: | |||
runtime_yaml = yaml.safe_load(runtime_metadata) | |||
collection_version.requires_ansible = runtime_yaml.get("requires_ansible") | |||
if runtime_yaml: | |||
collection_version.requires_ansible = runtime_yaml.get( |
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.
Assuming its save to leave this field empty.
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.
I think it has to be based on what @awcrosby is saying #806 (comment)
98117a8
to
e2412ae
Compare
@@ -134,6 +134,22 @@ def test_sync_with_invalid_requirements(self): | |||
) | |||
self.assertRaises(ApiException, self.remote_collection_api.create, body) | |||
|
|||
def test_sync_collection_missing_requires_ansible(self): |
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.
I confirmed this test fails with the error I experienced without the fix. Then it passes with the fix.
Collections on galaxy.ansible.com may not have the expected `requires_ansible` data. closes pulp#806
e2412ae
to
32a1238
Compare
Backport to 0.11: 💚 backport PR created✅ Backport PR branch: Backported as #814 🤖 @patchback |
Backport to 0.10: 💚 backport PR created✅ Backport PR branch: Backported as #815 🤖 @patchback |
Backport to 0.7: 💚 backport PR created✅ Backport PR branch: Backported as #816 🤖 @patchback |
Collections on galaxy.ansible.com may not have the expected
requires_ansible
data.closes #806