-
Notifications
You must be signed in to change notification settings - Fork 373
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
Implementing discussed 0.2.0 CSI spec changes #182
Implementing discussed 0.2.0 CSI spec changes #182
Conversation
@sbezverk can you add some text saying that negative value MUST not be returned by the SP for each int type? |
@jieyu sure, do you want me to add this comment to each occurence of |
Hi @sbezverk, Would you mind please titling the PR with a short, succinct description instead of just the issue numbers? Thanks! |
@akutz There are 4 lines summarizing all the changes done by this PR. Do you need more details? |
@akutz oops, misread your comment. Changing title. |
@sbezverk I'd prefer each occurence of int to be more explicit. |
@jieyu done, please let me know if added comments are sufficient. |
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.
Minor suggestion on wording of negative, otherwise LGTM
csi.proto
Outdated
uint32 minor = 2; // This field is REQUIRED. | ||
uint32 patch = 3; // This field is REQUIRED. | ||
// NOTE: Plugin must ensure in returning valid **int** values, | ||
// **negative** values must **not** be returned. |
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.
How about: The value of these fields must not be negative.
for this one.
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 you suggest is to replace second line in the NOTE, right?
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.
Correct, I would suggest replace both lines with this.
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.
done
csi.proto
Outdated
@@ -228,19 +230,25 @@ message VolumeCapability { | |||
message CapacityRange { | |||
// Volume must be at least this big. This field is OPTIONAL. | |||
// A value of 0 is equal to an unspecified field value. | |||
uint64 required_bytes = 1; | |||
// NOTE: Plugin must ensure in returning valid **int** values, | |||
// **negative** values must **not** be returned. |
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.
How about: The value of this field must not be negative.
for this one. And same below?
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.
same question as above..
csi.proto
Outdated
@@ -228,19 +229,22 @@ message VolumeCapability { | |||
message CapacityRange { | |||
// Volume must be at least this big. This field is OPTIONAL. | |||
// A value of 0 is equal to an unspecified field value. | |||
uint64 required_bytes = 1; | |||
// The value of this field must not be negative. |
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.
s/must not/MUST NOT/
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.
done
csi.proto
Outdated
|
||
// Volume must not be bigger than this. This field is OPTIONAL. | ||
// A value of 0 is equal to an unspecified field value. | ||
uint64 limit_bytes = 2; | ||
// The value of this field must not be negative. |
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.
Ditto.
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.
done
csi.proto
Outdated
// The capacity of the volume in bytes. This field is OPTIONAL. If not | ||
// set (value of 0), it indicates that the capacity of the volume is | ||
// unknown (e.g., NFS share). | ||
uint64 capacity_bytes = 1; | ||
// The value of this field must not be negative. |
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.
ditto
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.
done
csi.proto
Outdated
@@ -402,7 +406,8 @@ message ListVolumesRequest { | |||
// in the subsequent `ListVolumes` call. This field is OPTIONAL. If | |||
// not specified (zero value), it means there is no restriction on the | |||
// number of entries that can be returned. | |||
uint32 max_entries = 2; | |||
// The value of this field must not be negative. |
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.
Ditto.
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.
done
csi.proto
Outdated
@@ -452,7 +457,8 @@ message GetCapacityResponse { | |||
// specified in the request, the Plugin SHALL take those into | |||
// consideration when calculating the available capacity of the | |||
// storage. This field is REQUIRED. | |||
uint64 available_capacity = 1; | |||
// The value of this field must not be negative. |
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.
Ditto.
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.
done
spec.md
Outdated
uint32 major = 1; // This field is REQUIRED. | ||
uint32 minor = 2; // This field is REQUIRED. | ||
uint32 patch = 3; // This field is REQUIRED. | ||
// The value of these fields must not be negative. |
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'd suggest have one such line per field (in case we add more fields in the future)
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.
done
I think this PR should either contain multiple commits or be split into multiple PRs. I don’t like how many changes are being performed in a single commit. There are clear issues, and this PR doesn’t directly relate to any parictlaur one, which makes tracking things later more difficult. |
@akutz This change is fairly small it is just 27 lines in spec.md, does it really requires separate commits? |
I don’t consider 27 lines that small, and separate commits isn’t related to size but the purpose of the change. If changes are not related, why make them part of the same commit? Commits are cheap, and it’s good practice to make reverting changes easier by isolating work into smaller chunks. For example, if this PR is reverted, would you want it pulled out in its entirety or does it make sense to pull out smaller units of work?
…--
-a
On Feb 1, 2018, at 11:04 PM, Serguei Bezverkhi ***@***.***> wrote:
@akutz This change is fairly small it is just 27 lines in spec.md, does it really requires separate commits?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@@ -228,19 +231,22 @@ message VolumeCapability { | |||
message CapacityRange { | |||
// Volume must be at least this big. This field is OPTIONAL. | |||
// A value of 0 is equal to an unspecified field value. | |||
uint64 required_bytes = 1; | |||
// The value of this field MUST NOT be negative. | |||
int64 required_bytes = 1; |
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.
Do we want to get rid of the use of underscores while we're at it? Granted that's mostly my own pedantic annoyance :) and it would be a separate patch but just asking.
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.
Hi @j-griffith,
Please leave the underscores. The tell language generators how to camel case things.
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'm good with these clean ups and tightening up the conventions a bit. I'd like to gauge interest in going all in on additional "effective go" recommendations.
@j-griffith csi.proto is autogenerated file, the actual change was applied ONLY to spec.md |
I'm confused as to why we wouldn't used unsigned integers in the protobuf. It makes sense for versions and many other places it is used. |
I don't mind a lot of these changes, but aside from |
I answered my own question about the unsigned integers after reading the original issue:
|
@akutz Based on my understanding, since version info gets send/recevied in gRPC messages, the recommendation from gRPC team was to use int instead of uint as not all gRPC clients support uint type. |
I still remain adamant that there should be a separate commit, perhaps even PR, for each specific issue. Commits aren't about adding to a project, but about making it easy to remove things later if necessary. As it is now, any issue with any of these changes will require the removal of all of these changes. |
LGTM I agree it would be nice to have had this PR broken in to multiple commits. But if that's too much of a pain to do at this point, I'm fine accepting it as is.
If we're going to make breaking changes, might as well tighten the spec up. The reasoning behind VolumeInfo vs Volume is to align with the operation names CreateVolume, PublishVolume, etc. |
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.
👍
@jdef appreciate if you could review this revision of the spec. thanks a lot. |
Merging. Please ensure future PRs are broken in to logical commits. |
Just logging my objection to this being accepted as a single commit. It’s bad form, bad precedent, and bad practice. Reverting any of these now means reverting them all. |
@akutz all 3 changes are a part of 0.2.0, so it is ALL or nothing. You cannot have version 0.1.0.3/4. That is the only reason why these three changes are bundled. |
That is a blunt approach to a process usually handled with more finesse and care. All commits after the previous tag are not generally squashed upon a release, just because a release can be considered a sum of its parts. That’s a bad process. Features and changes are atomic so they can be reverted later, if necessary, even after a release. This PR and its changes should have been multiple commits to ensure that changes corresponding to each issue could be reverted separately. This PR was merged against all best practices, hence my objection. |
Closes: #172 #173 #174
Don't use unsigned integers in proto
Change “ID” to “Id” in Method names
Every “noun” should have a message, so Volume should be a message
These are breaking changes from the 0.1 release.