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

Fix callback/selective task print being long #7374

Conversation

AidanHouck
Copy link
Contributor

SUMMARY

When printing the task name section of command output, previously the line was always 3 chars longer than line_length which is meant to limit width. This was due to the length check simply looking at the task_name, and not including the 3 formatting characters added in the string directly (# {0} ).

To fix this, I pulled these characters out into a separate variable then did the length check on that.

bugfixes:

  • selective - fix task name output using improper length check and going over the defined width limit
ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

selective

ADDITIONAL INFORMATION

Note that there are many other checks in this plugin that also do not properly follow the line_length variable for one reason or another. I will submit fixes for those later in a separate PR as they are not as trivial to resolve.

Compare against all text on the line rather than simply the task_name var,
which does not include 3 formatting characters in the string
@ansibullbot ansibullbot added bug This issue/PR relates to a bug callback callback plugin new_contributor Help guide this first time contributor plugins plugin (any type) small_patch Hopefully easy to review labels Oct 9, 2023
@ansibullbot

This comment was marked as outdated.

@ansibullbot ansibullbot added the needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR label Oct 9, 2023
@russoz
Copy link
Collaborator

russoz commented Oct 9, 2023

Hi @AidanHouck ,

Thank you for the contribution! Please add a changelog fragment.

@ansibullbot ansibullbot removed the small_patch Hopefully easy to review label Oct 10, 2023
@russoz
Copy link
Collaborator

russoz commented Oct 10, 2023

/rebuild

@ansibullbot ansibullbot removed the needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR label Oct 10, 2023
@AidanHouck AidanHouck force-pushed the fix-callback-selective-task-len branch from 5c6813f to 132029e Compare October 10, 2023 20:56
@AidanHouck AidanHouck force-pushed the fix-callback-selective-task-len branch from 132029e to a618f7d Compare October 10, 2023 21:06
@ansibullbot ansibullbot added the needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR label Oct 10, 2023
@felixfontein felixfontein added check-before-release PR will be looked at again shortly before release and merged if possible. backport-6 labels Oct 11, 2023
@felixfontein
Copy link
Collaborator

CI failures are unrelated and should get fixed by #7385.

@russoz
Copy link
Collaborator

russoz commented Oct 11, 2023

/rebuild_failed

Copy link
Collaborator

@russoz russoz left a comment

Choose a reason for hiding this comment

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

LGTM

@felixfontein felixfontein merged commit 479e7df into ansible-collections:main Oct 11, 2023
@patchback
Copy link

patchback bot commented Oct 11, 2023

Backport to stable-6: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-6/479e7df687040eb521aaebe76c2f8a5df1127e4d/pr-7374

Backported as #7390

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

@felixfontein felixfontein removed the check-before-release PR will be looked at again shortly before release and merged if possible. label Oct 11, 2023
patchback bot pushed a commit that referenced this pull request Oct 11, 2023
* Fix callback/selective task print being long

Compare against all text on the line rather than simply the task_name var,
which does not include 3 formatting characters in the string

* Add changelog fragment

---------

Co-authored-by: Aidan Houck <AidanHouck@users.noreply.github.com>
(cherry picked from commit 479e7df)
@patchback
Copy link

patchback bot commented Oct 11, 2023

Backport to stable-7: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-7/479e7df687040eb521aaebe76c2f8a5df1127e4d/pr-7374

Backported as #7391

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

@felixfontein
Copy link
Collaborator

@AidanHouck thanks for your contribution!
@russoz thanks for reviewing!

patchback bot pushed a commit that referenced this pull request Oct 11, 2023
* Fix callback/selective task print being long

Compare against all text on the line rather than simply the task_name var,
which does not include 3 formatting characters in the string

* Add changelog fragment

---------

Co-authored-by: Aidan Houck <AidanHouck@users.noreply.github.com>
(cherry picked from commit 479e7df)
felixfontein pushed a commit that referenced this pull request Oct 11, 2023
…int being long (#7390)

Fix callback/selective task print being long (#7374)

* Fix callback/selective task print being long

Compare against all text on the line rather than simply the task_name var,
which does not include 3 formatting characters in the string

* Add changelog fragment

---------

Co-authored-by: Aidan Houck <AidanHouck@users.noreply.github.com>
(cherry picked from commit 479e7df)

Co-authored-by: Aidan Houck <92699100+AidanHouck@users.noreply.github.com>
felixfontein pushed a commit that referenced this pull request Oct 11, 2023
…int being long (#7391)

Fix callback/selective task print being long (#7374)

* Fix callback/selective task print being long

Compare against all text on the line rather than simply the task_name var,
which does not include 3 formatting characters in the string

* Add changelog fragment

---------

Co-authored-by: Aidan Houck <AidanHouck@users.noreply.github.com>
(cherry picked from commit 479e7df)

Co-authored-by: Aidan Houck <92699100+AidanHouck@users.noreply.github.com>
etrombly pushed a commit to etrombly/community.general that referenced this pull request Oct 25, 2023
* Fix callback/selective task print being long

Compare against all text on the line rather than simply the task_name var,
which does not include 3 formatting characters in the string

* Add changelog fragment

---------

Co-authored-by: Aidan Houck <AidanHouck@users.noreply.github.com>
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 callback callback plugin needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR new_contributor Help guide this first time contributor plugins plugin (any type)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants