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

mgr/volume: Python flake warning fixes. #52208

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

manishym
Copy link
Collaborator

@manishym manishym commented Jun 27, 2023

Each commit fixes one tracker issue.

Contribution Guidelines

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox
  • jenkins test windows

*
Two lines between class definitions.
*
Fixes: https://tracker.ceph.com/issues/51379
Signed-off-by: Manish M Yathnalli <myathnal@redhat.com>
Fixes: https://tracker.ceph.com/issues/51386
Signed-off-by: Manish M Yathnalli <myathnal@redhat.com>
Fixes: https://tracker.ceph.com/issues/51388
Signed-off-by: Manish M Yathnalli <myathnal@redhat.com>
Fixes: https://tracker.ceph.com/issues/51389
Signed-off-by: Manish M Yathnalli <myathnal@redhat.com>
Fixes: https://tracker.ceph.com/issues/51394
Signed-off-by: Manish M Yathnalli <myathnal@redhat.com>
Fixes: https://tracker.ceph.com/issues/51395
Signed-off-by: Manish M Yathnalli <myathnal@redhat.com>
Fixes: https://tracker.ceph.com/issues/51397
Signed-off-by: Manish M Yathnalli <myathnal@redhat.com>
Fixes: https://tracker.ceph.com/issues/51399
Signed-off-by: Manish M Yathnalli <myathnal@redhat.com>
Fixes: https://tracker.ceph.com/issues/51404
Signed-off-by: Manish M Yathnalli <myathnal@redhat.com>
Fixes: https://tracker.ceph.com/issues/51405
Signed-off-by: Manish M Yathnalli <myathnal@redhat.com>
@github-actions github-actions bot added cephfs Ceph File System pybind labels Jun 27, 2023
@dparmar18 dparmar18 requested a review from a team June 28, 2023 11:57
@dparmar18
Copy link
Contributor

I had went through the PR last week and the changes look good to me

@vshankar
Copy link
Contributor

@rishabh-d-dave PTAL.

Copy link
Contributor

@rishabh-d-dave rishabh-d-dave left a comment

Choose a reason for hiding this comment

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

The changes look fine.

But I am confused how did you find this issues? I mean what command did you run to get these? I am asking because I see many more such issues when I run flake8 command on top the PR branch -

flake8 --exclude=venv,.tox src/pybind/mgr/volumes/fs | wc -l
786

For Python code in qa/ we run flake8 this way - flake8 --select=F,E9 --exclude=venv,.tox qa/. Running this command suggests 21 issues -

flake8 --select=F,E9 --exclude=venv,.tox src/pybind/mgr/volumes/fs | wc -l
21

Ah, I think you fixed only the issues mentioned in the tickets. Sadly these tickets don't mention what parameters were pased to flake8/pep. I would recommend running the above command and fixing the rest of issues as well.

### volume operations -- create, rm, ls
# volume operations -- create, rm, ls
Copy link
Contributor

Choose a reason for hiding this comment

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

Multiple #s are perhaps deliberately added so that this comment is more easily apparent to readers.

Copy link
Collaborator Author

@manishym manishym Jul 20, 2023

Choose a reason for hiding this comment

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

The reason single # with a space is recommended in pep8 is because someone might think

################################################################
#                      volume operations -- create, rm, ls                                               #
################################################################

is more emphasizing than

### volume operations -- create, rm, ls.

Again style guides are just that, guides. If we don't agree, I can close the PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

If former is accepted by pep8/flake, let's switch to it instead?

### subvolume operations
# subvolume operations
Copy link
Contributor

Choose a reason for hiding this comment

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

Same.

### subvolume snapshot
# subvolume snapshot
Copy link
Contributor

Choose a reason for hiding this comment

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

same

### group snapshot
# group snapshot
Copy link
Contributor

Choose a reason for hiding this comment

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

same

