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 job info: drop multiple key support, clean up code, add man page entry #5520

Merged
merged 4 commits into from
Oct 27, 2023

Conversation

garlick
Copy link
Member

@garlick garlick commented Oct 27, 2023

Following up on #5464, this tries to simplifyflux job info. For a start, it uses job-info.update-lookup to fetch the current R instead of replaying the eventlog on the original R. It also cleans up the flux-job(1) man page and adds an entry for flux job info with descriptions of each available key.

Problem: there are several tests for flux job info fetching
multiple keys at once, but this feature is to be deprecated.

Drop tests.
Problem: the flux job info usage message is not output if the
job id is not specified, and is not reached if flux_open() fails.

In preparation for deprecating multi-key support, make the following
changes to the free argument parsing and usage message processing:
- check the arguments before flux_open()
- require exactly one key
- print the usage message even if the job id is not specified
- update usage message to reflect that only one key is accepted
- add key descriptions to the usage message

Update sharness test that checks usage message content.
@codecov
Copy link

codecov bot commented Oct 27, 2023

Codecov Report

Merging #5520 (fc19459) into master (ce603cc) will increase coverage by 0.00%.
The diff coverage is 85.93%.

@@           Coverage Diff            @@
##           master    #5520    +/-   ##
========================================
  Coverage   83.46%   83.47%            
========================================
  Files         487      487            
  Lines       82111    82011   -100     
========================================
- Hits        68533    68456    -77     
+ Misses      13578    13555    -23     
Files Coverage Δ
src/cmd/flux-job.c 87.58% <85.93%> (-0.03%) ⬇️

... and 9 files with indirect coverage changes

Problem: flux-job info is overly complex.

Do the following to simplify the code:
- drop multi-key fetch
- do the work synchronously
- use job-info.update-lookup for "current" R
- break up special cases into (mostly) standalone blocks with docs
@garlick
Copy link
Member Author

garlick commented Oct 27, 2023

I woke up this morning remembering some sphinx docs I came across and reworked the man page changes. Just pushed (sphinx refs included in the commit bodies)

Copy link
Contributor

@grondo grondo left a comment

Choose a reason for hiding this comment

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

Great cleanup! Hopefully there are no users of multiple keys with flux job info, but that seems unlikely.

RFC 34: Flux Task Map: https://flux-framework.readthedocs.io/projects/flux-rfc/en/latest/spec_34.html
:doc:`rfc:spec_34`
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand this sentence in the commit message:

The man reference is now just the title but man doesn't support hyperlinks and the title can be googled

Oh, does this mean the reference to RFC 34 in the manpage when using man(1) is only a title?

Copy link
Contributor

Choose a reason for hiding this comment

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

oops, my comment says it is outdated, so feel free to ignore if I commented on an older version of this PR

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes it looks like this

RESOURCES
       Flux: http://flux-framework.org

       14/Canonical Job Specification

not ok?

Copy link
Contributor

Choose a reason for hiding this comment

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

No that is fine, it just wasn't clear (to me) from the commit message (maybe just change to "The reference in the man page is now just the RFC title ..." though not necessary if you'd rather not IMO)

@grondo
Copy link
Contributor

grondo commented Oct 27, 2023

Oh, also suggest updating the PR title - the capital "Flux job info" could be confusing, also the main change here seems to be the removal of the ability to request multiple keys, so maybe that fact should be included in the title so it appears in release notes?

@garlick garlick changed the title Flux job info cleanup flux job info: drop multiple key support, clean up code, add man page entry Oct 27, 2023
@garlick
Copy link
Member Author

garlick commented Oct 27, 2023

Does that man page HTML formatting look like something we should use for all of the pages? I was sort of putting this forward as an example. Maybe this PR shouldn't do that, now that I think of it...

Problem: flux job info is not documented.

Add a new subsection for it.
@garlick
Copy link
Member Author

garlick commented Oct 27, 2023

Repushed with just the new man section reformatted.
Also I used the sphinx doc reference for the RFCs but included the full URL also.

I'll follow up with a PR that changes formatting across section 1 and we can discuss what we want RFC references to look like in that one.

@garlick
Copy link
Member Author

garlick commented Oct 27, 2023

I'll just go ahead and set MWP since the code changes were approved and I plan to submit a broader cleanup in man1 soon.

@mergify mergify bot merged commit 29dca8f into flux-framework:master Oct 27, 2023
31 checks passed
chu11 added a commit to chu11/flux-core that referenced this pull request Nov 20, 2023
Problem: In PR flux-framework#5520 "multiple key" "flux job info" tests were
removed due to a feature change in "flux job info".  This removed
some coverage of corner cases in job-info.lookup.

Add a new "job-info.lookup" RPC target helper tool and re-add a number
of the previously removed "multiple key" tests.
chu11 added a commit to chu11/flux-core that referenced this pull request Nov 20, 2023
Problem: In PR flux-framework#5520 "multiple key" "flux job info" tests were
removed due to a feature change in "flux job info".  This removed
some coverage of corner cases in job-info.lookup.

Add a new "job-info.lookup" RPC target helper tool and re-add a number
of the previously removed "multiple key" tests.
chu11 added a commit to chu11/flux-core that referenced this pull request Nov 20, 2023
Problem: In PR flux-framework#5520 "multiple key" "flux job info" tests were
removed due to a feature change in "flux job info".  This removed
some coverage of corner cases in job-info.lookup.

Add a new "job-info.lookup" RPC target helper tool and re-add a number
of the previously removed "multiple key" tests.
@garlick garlick deleted the flux_job_info_cleanup branch March 1, 2024 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants