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

rfc41: add new lookup flags #407

Merged
merged 1 commit into from
Feb 20, 2024
Merged

Conversation

chu11
Copy link
Member

@chu11 chu11 commented Dec 20, 2023

Problem: The job-info.lookup RPC is missing new flags that are supported.

Document the new flags.


WIP as we discuss flux-framework/flux-core#5633 ("update" vs "updated" as flag name?)

also .. this specific spec change assumes flux-framework/flux-core#5635 would go in too. Could break into two commits.

spec_41.rst Outdated
Comment on lines 136 to 138
update (2)
For lookups of R or jobspec, return an updated version which
has applied updates from the eventlog.
Copy link
Member

Choose a reason for hiding this comment

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

Suggestion: rename update to current.

Also, make it clear that the flag has no effect on other keys as opposed to causing an error.

spec_41.rst Outdated
Comment on lines 132 to 134
decode (1)
For lookups of R or jobspec, return the field as a decoded
JSON object instead of a string.
Copy link
Member

Choose a reason for hiding this comment

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

The response payload states that all values are returned as strings so it needs an update.

Maybe it would be slightly clearer to say

return the value as a JSON object instead of a JSON object encoded as a JSON string.

The flag name decode feels a bit ambiguous. What about objectify? 🤷

Copy link
Contributor

Choose a reason for hiding this comment

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

Would json be explicit enough?

Copy link
Member

Choose a reason for hiding this comment

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

but a JSON object and a JSON object encoded as a JSON string are both JSON?

Gosh I hate naming things! 😆

Copy link
Contributor

Choose a reason for hiding this comment

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

Hm, it seemed clear to me, but if we need to be pedantic, decode or json_decode is probably better than objectify, for which the primary definition has negative connotations.

Copy link
Member

Choose a reason for hiding this comment

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

I could live with json on second thought. I didn't mean to be pedantic - just trying to come up with an intuitive name and failing. I don't think it matters that much. How about json?

Copy link
Contributor

Choose a reason for hiding this comment

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

I also meant to say as long as it is clearly documented, the actual flag name isn't too important to me either.

Copy link
Member Author

Choose a reason for hiding this comment

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

I like json_decode, i dunno about just json ... because the returned RPC object is already json?

Copy link
Member

Choose a reason for hiding this comment

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

Works for me I guess.

@chu11
Copy link
Member Author

chu11 commented Dec 21, 2023

re-pushed, going with json_decode and current.

@chu11 chu11 force-pushed the rfc41_flags branch 2 times, most recently from d89d320 to 553ab65 Compare December 22, 2023 06:06
spec_41.rst Outdated
Comment on lines 137 to 140
current (2)
For lookups of R or jobspec, return the current version which
has applied respective updates from the eventlog. This flag has
no effect on other keys.
Copy link
Member

Choose a reason for hiding this comment

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

Maybe the eventlog events ought to be explicitly called out? E.g. say

For lookups of R or jobspec, return the current version. The current version SHALL be computed by applying any resource-update or jobspec-update events that have been posted to the job eventlog, as described in RFC 21.

Still need to update the response description, which states that all returned values are strings.

@chu11
Copy link
Member Author

chu11 commented Dec 22, 2023

re-pushed, with some tweaks per comments above

@chu11
Copy link
Member Author

chu11 commented Feb 1, 2024

removed WIP, I think this RFC and the associated PRs flux-framework/flux-core#5633 and flux-framework/flux-core#5635 are ready for review

@chu11 chu11 changed the title WIP: rfc41: add new lookup flags rfc41: add new lookup flags Feb 1, 2024
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.

This ready to go in? Seems good to me.

Problem: The job-info.lookup RPC is missing the new
json_decode and current flags.

Document the new flags.
@mergify mergify bot merged commit fb61a77 into flux-framework:master Feb 20, 2024
7 checks passed
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.

3 participants