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

[DNM] 20231104 Re-generate modules with ansible.content_builder #434

Conversation

mariolenz
Copy link
Collaborator

@mariolenz mariolenz commented Nov 4, 2023

This is a test, DO NOT MERGE!

pip install black==22.3.0 jsonschema jinja2==3.0.3 boto3 baron redbaron ruamel.yaml autoflake
ansible-galaxy collection install git+https://github.com/ansible-community/ansible.content_builder.git
git clone https://github.com/mariolenz/vmware.vmware_rest.git
mkdir -p /collections/ansible_collections/vmware/vmware_rest/tests
cp -r vmware.vmware_rest/tests/sanity /collections/ansible_collections/vmware/vmware_rest/tests
ansible-playbook build.yaml -e manifest_file=MANIFEST.yaml
autoflake --in-place --remove-all-unused-imports /collections/ansible_collections/vmware/vmware_rest/plugins/modules/*.py
cd vmware.vmware_rest/
git checkout -b 20231104-test-ansible.content_builder
rm -rf plugins/modules/
cp -r /collections/ansible_collections/vmware/vmware_rest/plugins/modules/ plugins/
echo -e '---\nminor_changes:\n- "Re-generate modules with ansible.content_builder."' > changelogs/fragments/regenerate_modules.yaml
git add --all
git commit -m "20231104 Re-generate modules with ansible.content_builder"
git push --set-upstream origin 20231104-test-ansible.content_builder

build.yaml:

---
- hosts: localhost
  gather_facts: yes
  roles:
    - ansible.content_builder.run

MANIFEST.yaml:

---
collection:
  path: /collections/ansible_collections/vmware/vmware_rest
  namespace: vmware
  name: vmware_rest
plugins:
  - type: module_openapi
    name: "vmware_rest"
    content: cloud
    api_object_path: vmware.vmware_rest/config/api_specifications/7.0.2
    resource: vmware.vmware_rest/config
    action: generate_all
    unique_key: ""
    rm_swagger_json: ""
    module_version: "1.0.0"
    author: "Ansible Cloud Team"

@mariolenz mariolenz force-pushed the 20231104-test-ansible.content_builder branch from beb09b0 to dd83f68 Compare November 4, 2023 13:07
@mariolenz
Copy link
Collaborator Author

@alinabuzachis @GomathiselviS I've already mentioned this in #432:

ERROR: Found 2 validate-modules issue(s) which need to be resolved:
ERROR: plugins/modules/vcenter_vm_hardware_adapter_sata.py:0:0: doc-default-does-not-match-spec: Argument 'bus' in argument_spec defines default as (0) but documentation defines default as (None)
ERROR: plugins/modules/vcenter_vm_hardware_adapter_scsi.py:0:0: doc-default-does-not-match-spec: Argument 'bus' in argument_spec defines default as (0) but documentation defines default as (None)

Is this a bug in the code generator?

Copy link
Contributor

Build failed.
https://ansible.softwarefactory-project.io/zuul/buildset/460eaeff87544cc19ac202204c5f5d67

✔️ ansible-test-cloud-integration-vmware-rest SUCCESS in 15m 38s
✔️ build-ansible-collection SUCCESS in 10m 19s
ansible-tox-linters FAILURE in 11m 44s
ansible-test-sanity-docker-devel FAILURE in 9m 58s (non-voting)
ansible-test-sanity-docker-milestone FAILURE in 13m 38s (non-voting)
✔️ ansible-test-sanity-docker-stable-2.9 SUCCESS in 15m 24s
✔️ ansible-test-sanity-docker-stable-2.10 SUCCESS in 15m 25s (non-voting)
✔️ ansible-test-sanity-docker-stable-2.11 SUCCESS in 17m 47s
ansible-test-sanity-docker-stable-2.12 RETRY_LIMIT in 7m 15s
✔️ ansible-test-sanity-docker-stable-2.13 SUCCESS in 11m 38s
✔️ ansible-test-sanity-docker-stable-2.14 SUCCESS in 8m 48s
✔️ tox-cloud-refresh-examples-vmware SUCCESS in 10m 59s
ansible-galaxy-importer RETRY_LIMIT in 4m 05s

@mariolenz
Copy link
Collaborator Author

recheck

@mariolenz
Copy link
Collaborator Author

@alinabuzachis @GomathiselviS I've already mentioned this in #432:

ERROR: Found 2 validate-modules issue(s) which need to be resolved:
ERROR: plugins/modules/vcenter_vm_hardware_adapter_sata.py:0:0: doc-default-does-not-match-spec: Argument 'bus' in argument_spec defines default as (0) but documentation defines default as (None)
ERROR: plugins/modules/vcenter_vm_hardware_adapter_scsi.py:0:0: doc-default-does-not-match-spec: Argument 'bus' in argument_spec defines default as (0) but documentation defines default as (None)

Is this a bug in the code generator?

@alinabuzachis @GomathiselviS Additionally ansible-tox-lintersfails. Did I do something wrong when re-creating the modules, is this a Zuul issue or a bug in ansible.content_builder?

Copy link
Contributor

Build failed.
https://ansible.softwarefactory-project.io/zuul/buildset/c8db8499d8b54513bf6cc8e06ad52c48

✔️ ansible-test-cloud-integration-vmware-rest SUCCESS in 15m 59s
✔️ build-ansible-collection SUCCESS in 10m 10s
ansible-tox-linters FAILURE in 11m 52s
ansible-test-sanity-docker-devel FAILURE in 11m 02s (non-voting)
ansible-test-sanity-docker-milestone FAILURE in 10m 22s (non-voting)
✔️ ansible-test-sanity-docker-stable-2.9 SUCCESS in 14m 07s
✔️ ansible-test-sanity-docker-stable-2.10 SUCCESS in 15m 18s (non-voting)
✔️ ansible-test-sanity-docker-stable-2.11 SUCCESS in 13m 13s
✔️ ansible-test-sanity-docker-stable-2.12 SUCCESS in 12m 30s
✔️ ansible-test-sanity-docker-stable-2.13 SUCCESS in 11m 41s
✔️ ansible-test-sanity-docker-stable-2.14 SUCCESS in 11m 35s
✔️ tox-cloud-refresh-examples-vmware SUCCESS in 11m 30s
✔️ ansible-galaxy-importer SUCCESS in 4m 32s

@mariolenz
Copy link
Collaborator Author

@alinabuzachis @GomathiselviS Additionally ansible-tox-lintersfails. Did I do something wrong when re-creating the modules, is this a Zuul issue or a bug in ansible.content_builder?

FYI the GHA linting workflow fails also :-/

@GomathiselviS
Copy link
Contributor

@alinabuzachis @GomathiselviS Additionally ansible-tox-lintersfails. Did I do something wrong when re-creating the modules, is this a Zuul issue or a bug in ansible.content_builder?

FYI the GHA linting workflow fails also :-/

It appears that there's a discrepancy between the version of Black used by the content_generator tool and the one employed by the collection. I'll investigate this.

Copy link
Contributor

Build failed.
https://ansible.softwarefactory-project.io/zuul/buildset/9708d9bc3728477f9995486ced9c56a4

✔️ ansible-test-cloud-integration-vmware-rest SUCCESS in 23m 29s
✔️ build-ansible-collection SUCCESS in 12m 44s
ansible-tox-linters FAILURE in 14m 41s
ansible-test-sanity-docker-devel FAILURE in 10m 37s (non-voting)
ansible-test-sanity-docker-milestone FAILURE in 10m 52s (non-voting)
✔️ ansible-test-sanity-docker-stable-2.9 SUCCESS in 18m 10s
✔️ ansible-test-sanity-docker-stable-2.10 SUCCESS in 14m 26s (non-voting)
✔️ ansible-test-sanity-docker-stable-2.11 SUCCESS in 15m 34s
✔️ ansible-test-sanity-docker-stable-2.12 SUCCESS in 13m 43s
✔️ ansible-test-sanity-docker-stable-2.13 SUCCESS in 11m 39s
✔️ ansible-test-sanity-docker-stable-2.14 SUCCESS in 12m 24s
✔️ tox-cloud-refresh-examples-vmware SUCCESS in 11m 08s
✔️ ansible-galaxy-importer SUCCESS in 5m 03s

@mariolenz
Copy link
Collaborator Author

It appears that there's a discrepancy between the version of Black used by the content_generator tool and the one employed by the collection. I'll investigate this.

I've installed black==22.3.0 according to your documentation.

However, the content_generator seems to use the latest version. Not 22.3.0:

https://github.com/ansible-community/ansible.content_builder/blob/1e706b48b7a1d825d464b697c43355f77cb24fb4/requirements.txt#L1

Should I try again with pip install black instead of pip install black==22.3.0? Or do you think the problem is somewhere else?

@mariolenz
Copy link
Collaborator Author

Should I try again with pip install black instead of pip install black==22.3.0?

Nope, this didn't help: #436 😢

pip install black==19.10b0 click==8.0.2 instead of pip install black==22.3.0 seems to work, though: #437

Maybe because of:

[testenv:linters]
deps =
black==19.10b0
click==8.0.2

🤷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants