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

[disk] Add include_all_devices option and improve error logs #7378

Merged
merged 8 commits into from
Aug 21, 2020

Conversation

mx-psi
Copy link
Member

@mx-psi mx-psi commented Aug 17, 2020

What does this PR do?

  • Add option to exclude non-physical devices.
  • Improve logging about failing devices and nudge users towards using the settings to disable them if needed.
  • Remove debug log which was consistently confusing to support engineers.

Motivation

  • Address common pain points of users of the check and support engineers.

Additional Notes

  • See all argument for disk_partitions.

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • PR title must be written as a CHANGELOG entry (see why)
  • Files changes must correspond to the primary purpose of the PR as described in the title (small unrelated changes should have their own PR)
  • PR must have changelog/ and integration/ labels attached

@mx-psi mx-psi marked this pull request as ready for review August 17, 2020 15:27
@mx-psi mx-psi requested review from a team as code owners August 17, 2020 15:27
It makes no sense to use  `file_system_whitelist` in the way previously
mentioned, if users want to have more fine grained control they can just
specify the lists themselves
@mx-psi mx-psi requested a review from KSerrania August 18, 2020 10:50
KSerrania
KSerrania previously approved these changes Aug 18, 2020
Copy link
Contributor

@KSerrania KSerrania left a comment

Choose a reason for hiding this comment

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

LGTM, I see that an empty disk/log/.lock file got added, which can probably be removed.

KSerrania
KSerrania previously approved these changes Aug 18, 2020
This does the same that this PR intended but supporting all operating systems
and by checking (on Linux) if the file system is backed by a block device.
@mx-psi mx-psi requested a review from KSerrania August 19, 2020 14:27
KSerrania
KSerrania previously approved these changes Aug 19, 2020
Copy link
Contributor

@KSerrania KSerrania left a comment

Choose a reason for hiding this comment

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

LGTM, left a comment about the check documentation.

@@ -98,6 +101,14 @@ instances:
# - /dev/sde
# - '[FJ]:'

## @param include_all_devices - boolean - optional - default: True
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is there an uppercase T in True here, whereas it's lowercase in the spec & in all other config options?

Copy link
Member Author

Choose a reason for hiding this comment

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

🤔 I am not sure why, the conf.yaml.default file is generated automatically by ddev validate config -s using the spec.yaml file.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's how the config validator works since I added both a default and an example value:

if 'default' in value:
default = value['default']
if default is not None:
if type(default) is str:
writer.write(' - default: ', default)
else:
writer.write(' - default: ', repr(default))
else:
if example_type is bool:
writer.write(' - default: ', 'true' if example else 'false')

It prints the repr of the object (which is True since that's how it is written in Python) instead of true or false, which it does when there is no default config.

I am going to change it though, since it seems like elsewhere the example and default values always match and it can be confusing.

Copy link
Member Author

Choose a reason for hiding this comment

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

I opened #7405 to make the behavior consistent.

@mx-psi mx-psi changed the title [disk] Improve excluded devices messages and defaults [disk] Add include_all_devices option and improve error logs Aug 20, 2020
This way it is more consistent with the rest of options
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants