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

Add 7.0 U3 API spec #449

Conversation

mariolenz
Copy link
Collaborator

Same as #443, but this time I've used the --deprecate-slash-rest and --fetch-authentication-metadata flags to generate the specs:

python vmsgen.py -vc <vCenter IP> -o <output directory path> --oas 2 --deprecate-slash-rest --fetch-authentication-metadata

Copy link

codecov bot commented Nov 20, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (396da7b) 35.67% compared to head (94421f8) 35.67%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #449   +/-   ##
=======================================
  Coverage   35.67%   35.67%           
=======================================
  Files         143      143           
  Lines       11305    11305           
  Branches     2291     2291           
=======================================
  Hits         4033     4033           
  Misses       7272     7272           
Flag Coverage Δ
sanity 35.67% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@mariolenz
Copy link
Collaborator Author

pip install black==22.3.0 jsonschema jinja2==3.0.3 boto3 baron redbaron ruamel.yaml autoflake
LC_ALL="en_US.UTF-8" ansible-galaxy collection install git+https://github.com/ansible-community/ansible.content_builder.git
git clone https://github.com/mariolenz/vmware.vmware_rest.git
cd vmware.vmware_rest
git checkout use_7.0.3_spec
cd ..
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

But I get the same error:

No mapping for appliance.monitoring
The full traceback is:
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/ansible/executor/task_executor.py", line 165, in run
    res = self._execute()
  File "/usr/lib/python3.10/site-packages/ansible/executor/task_executor.py", line 660, in _execute
    result = self._handler.run(task_vars=vars_copy)
  File "/root/.ansible/collections/ansible_collections/ansible/content_builder/plugins/action/generate_cloud_modules.py", line 1358, in run
    eval(func)
  File "<string>", line 1, in <module>
  File "/root/.ansible/collections/ansible_collections/ansible/content_builder/plugins/action/generate_cloud_modules.py", line 1290, in generate_vmware_rest
    module.renderer(
  File "/root/.ansible/collections/ansible_collections/ansible/content_builder/plugins/action/generate_cloud_modules.py", line 943, in renderer
    gen_documentation(
  File "/root/.ansible/collections/ansible_collections/ansible/content_builder/plugins/action/generate_cloud_modules.py", line 316, in gen_documentation
    option["description"] = list(Description.normalize(description))
  File "/root/.ansible/collections/ansible_collections/ansible/content_builder/plugins/action/generate_cloud_modules.py", line 84, in normalize
    with_no_line_break = [cls.write_M(i) for i in with_no_line_break]
  File "/root/.ansible/collections/ansible_collections/ansible/content_builder/plugins/action/generate_cloud_modules.py", line 84, in <listcomp>
    with_no_line_break = [cls.write_M(i) for i in with_no_line_break]
  File "/root/.ansible/collections/ansible_collections/ansible/content_builder/plugins/action/generate_cloud_modules.py", line 180, in write_M
    module_name = mapping[resource_name]
KeyError: 'appliance.monitoring'
fatal: [localhost]: FAILED! => {
    "msg": "Unexpected failure during module execution: 'appliance.monitoring'",
    "stdout": ""
}

@mariolenz
Copy link
Collaborator Author

I think the problem are some new requirements that I don't see in the 7.0.2 spec:

  • The parameter must be an identifier for the resource type: appliance.monitoring.
  • The parameter must be an identifier for the resource type: appliance.networking.interfaces.
  • The parameter must be an identifier for the resource type: appliance.services.

If I understand this function correct, the fix might be to add some additional mapping:

            "appliance.monitoring": "appliance_monitoring_info",
            "appliance.networking.interfaces": "appliance_networking_interfaces_info",
            "appliance.services": "appliance_services_info",

@alinabuzachis
Copy link
Collaborator

alinabuzachis commented Nov 21, 2023

@mariolenz Am I wrong or we're not running anymore integration tests on Zuul (they are probably not triggered for this change)?

@mariolenz
Copy link
Collaborator Author

Am I wrong or we're not running anymore integration tests on Zuul (they are probably not triggered for this change)?

At the moment, this PR only contains the new JSON files. Maybe there were no integration tests because there are no code changes yet?

@mariolenz mariolenz changed the title [WIP] Build modules with 7.0 U3 API spec Build modules with 7.0 U3 API spec Nov 22, 2023
@mariolenz mariolenz changed the title Build modules with 7.0 U3 API spec Add 7.0 U3 API spec Nov 22, 2023
Copy link
Contributor

Build succeeded (gate pipeline).
https://ansible.softwarefactory-project.io/zuul/buildset/191583b8fe4c44dda4c9b102107b1308

✔️ build-ansible-collection SUCCESS in 10m 01s
✔️ tox-cloud-refresh-examples-vmware SUCCESS in 10m 39s
✔️ ansible-galaxy-importer SUCCESS in 4m 19s

@softwarefactory-project-zuul softwarefactory-project-zuul bot merged commit 1939c7d into ansible-collections:main Nov 22, 2023
@mariolenz mariolenz deleted the use_7.0.3_spec branch November 22, 2023 13:03
@mariolenz
Copy link
Collaborator Author

Thanks for reviewing @alinabuzachis!

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

Successfully merging this pull request may close these issues.

2 participants