ansible-collections / community.general

Ansible Community General Collection
https://galaxy.ansible.com/ui/repo/published/community/general/
GNU General Public License v3.0
787 stars 1.45k forks source link

`cargo` module install from source in a given directory #8480

Closed colin-nolan closed 2 weeks ago

colin-nolan commented 3 weeks ago
SUMMARY

Adds the ability to install a Cargo package from a source directory.

Fixes #6298

ISSUE TYPE
COMPONENT NAME

cargo

ADDITIONAL INFORMATION

Although #7895 adds a basic capability to install from a source directory, this PR goes beyond that work by considering how to handle versioning, and upgrades, in addition to adding testing. It is largely compatible with the aforementioned PR.

The reason I didn't opt to work from #7895 is that it has a relatively large scope, which I suspect may have made it a little difficult to merge. Merging this scope limited work in first offers a way of getting the functionality in sooner, and reduces the scope of what's new in #7895.

ansibullbot commented 3 weeks ago

The test ansible-test sanity --test compile --python 2.7 [explain] failed with 1 error:

plugins/modules/cargo.py:200:86: SyntaxError: self.module.fail_json(msg=f"No published version for package {name} found")

The test ansible-test sanity --test compile --python 3.5 [explain] failed with 1 error:

plugins/modules/cargo.py:200:86: SyntaxError: self.module.fail_json(msg=f"No published version for package {name} found")

The test ansible-test sanity --test import --python 2.7 [explain] failed with 1 error:

plugins/modules/cargo.py:200:86: traceback: SyntaxError: invalid syntax

The test ansible-test sanity --test import --python 3.5 [explain] failed with 1 error:

plugins/modules/cargo.py:200:86: traceback: SyntaxError: invalid syntax

The test ansible-test sanity --test validate-modules [explain] failed with 1 error:

plugins/modules/cargo.py:0:0: doc-type-does-not-match-spec: Argument 'directory' in argument_spec defines type as 'path' but documentation defines type as 'str'

The test ansible-test sanity --test validate-modules [explain] failed with 1 error:

plugins/modules/cargo.py:0:0: doc-type-does-not-match-spec: Argument 'directory' in argument_spec defines type as 'path' but documentation defines type as 'str'

The test licenses failed with 6 errors:

tests/integration/targets/cargo/files/hello-world/Cargo.toml:0:0: found no copyright notice
tests/integration/targets/cargo/files/hello-world/Cargo.toml:0:0: must have at least one license
tests/integration/targets/cargo/files/hello-world/Cargo.lock:0:0: found no copyright notice
tests/integration/targets/cargo/files/hello-world/Cargo.lock:0:0: must have at least one license
tests/integration/targets/cargo/files/hello-world/src/main.rs:0:0: found no copyright notice
tests/integration/targets/cargo/files/hello-world/src/main.rs:0:0: must have at least one license

The test ansible-test sanity --test compile --python 2.7 [explain] failed with 1 error:

plugins/modules/cargo.py:200:86: SyntaxError: self.module.fail_json(msg=f"No published version for package {name} found")

The test ansible-test sanity --test import --python 2.7 [explain] failed with 1 error:

plugins/modules/cargo.py:200:86: traceback: SyntaxError: invalid syntax

The test ansible-test sanity --test validate-modules [explain] failed with 1 error:

plugins/modules/cargo.py:0:0: doc-type-does-not-match-spec: Argument 'directory' in argument_spec defines type as 'path' but documentation defines type as 'str'

The test ansible-test sanity --test validate-modules [explain] failed with 1 error:

plugins/modules/cargo.py:0:0: doc-type-does-not-match-spec: Argument 'directory' in argument_spec defines type as 'path' but documentation defines type as 'str'

click here for bot help

ansibullbot commented 3 weeks ago

cc @radek-sprta click here for bot help

patchback[bot] commented 2 weeks ago

Backport to stable-9: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-9/69b72e4a8ea1111503d9528f179d5338657426cc/pr-8480

Backported as https://github.com/ansible-collections/community.general/pull/8527

🤖 @patchback I'm built with octomachinery and my source is open — https://github.com/sanitizers/patchback-github-app.

felixfontein commented 2 weeks ago

@colin-nolan thanks for your contribution!