-
Notifications
You must be signed in to change notification settings - Fork 2.9k
feat(compute): extend compute hyperdisk pool create #9595
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
Conversation
compute/cloud-client/src/main/java/compute/disks/storagepool/CreateHyperdiskStoragePool.java
Show resolved
Hide resolved
compute/cloud-client/src/test/java/compute/disks/HyperdisksIT.java
Outdated
Show resolved
Hide resolved
| Assert.assertTrue(storagePool.getCapacityProvisioningType().equalsIgnoreCase("advanced")); | ||
| Assert.assertTrue(storagePool.getPerformanceProvisioningType().equalsIgnoreCase("advanced")); |
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.
please use PERFORMANCE_PROVISIONING_TYPE instead of "advanced" literal
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.
Thank you. Done
compute/cloud-client/src/main/java/compute/disks/storagepool/CreateHyperdiskStoragePool.java
Outdated
Show resolved
Hide resolved
compute/cloud-client/src/main/java/compute/disks/storagepool/CreateHyperdiskStoragePool.java
Outdated
Show resolved
Hide resolved
compute/cloud-client/src/main/java/compute/disks/storagepool/CreateHyperdiskStoragePool.java
Show resolved
Hide resolved
| StoragePool storagePool = CreateHyperdiskStoragePool | ||
| .createHyperdiskStoragePool(PROJECT_ID, ZONE, STORAGE_POOL_NAME, poolType, | ||
| "advanced", 10240, 10000, 10240); | ||
| "advanced", 10240, 10000, 10240, |
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.
should the capacity to be 1024 and not 10240?
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.
It's not a scope of this task. I've created a new task to fix code and will follow yours recommendations.
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.
I do not understand what you mean by "creating a new task"? Do you propose to address code review comments made in this PR by submitting a separate PR?
If you do, I find this proposal very inconvenient and time consuming. Please, explain what do you mean.
Regarding my question about the value 10240, I looked into Cloud Console UI and it limits the range to be from 1 to 1024 TB. I do not know if client library limits the range but I think that making it matching UX in Console is preferred.
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.
Fixed
|
|
||
| @Disabled | ||
| @Test | ||
| public void stage1_CreateHyperdiskStoragePoolTest() |
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.
why the name of the method follows snake notation and not pascal notation?
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.
It's not a scope of this task. I've created a new task to fix code and will follow yours recommendations.
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.
Fixed
| public void stage2_CreateHyperdiskStoragePoolTest() | ||
| throws IOException, ExecutionException, InterruptedException, TimeoutException { |
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.
what is being testing in this method that was not tested in the previous method? Why changing the arguments to the call to CreateDiskInStoragePool.createDiskInStoragePool() should matter for testing this code sample?
The code sample method does not have any conditions, so testing Google API invocation with different parameters does not test code sample but the backend API which is unnecessary.
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.
It's not a scope of this task. I've created a new task to fix code and will follow yours recommendations.
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.
I've fixed naming for these tests. As I understand from code and tests
- the first testCreateHyperdiskStoragePool() tests that StoragePoll was created as expected
- the second testCreateDiskInStoragePool() takes the StoragePoolLink of the StoragePool created in the first test and tests it's parameters.
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.
according to your explanations the second test does not validate the code sample. the code sample shows how to create a storage pool. the test(s) should validate the code.
please, modify the test class to do one of the following, either to remove the second test because it does not add to the validation to code sample or perform all validations / asserts in the first test method.
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 have two classes - CreateDiskInStoragePool and CreateHyperdiskStoragePool. To test this code Svyatoslav created two test methods - testCreateDiskInStoragePool and testCreateHyperdiskStoragePool. As far as I can see, these tests are working properly
compute/cloud-client/src/test/java/compute/disks/HyperdisksIT.java
Outdated
Show resolved
Hide resolved
| StoragePool storagePool = CreateHyperdiskStoragePool | ||
| .createHyperdiskStoragePool(PROJECT_ID, ZONE, STORAGE_POOL_NAME, poolType, | ||
| "advanced", 10240, 10000, 10240); | ||
| "advanced", 10240, 10000, 10240, |
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.
I do not understand what you mean by "creating a new task"? Do you propose to address code review comments made in this PR by submitting a separate PR?
If you do, I find this proposal very inconvenient and time consuming. Please, explain what do you mean.
Regarding my question about the value 10240, I looked into Cloud Console UI and it limits the range to be from 1 to 1024 TB. I do not know if client library limits the range but I think that making it matching UX in Console is preferred.
|
@TetyanaYahodska I am puzzled by the multiple responses saying "It's not a scope of this task. I've created a new task ...". The review is done for the code changed in this PR. However, the changes may influence the code that was not touched as well. In majority of situations splitting the work on the code review comments into multiple PRs makes the process to review and track changes harder than necessary. If you find the feedback unclear or you disagree with the recommendations, please argument your point of view either in the comments or by scheduling a meeting. |
|
@minherz I don't mind making the changes you've asked me to make to code unrelated to this task. But as I know, the goal of each task should correspond to the implemented code and have an explanation for the changes made to the task. But if you want to review the big PRs, I'm open to your suggestions. Thank you for your patience! |
minherz
left a comment
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.
Thank you for addressing all the comments. Please apply one remaining change to improve the code readability.
compute/cloud-client/src/main/java/compute/disks/storagepool/CreateHyperdiskStoragePool.java
Outdated
Show resolved
Hide resolved
minherz
left a comment
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. approving to avoid blocking your progress. however, before merging, please look to address the following:
- apply changes to the test code described in this comment thread
- i still do not get full understanding why the code uses
10240instead of1024when passing the capacity value. I think it can be confusing to developers. Maybe the value is already1024and I am confused by Github UI. If it is still10240, please have a look into the client library to see whether or not it should be1024.
Thank you
| public void stage2_CreateHyperdiskStoragePoolTest() | ||
| throws IOException, ExecutionException, InterruptedException, TimeoutException { |
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.
according to your explanations the second test does not validate the code sample. the code sample shows how to create a storage pool. the test(s) should validate the code.
please, modify the test class to do one of the following, either to remove the second test because it does not add to the validation to code sample or perform all validations / asserts in the first test method.
|
@minherz After changing capacity to 1024 I've got error "message": "Provisioned capacity 1024 is smaller than the minimum allowed capacity 10240.", |
Description
Sample in NodeJs - GoogleCloudPlatform/nodejs-docs-samples#3826
Fixes #
Note: Before submitting a pull request, please open an issue for discussion if you are not associated with Google.
Checklist
pom.xmlparent set to latestshared-configurationmvn clean verifyrequiredmvn -P lint checkstyle:checkrequiredmvn -P lint clean compile pmd:cpd-check spotbugs:checkadvisory only