-
Notifications
You must be signed in to change notification settings - Fork 10
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
jameshcorbett
approved these changes
Feb 24, 2024
There was a problem hiding this 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!
Thanks! I'll set MWP here |
Codecov Report
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
|
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
andjob.update.attributes.system.queue
. Specifically, it removes the use of the clunkyget_bank_info ()
helper function defined in the plugin itself and instead uses the lookup function defined inaccounting.cpp
. The function descriptions and comments are updated in both functions, as well as some variable names. Finally, theget_bank_info ()
helper function and its associatedtypedef
andenum
s are removed from the plugin code, since they are no longer needed.Fixes #422