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

plugin: improve job.update/job.update...queue callbacks #423

Merged
merged 4 commits into from
Feb 26, 2024

Conversation

cmoussa1
Copy link
Member

Background

Continuing the cleanup of the priority plugin code by utilizing the external functions defined in accounting.cpp.


This PR continues to clean up the plugin code by improving the callbacks for job.update and job.update.attributes.system.queue. Specifically, it removes the use of the clunky get_bank_info () helper function defined in the plugin itself and instead uses the lookup function defined in accounting.cpp. The function descriptions and comments are updated in both functions, as well as some variable names. Finally, the get_bank_info () helper function and its associated typedef and enums are removed from the plugin code, since they are no longer needed.

Fixes #422

Problem: The callback for job.update.attributes.system.queue and
job.update implements its own association lookup, but accounting.cpp
now has an external function that can perform this.

Clean up these functions by using the external lookup function for
an association.
Problem: Both functions are missing some grammatically correct
capitalization. They could also use some updates to its comments to make
use of "association" instead of just "user/bank".

Fix the capitalization in the function descriptions and replace the use
of "user/bank" in the comments with "association".
Problem: The variable name chosen for an updated queue is just named
"queue"; this is poorly named and might cause confusion for what it is
actually unpacking, which is an updated queue. Also, the variable that
holds the Association object in job_updated () is inconsistently named
"b" instead of "a" like the other callbacks that unpack an Association
object.

Update "queue" to "updated_queue". Update "Association *b" to
"Association *a" in job_updated ().
Problem: the plugin defined its own helper function for looking up
associations in its internal map, but it was clunky, and now
accounting.cpp has a much cleaner implementation that is used within
the plugin code.

Remove this helper function and its associated typedef and enums since
it is no longer needed in the plugin code.
@cmoussa1 cmoussa1 added improvement Upgrades to an already existing feature plugin related to the multi-factor priority plugin labels Feb 22, 2024
Copy link
Member

@jameshcorbett jameshcorbett left a comment

Choose a reason for hiding this comment

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

Looks reasonable to me!

@cmoussa1
Copy link
Member Author

Thanks! I'll set MWP here

Copy link

codecov bot commented Feb 26, 2024

Codecov Report

Merging #423 (339ef52) into master (b673799) will increase coverage by 0.34%.
The diff coverage is 86.66%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #423      +/-   ##
==========================================
+ Coverage   82.48%   82.83%   +0.34%     
==========================================
  Files          23       23              
  Lines        1439     1410      -29     
==========================================
- Hits         1187     1168      -19     
+ Misses        252      242      -10     
Files Coverage Δ
src/plugins/mf_priority.cpp 83.98% <86.66%> (+1.48%) ⬆️

@mergify mergify bot merged commit 5743ce4 into flux-framework:master Feb 26, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Upgrades to an already existing feature merge-when-passing plugin related to the multi-factor priority plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

job.update/job.update...queue: use new external methods for association lookup
2 participants