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

Improve error output when calls to ansible-doc or ansible --version fail #223

Merged
merged 1 commit into from
Nov 11, 2023

Conversation

felixfontein
Copy link
Collaborator

Before:

subprocess.CalledProcessError: Command '['ansible-doc', '-vvv', '--metadata-dump', '--no-fail-on-errors', 'ansible.builtin', 'community.sops', 'foo.bar']' returned non-zero exit status 1.

After:

RuntimeError: The command
| ansible-doc -vvv --metadata-dump --no-fail-on-errors ansible.builtin community.sops foo.bar
returned exit status 1 with error output:
| [WARNING]: You are running the development version of Ansible. You should only
| run Ansible from "devel" if you are modifying the Ansible engine, or trying out
| features under development. This is a rapidly changing source of code and can
| become unstable at any point.
| ERROR! Cannot use supplied collection foo.bar: unable to locate collection foo.bar. unable to locate collection foo.bar

This would have helped me to quickly identify two nightly CI failures indirectly caused by ansible-core 2.16.0 having been released. (The lint-collection-docs subcommand was used when the collection's dependencies haven't been installed, and antsibull-docs was trying to find the docs for the dependencies as well. After figuring out that this caused the ansible-doc call to suddenly fail, it was easy to fix it by making sure that all dependent collections are installed.)

@felixfontein
Copy link
Collaborator Author

Copy link
Contributor

@samccann samccann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't comment on the code but the word-parts LGTM :-)

@felixfontein felixfontein merged commit bd726b6 into ansible-community:main Nov 11, 2023
9 of 10 checks passed
@felixfontein felixfontein deleted the errors branch November 11, 2023 09:26
@felixfontein
Copy link
Collaborator Author

@samccann thanks for reviewing the messages :)

jooola referenced this pull request in ansible-collections/hetzner.hcloud Dec 11, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[antsibull-docs](https://togithub.com/ansible-community/antsibull-docs)
| `>=2.5.0,<2.6` -> `>=2.6,<2.7` |
[![age](https://developer.mend.io/api/mc/badges/age/pypi/antsibull-docs/2.6.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/antsibull-docs/2.6.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/antsibull-docs/2.5.0/2.6.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/antsibull-docs/2.5.0/2.6.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>ansible-community/antsibull-docs (antsibull-docs)</summary>

###
[`v2.6.0`](https://togithub.com/ansible-community/antsibull-docs/blob/HEAD/CHANGELOG.rst#v260)

[Compare
Source](https://togithub.com/ansible-community/antsibull-docs/compare/2.5.0...2.6.0)

\======

## Release Summary

Fix parsing of `EXAMPLES` and improve error message

## Minor Changes

- Improve error messages when calls to `ansible-doc` fail
([https://github.com/ansible-community/antsibull-docs/pull/223](https://togithub.com/ansible-community/antsibull-docs/pull/223)).

## Bugfixes

- When `EXAMPLES` has the format specified by `# fmt: <format>`, this
value is used to determine the code block type
([https://github.com/ansible-community/antsibull-docs/pull/225](https://togithub.com/ansible-community/antsibull-docs/pull/225)).

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/ansible-collections/hetzner.hcloud).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy44Ny4yIiwidXBkYXRlZEluVmVyIjoiMzcuODcuMiIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
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