-
Notifications
You must be signed in to change notification settings - Fork 256
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
cephfs: add clone progress report in clone status #1036
Conversation
Ref issue: ceph/ceph-csi#4813 |
I see that this is an admin API, so it should be populating the new struct via JSON. However, I would like to see tests for this prior to approval. |
Tests as in that the json/struct is populated correctly or something else? |
That would be fine thanks. |
6a199ff
to
dbfc97d
Compare
I have added a json sample for test |
dbfc97d
to
a761e60
Compare
a761e60
to
f9bcb0a
Compare
@phlogistonjohn can you please review it again? |
My only remaining concern is what happens on older versions of ceph. It looks like your test only makes use of sample JSON (and that's fine) but doesn't talk to a live server so our test coverage in octopus/pacific/etc would not find an issue if this is missing or different in older versions. Can you either affirm that you've checked octopus has this in the JSON and it parses correctly OR add a 2nd test that adds coverage by talking to the server. Thanks! |
@Mergifyio rebase |
✅ Branch has been successfully rebased |
f9bcb0a
to
a296d5c
Compare
Makes sense. Quick question: How shall I make this new test run only for non-released ceph version i.e, ceph main branch? Using |
We've had to do some similar handling across versions, but I don't remember exactly what we've done in the past off the top of my head. Please take a look in the existing code for the various admin subpackages and you should find some examples. If you can't let me know and I'll try to find some. |
a296d5c
to
ead8776
Compare
Added a separate TC for the progress report api change, with the |
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.
Can you please link the relevant ceph change in PR description for future reference?
ead8776
to
4565b34
Compare
@anoopcs9 addressed all the concerns, please take a look now. |
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.
lgtm, thanks.
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.
New test looks mostly good.
However, my earlier concern seems largely unaddressed. I do not remember all the Go JSON (de)serialization rules and I want to make sure that the changes in this PR do not behave poorly when executed on older ceph versions (we still support octopus!).
An option is to take the current clone_progress_test.go file and copy it, invert the build tag (!main
). and then edit the test to (a) make sure the JSON parsing works OK and (b) the values are unavailable. Sound OK?
If the parsing wouldn't have worked then the checks on the PR would have failed because we have multiple tests that check Clone Status in their lifecycle namely
Let me make the change and paste the results for older versions from my local setup. |
OK, that's good enough for me. I just can never remember the rules and needed reassurance without me having to run tests myself.
That'd be great - but as per the above I won't require it. |
Tested for pacific:
Updated the TC as follows while testing:
Let me know, if you would prefer to have the above changeset pushed instead of the current one. |
Yes please |
4565b34
to
8c3c3f9
Compare
Pull request has been modified.
Done |
I'm sorry we must have misunderstood each other. I did not want the earlier test replaced by a |
8c3c3f9
to
fdf93d5
Compare
Ok, added both the tests. |
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.
Since we are going with two different test files I am gonna suggest the following names:
- cephfs/admin/clone_progress_report_test.go with
main
build tag. - cephfs/admin/clone_progress_report_unsupported_test.go with
!main
build tag.
add clone progress report in clone status output Signed-off-by: Nikhil-Ladha <[email protected]>
fdf93d5
to
1f60e03
Compare
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.
We'll have to make changes with the build tags as and when the corresponding backports are processed and merged. In case we forget nightly CI runs will remind us by reporting failures I guess.
Add clone progress report in clone status output
Relevant Ceph PR: ceph/ceph#54620
Ceph Tracker: https://tracker.ceph.com/issues/61904
Checklist
//go:build ceph_preview
make api-update
to record new APIsNew or infrequent contributors may want to review the go-ceph Developer's Guide including the section on how we track API Status and the API Stability Plan.
The go-ceph project uses mergify. View the mergify command guide for information on how to interact with mergify. Add a comment with
@Mergifyio
rebase
to rebase your PR when github indicates that the PR is out of date with the base branch.