Repository navigation
rgw/radosgw-admin: extract account commands into a module (1 of 2) - #71575
RaminNietzsche wants to merge 1 commit into
Conversation
|
This PR is slice 3 of the incremental radosgw-admin modularization plan spun out of #71462. It depends on the earlier slices already open as #71569 (remove unused CLI locals/macros) and #71570 (extract command types into a header). The branch stacks those commits so the account module can be built and reviewed as one diff; after the prerequisites merge I will rebase to leave only the account extraction commit. What this change does:
Local verification on a vstart cluster (
Happy to rebase once #71569 and #71570 land, or adjust the split order if reviewers prefer a different sequencing. |
6601339 to
dfaf995
Compare
|
Rebased this PR onto current
Removed from this branch:
The account module uses a module-local Added exit-code tests from the modularization series:
Local verification: |
|
Pushed a follow-up commit addressing review findings:
Local verification on stg-hd1:
|
|
jenkins test windows |
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
2d55d06 to
ab7d738
Compare
ab7d738 to
c82351e
Compare
|
Rebased onto current |
c82351e to
f348583
Compare
|
jenkins test make check |
|
@cbodley @ivancich @chardan — ready for review (slice 3 / incremental landing from #71462).
Behavior-neutral extraction only; negative |
|
@chardan Thank you for reviewing #71578 and the umbrella. This account-module slice is independent of #71578 (both carry the same |
f348583 to
9609df7
Compare
anthonyeleven
left a comment
There was a problem hiding this comment.
Not sure how this got tagged for docs but LGTM
chardan
left a comment
There was a problem hiding this comment.
A couple of things you may want to look at, but it might be best to avoid more mechanism changes. Take a peek and thing it over a bit. But, +1, looks good to me-- thank you for your work on this!
| int ret = 0; | ||
|
|
||
| switch (o.command) { | ||
| case account_command::create: |
There was a problem hiding this comment.
Another indent level here would be nice.
There was a problem hiding this comment.
Done in 67bcacc14dc: indented case labels and bodies in both switches in account.cc (same style as the account dispatch switch in radosgw-admin.cc, which already had the extra level). Thanks for the nit.
| case account_command::create: | ||
| ret = rgw::account::create(dpp, driver, op_state, err_msg, | ||
| stream_flusher, null_yield); | ||
| if (ret < 0) { |
There was a problem hiding this comment.
Have you considered using exceptions here instead? It would probably simplify this code quite a bit-- you could have something like "account operation failed ({}): {}", ret, err_msg)". Not required, but it might be nice while we're in here.
Then again, if this is how it's already written, let's not touch it for now, that's a future PR!
There was a problem hiding this comment.
Agreed — not for this structural slice. I added it to my admin modularization follow-up list (A1) and plan a dedicated PR after slice 4 so we can settle error-handling style for the module handlers as a series, rather than only here. Keeping ret + report_error in #71575 as you suggested.
|
|
||
| rgw::account::AdminOpState make_op_state(const rgw_admin_account_options& o) | ||
| { | ||
| return rgw::account::AdminOpState{ |
There was a problem hiding this comment.
Any reason this isn't just an ordinary constructor..? I'm ok with this factory, but am just wondering. Come to think of it, I think I just answered my own question: probably because you can't use deduction guides on that type without changing it. Never mind, then. :-)
(Also, I remind myself that this is a structural PR!)
9609df7 to
4097772
Compare
Indent case labels and bodies in account.cc (both switches) per review on ceph#71575; dispatch switch in radosgw-admin.cc already matched. Fixes: https://tracker.ceph.com/issues/80264 Signed-off-by: ramin.najarbashi <[email protected]>
|
@chardan Thank you for the review and approval, and for the detailed inline notes. I really value your experience on the admin modularization work — I will keep using your suggestions, and please keep flagging anything you think would improve the series even when it is not required for the current slice. 1. Switch indentation — Done in tip 2. Exceptions vs 3. Thanks again for your time on this slice. |
|
jenkins test make check |
Move account create/modify/get/stats/rm/list handling from radosgw-admin.cc into account.cc with shared error reporting via util.h. Wire dispatch through rgw_admin_account() using a module-local account_command enum so this slice does not depend on a shared radosgw-admin header. Add shell-based exit-code coverage (test-account-exit-codes.sh and shared helpers). Guard tests with WITH_RADOSGW_RADOS. Use RGWFormatterFlusher& in the module to match rgw_account.h and the sibling user slice; ceph_abort() on the outer dispatch default; document handle_account_list duplication versus admin_meta (ceph#71578). Indent switch case labels and bodies in account.cc per review. Behavior of supported account commands and flags is unchanged. Signed-off-by: ramin.najarbashi <[email protected]>
67bcacc to
dd46525
Compare
|
This PR has been added to wip-anrao17-testing-2026-12-02-0607-main. |
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Context (incremental split from #71462)
This is slice 3 in the incremental landing plan for the radosgw-admin modularization work in #71462.
This PR contains only the account module extraction and its exit-code tests. It rebases on current
ceph/main(tipf34858371464as of 2026-10-27), which already includes merged #71569 and #71570; this diff does not reintroduce those changes.Enum placement:
account_commandstays module-local while CLI11 #69145 is unresolved, per cbodley/chardan guidance on #71462. Shared types fromradosgw-admin.h(#71570) are used where applicable; command enums are not centralized intoopt_*.incyet.Known unchanged behavior: negative
--max-entriesis still accepted (same as before this extraction).Summary
account.h/account.ccwithrgw_admin_account()for account create/modify/get/stats/rm/listutil.hwith sharedrgw_admin::report_error()for consistent CLI error outputradosgw-admin.ccthroughrgw_admin_account_optionsaccount listmetadata iteration out of the shared user/metadata list block into the account moduleaccount.ccto theradosgw-adminCMake targettest-account-exit-codes.shand shared helpersSupported account commands and flags are unchanged.
Testing
Local build and tests (Release,
WITH_RADOSGW_RADOS=ON, vstart cluster):ninja radosgw-admincram src/test/cli/radosgw-admin/help.t— passedbash src/test/rgw/radosgw-admin/test-account-exit-codes.sh— passedninja ceph_test_cls_rgw_admin_account_quota_set— built and run (exit 0)account list,account list --max-entries=2,account get,account stats, create/get/rm cycleChecklist
Show available Jenkins commands
jenkins test classic perfJenkins Job | Jenkins Job Definitionjenkins test crimson perfJenkins Job | Jenkins Job Definitionjenkins test signedJenkins Job | Jenkins Job Definitionjenkins test make checkJenkins Job | Jenkins Job Definitionjenkins test make check arm64Jenkins Job | Jenkins Job Definitionjenkins test submodulesJenkins Job | Jenkins Job Definitionjenkins test dashboardJenkins Job | Jenkins Job Definitionjenkins test dashboard cephadmJenkins Job | Jenkins Job Definitionjenkins test apiJenkins Job | Jenkins Job Definitionjenkins test docsReadTheDocs | Github Workflow Definitionjenkins test ceph-volume allJenkins Jobs | Jenkins Jobs Definitionjenkins test windowsJenkins Job | Jenkins Job Definitionjenkins test rook e2eJenkins Job | Jenkins Job DefinitionYou must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.