Skip to content

Changing validation task to use role's tags - #82953

Closed
sudh33ra wants to merge 1 commit into
ansible:develfrom
sudh33ra:patch-1
Closed

Changing validation task to use role's tags#82953
sudh33ra wants to merge 1 commit into
ansible:develfrom
sudh33ra:patch-1

Conversation

@sudh33ra

@sudh33ra sudh33ra commented Apr 2, 2024

Copy link
Copy Markdown

Changing the validation internal task to check for tags on the role itself and use that if they exist, otherwise fallback to always

SUMMARY

Fixes #82505

ISSUE TYPE
  • Bugfix Pull Request

@ansibot ansibot added bug This issue/PR relates to a bug. needs_triage Needs a first human triage before being processed. has_issue labels Apr 2, 2024
@sudh33ra
sudh33ra marked this pull request as draft April 2, 2024 06:18
@sudh33ra
sudh33ra marked this pull request as ready for review April 2, 2024 06:51
@ansibot ansibot added the needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. label Apr 2, 2024
Changing the validation internal task  to check for tags on the role itself and use that if they exist, otherwise fallback to always
@ansibot ansibot removed the needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. label Apr 2, 2024
@bcoca bcoca removed the needs_triage Needs a first human triage before being processed. label Apr 2, 2024
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Apr 16, 2024
'name': task_name,
'tags': ['always'],
# Unless role is specifically tagged, the tag is set to 'always'
'tags': ['always'] if not self.tags else self.tags,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think instead of explicitly adding the tags, we should allow inheritance to work like is done with the gather_facts task for plays:

# Unless play is specifically tagged, gathering should 'always' run
if not self._play.tags:
setup_task.tags = ['always']

This would require setting the task ds to a var first, instead of direct returning the dict.

@ansibot ansibot added the stale_pr This PR has not been pushed to for more than one year. label Apr 7, 2025
@mkrizek

mkrizek commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Thank you for your contribution. I am going to go ahead and close this due to inactivity. Also, there is a new attempt at fixing the issue at #87168.

@mkrizek mkrizek closed this Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug This issue/PR relates to a bug. has_issue stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. stale_pr This PR has not been pushed to for more than one year.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Validating arguments against arg spec occuring on all tagged roles

5 participants