Comment on lines -40 to +44
CREATE = 'create'
REMOVE = 'rm'
REMOVE_FORCE = 'rm-force'
PIN = 'pin'
LIST = 'ls'
GETPATH = 'getpath'
INFO = 'info'
RESIZE = 'resize'
SNAP_CREATE = 'snap-create'
SNAP_REMOVE = 'snap-rm'
SNAP_LIST = 'snap-ls'
SNAP_INFO = 'snap-info'
SNAP_PROTECT = 'snap-protect'
SNAP_UNPROTECT = 'snap-unprotect'
CLONE_SOURCE = 'clone-source'
CLONE_CREATE = 'clone-create'
CLONE_STATUS = 'clone-status'
CLONE_CANCEL = 'clone-cancel'
CLONE_INTERNAL = 'clone_internal'
ALLOW_ACCESS = 'allow-access'
DENY_ACCESS = 'deny-access'
AUTH_LIST = 'auth-list'
EVICT = 'evict'
USER_METADATA_SET = 'user-metadata-set'
USER_METADATA_GET = 'user-metadata-get'
USER_METADATA_LIST = 'user-metadata-ls'
USER_METADATA_REMOVE = 'user-metadata-rm'
SNAP_METADATA_SET = 'snap-metadata-set'
SNAP_METADATA_GET = 'snap-metadata-get'
SNAP_METADATA_LIST = 'snap-metadata-ls'
SNAP_METADATA_REMOVE = 'snap-metadata-rm'
CREATE = 'create'
REMOVE = 'rm'
REMOVE_FORCE = 'rm-force'
Copy link
Contributor

Choose a reason for hiding this comment

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

This formatting was deliberately this way for sake of readability.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The reason pep8 style guide does not recommend aligning = signs is that sooner or later, you will get a longer variable, which causes you to re-align all those = symbols. It is subjective if aligned = is more readable or not. Given that we have a tracker issue and we want it to be fixed, which means we want to adhere to pep8, I have fixed it. If not we can close the PR.

@rishabh-d-dave
Copy link
Contributor

@manishym Let me know when this PR is ready for review again.

@manishym
Copy link
Collaborator Author

@rishabh-d-dave Can you take a look. I have fixed other formatting errors as well.

Copy link

github-actions bot commented Nov 1, 2023

This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days.
If you are a maintainer or core committer, please follow-up on this pull request to identify what steps should be taken by the author to move this proposed change forward.
If you are the author of this pull request, thank you for your proposed contribution. If you believe this change is still appropriate, please ensure that any feedback has been addressed and ask for a code review.

@github-actions github-actions bot added the stale label Nov 1, 2023
@gregsfortytwo
Copy link
Member

ping @rishabh-d-dave

@github-actions github-actions bot removed the stale label Nov 21, 2023
Copy link

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@rishabh-d-dave
Copy link
Contributor

rishabh-d-dave commented Nov 29, 2023

@manishym Please ping me when this PR is ready.

(If possible, please ping me on Slack/IRC/G-chat. Since GH notifications are always too many, usually most of us use this approach)

Copy link

This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days.
If you are a maintainer or core committer, please follow-up on this pull request to identify what steps should be taken by the author to move this proposed change forward.
If you are the author of this pull request, thank you for your proposed contribution. If you believe this change is still appropriate, please ensure that any feedback has been addressed and ask for a code review.

@github-actions github-actions bot added the stale label Jan 28, 2024
Copy link

This pull request has been automatically closed because there has been no activity for 90 days. Please feel free to reopen this pull request (or open a new one) if the proposed change is still appropriate. Thank you for your contribution!

@github-actions github-actions bot closed this Feb 27, 2024
@tchaikov tchaikov reopened this Feb 28, 2024
@tchaikov
Copy link
Contributor

the last commit does not have "Signed-off-by" tag. and please resolve the merge conflicts.

@github-actions github-actions bot removed the stale label Feb 28, 2024
Copy link

This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days.
If you are a maintainer or core committer, please follow-up on this pull request to identify what steps should be taken by the author to move this proposed change forward.
If you are the author of this pull request, thank you for your proposed contribution. If you believe this change is still appropriate, please ensure that any feedback has been addressed and ask for a code review.

@github-actions github-actions bot added the stale label Apr 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants