Skip to content

Fix decrecation warning in project syncs#230

Merged
cigamit merged 1 commit intomainfrom
project_sync_depre
Feb 4, 2026
Merged

Fix decrecation warning in project syncs#230
cigamit merged 1 commit intomainfrom
project_sync_depre

Conversation

@cigamit
Copy link
Contributor

@cigamit cigamit commented Feb 4, 2026

This warning appears for all 3 tasks. Since the lookup for ansible.builtin.first_found has skip=True set, it returns an empty list if not found. Conditional results should be True or False, not a list, so just need a small tweak to make it proper.

[DEPRECATION WARNING]: Conditional result at location /runner/project/project_update.yml 231:15
was of type 'list'. Conditional results should only be True or False. The result was interpreted as False. This
feature will be removed in version 2.19. Deprecation warnings can be disabled
by setting deprecation_warnings=False in ansible.cfg.

[DEPRECATION WARNING]: Conditional result at location
/runner/project/project_update.yml 231:15 was of type 'list'. Conditional
results should only be True or False. The result was interpreted as False. This
 feature will be removed in version 2.19. Deprecation warnings can be disabled
by setting deprecation_warnings=False in ansible.cfg.
@cigamit cigamit self-assigned this Feb 4, 2026
Copilot AI review requested due to automatic review settings February 4, 2026 07:54
@cigamit cigamit added the bug Something isn't working label Feb 4, 2026
@cigamit cigamit requested a review from TheWitness February 4, 2026 07:54
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a deprecation warning that appears in Ansible 2.19+ when using ansible.builtin.first_found with skip=True in conditional statements. The lookup returns an empty list when no files are found, which Ansible interprets as a list type in conditionals rather than a boolean, triggering the deprecation warning.

Changes:

  • Updated three task conditionals to use req_file | length > 0 instead of just req_file to properly evaluate the empty list as a boolean expression

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@cigamit cigamit merged commit 79a6106 into main Feb 4, 2026
6 checks passed
@cigamit cigamit deleted the project_sync_depre branch February 4, 2026 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Development

Successfully merging this pull request may close these issues.

3 participants