Skip to content

porting guide 2.19: async_status started/finished #2576

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

Open
wants to merge 2 commits into
base: devel
Choose a base branch
from

Conversation

mkrizek
Copy link
Contributor

@mkrizek mkrizek commented Apr 29, 2025

Fixes #2575

@@ -688,7 +688,16 @@ No notable changes
Modules
=======

No notable changes
* With the changes to the templating system it is no longer possible to use ``async_status`` module's ``started`` and ``finished`` integer properties as values in conditionals as booleans are required. It is recommended to use ``started`` and ``finished`` test plugins instead, for example:
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this be in the "Playbooks > Broken conditionals" section? As that is not a module level change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My reasoning behind placing this under Modules was that the general information about "broken conditionals" is already covered in the section you mentioned and this particular entry is about async_status module return values being used (now) incorrectly in the module's examples.

Though I am fine moving it into the "Broken conditionals" section.

Copy link
Contributor

Choose a reason for hiding this comment

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

The recommendation to use the started and finished test plugins is specific to the async_status return data, so I think it's better here rather than cluttering the generic section with module specific solutions.

The generic issue of implicit boolean conversion is already covered in the first example in the Broken conditionals section, and applies to async_status too.

Example - implicit boolean conversion
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This expression relies on an implicit truthy evaluation of inventory_hostname.
An explicit predicate with a boolean result, such as | length > 0 or is truthy, should be used instead.

Copy link
Contributor

Choose a reason for hiding this comment

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

thanks for the explanation, makes sense then

@samccann
Copy link
Contributor

@evgeni @s-hertel thanks for the quick review. If you're happy with the PR, can you approve pls?

@s-hertel
Copy link
Contributor

s-hertel commented Apr 29, 2025

I noticed there are a couple out of date examples in docs/docsite/rst/playbook_guide/playbooks_async.rst too. Other than that, looks good to me.

Could be fixed in another PR though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-2.19 Automatically create a backport for the stable-2.19 branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update docs for async_status .started and .finished properties
5 participants