-
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
view-user
: create new AssociationFormatter
subclass for viewing associations
#527
Merged
mergify
merged 4 commits into
flux-framework:master
from
cmoussa1:restructure.association.views
Dec 30, 2024
Merged
view-user
: create new AssociationFormatter
subclass for viewing associations
#527
mergify
merged 4 commits into
flux-framework:master
from
cmoussa1:restructure.association.views
Dec 30, 2024
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
cmoussa1
added
improvement
Upgrades to an already existing feature
low priority
items that can be worked on at a later date
labels
Nov 6, 2024
cmoussa1
changed the title
Nov 6, 2024
view-user
: use AccountingFormatter
classview-user
: create new AssociationFormatter
subclass for viewing associations
cmoussa1
force-pushed
the
restructure.association.views
branch
from
November 6, 2024 23:59
bf976aa
to
d9fd90c
Compare
cmoussa1
force-pushed
the
restructure.association.views
branch
from
November 20, 2024 01:08
d9fd90c
to
8e62574
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #527 +/- ##
=======================================
Coverage 82.40% 82.40%
=======================================
Files 20 20
Lines 1478 1478
=======================================
Hits 1218 1218
Misses 260 260
|
wihobbs
approved these changes
Dec 26, 2024
cmoussa1
force-pushed
the
restructure.association.views
branch
from
December 30, 2024 18:40
8e62574
to
bd7cbe6
Compare
Problem: The view_user() function manually defines its own print functionality for viewing information about an association in the flux-accounting database, but the Python bindings have its own formatting class that does this. Create a new subclass of AccountingFormatter called AssociationFormatter. Adjust the initilization of the AccountingFormatter to accept a custom error message when the query fails to find any results. Adjust the view_user() function to use the new AssociationFormatter class when formatting the output. Remove the --json optional argument in favor of printing in JSON by default. Add a --fields optional argument to allow the user to customize their output, similar to the list-banks command.
Problem: The expected output of the view-user command is out-of-date with the use of the new formatter class in the view_user() function. Adjust the expected output in the testsuite to account for the new format provided by the formatter class.
Problem: There are a few tests in the sharness testsuite that pass --json when calling view-user, but this optional argument is no longer valid as the default output of view-user is in JSON. Adjust the view-user --json calls in the testsuite to account for the removal of --json.
Problem: There are no unit tests for checking the output of view_user(). Add some tests.
cmoussa1
force-pushed
the
restructure.association.views
branch
from
December 30, 2024 18:44
bd7cbe6
to
16493ae
Compare
rebased to catch up after #525; setting MWP here |
cmoussa1
added
merge-when-passing
commands
related to the flux-accounting commands/bindings
labels
Dec 30, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
commands
related to the flux-accounting commands/bindings
improvement
Upgrades to an already existing feature
low priority
items that can be worked on at a later date
merge-when-passing
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.
Problem
The
view_user()
function manually defines its own print functionality for viewing information about an association in theflux-accounting database, but the Python bindings have its own formatting class that does this. It's also tedious to add new formatting features to the
view_user()
function.This PR creates a new subclass of
AccountingFormatter
calledAssociationFormatter
. It has a unique error message when the user cannot be found in theassociation_table
, but otherwise inherits the default JSON and table outputs that theAccountingFormatter
class already provides. Thus, the various helper functions used to create output for theview_user()
functions could be removed.I've edited a number of tests in the testsuite that check for specific output from the
view-user
command, as well as added unit tests for theview_user()
function.