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

flux-jobs: support W presentation type, update cute output format #5179

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

chu11
Copy link
Member

@chu11 chu11 commented May 17, 2023

Problem: flux-jobs(1) cute output does not throw enough emojis in your face.

Solution: Update flux-jobs cute format to use id.emoji over id.f58. Support new W presentation adjuster to make the output prettier.

image

Problem: A test in t2800-jobs-cmd.t had a message that was inconsistent
to what the test performed.

Update the test message to list what is tested.  Update the format of the
message to avoid it being super long.
@chu11
Copy link
Member Author

chu11 commented May 17, 2023

re-pushed, fix spelling and linting issues found by CI. Edit: oops another time, isort fail.

chu11 added 4 commits May 17, 2023 16:04
Problem: When outputting wide characters (e.g. emojis) in flux-jobs,
the alignment of output can be poor due to the characters having
different output widths.

Solution: Add a new W presentation type that can adjust formating
of the form "(<|>)N", e.g. {id.emoji:>12W}.  The output width will
be adjusted given the number of wide characters that exist in the
string.

Note that this presentation type does not help for all output scenarios,
as it depends on the width of the output and width of the alignment,
but it definitely helps in some scenarios.
Problem: The W presentation type is not documented in flux-jobs(1)

Add paragraph covering it.
Problem: The cute format in flux-jobs is not cute enough!

Solution: Update the format to use id.emoji over id.f58.
Problem: There is no coveragage for id.emoji and the W presentation
type.

Add some coverage in t2800-jobs-cmd.t.
@codecov
Copy link

codecov bot commented May 17, 2023

Codecov Report

Merging #5179 (19462df) into master (11d4362) will decrease coverage by 0.01%.
The diff coverage is 93.33%.

@@            Coverage Diff             @@
##           master    #5179      +/-   ##
==========================================
- Coverage   83.15%   83.15%   -0.01%     
==========================================
  Files         455      455              
  Lines       78035    78050      +15     
==========================================
+ Hits        64890    64899       +9     
- Misses      13145    13151       +6     
Impacted Files Coverage Δ
src/cmd/flux-jobs.py 96.50% <ø> (ø)
src/bindings/python/flux/util.py 95.18% <93.33%> (-0.05%) ⬇️

... and 6 files with indirect coverage changes

@grondo
Copy link
Contributor

grondo commented May 23, 2023

FYI, sadly this doesn't quite work for my font combination I guess 🙁
image

@chu11
Copy link
Member Author

chu11 commented May 23, 2023

doh! i wonder if this is even solvable within the framework of how we do output formats. I suppose in some worst case it could loop through all potential outputs, see what the longest emoji length is, then adjust field width .... ugh

@grondo
Copy link
Contributor

grondo commented May 23, 2023

Yeah, that's my worry as well. I guess we do already loop through all outputs to check for empty fields to handle ?: 🤷 If that works here maybe its ok? Meh, doesn't seem worth our time at this point.

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