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

Implementing discussed 0.2.0 CSI spec changes #182

Merged
merged 1 commit into from
Feb 8, 2018
Merged

Implementing discussed 0.2.0 CSI spec changes #182

merged 1 commit into from
Feb 8, 2018

Conversation

sbezverk
Copy link
Contributor

@sbezverk sbezverk commented Feb 1, 2018

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.

@sbezverk sbezverk mentioned this pull request Feb 1, 2018
@sbezverk
Copy link
Contributor Author

sbezverk commented Feb 1, 2018

@saad-ali @jdef @jieyu Appologies for bugging you, previous PR stopped accepting any chages I tried to push and I had to open a new one. This PR addresses the same from PR #176

@jieyu
Copy link
Member

jieyu commented Feb 1, 2018

@sbezverk can you add some text saying that negative value MUST not be returned by the SP for each int type?

@sbezverk
Copy link
Contributor Author

sbezverk commented Feb 1, 2018

@jieyu sure, do you want me to add this comment to each occurence of int or one common comment would be sufficient?

@akutz
Copy link
Contributor

akutz commented Feb 1, 2018

Hi @sbezverk,

Would you mind please titling the PR with a short, succinct description instead of just the issue numbers? Thanks!

@sbezverk
Copy link
Contributor Author

sbezverk commented Feb 1, 2018

@akutz There are 4 lines summarizing all the changes done by this PR. Do you need more details?

@sbezverk
Copy link
Contributor Author

sbezverk commented Feb 1, 2018

@akutz oops, misread your comment. Changing title.

@sbezverk sbezverk changed the title Issues_172_173_174 Implementing discussed 0.2.0 CSI spec changes Feb 1, 2018
@jieyu
Copy link
Member

jieyu commented Feb 1, 2018

@sbezverk I'd prefer each occurence of int to be more explicit.

@sbezverk
Copy link
Contributor Author

sbezverk commented Feb 1, 2018

@jieyu done, please let me know if added comments are sufficient.

Copy link
Member

@saad-ali saad-ali left a 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.
Copy link
Member

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.

Copy link
Contributor Author

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?

Copy link
Member

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.

Copy link
Contributor Author

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.
Copy link
Member

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?

Copy link
Contributor Author

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.
Copy link
Member

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/

Copy link
Contributor Author

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.
Copy link
Member

Choose a reason for hiding this comment

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

Ditto.

Copy link
Contributor Author

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.
Copy link
Member

Choose a reason for hiding this comment

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

ditto

Copy link
Contributor Author

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.
Copy link
Member

Choose a reason for hiding this comment

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

Ditto.

Copy link
Contributor Author

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.
Copy link
Member

Choose a reason for hiding this comment

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

Ditto.

Copy link
Contributor Author

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.
Copy link
Member

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)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@akutz
Copy link
Contributor

akutz commented Feb 2, 2018

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.

@sbezverk
Copy link
Contributor Author

sbezverk commented Feb 2, 2018

@akutz This change is fairly small it is just 27 lines in spec.md, does it really requires separate commits?

@akutz
Copy link
Contributor

akutz commented Feb 2, 2018 via email

@@ -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;

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.

Copy link
Contributor

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.

Copy link

@j-griffith j-griffith left a 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.

@sbezverk
Copy link
Contributor Author

sbezverk commented Feb 2, 2018

@j-griffith csi.proto is autogenerated file, the actual change was applied ONLY to spec.md

@akutz
Copy link
Contributor

akutz commented Feb 2, 2018

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.

@akutz
Copy link
Contributor

akutz commented Feb 2, 2018

I don't mind a lot of these changes, but aside from GetNodeID -> NodeGetID, many of them seem to be simply based on preference, and that's not a good reason IMO to break the existing spec. The VolumeInfo to Volume one, for example, will have an especially large impact.

@akutz
Copy link
Contributor

akutz commented Feb 2, 2018

I answered my own question about the unsigned integers after reading the original issue:

Recommendation from a gRPC author after review of CSI API: We should not use unsigned integers, and should change them to signed integers because not all languages allow unsigned integers (e.g. Java), and this can cause issues.

@sbezverk
Copy link
Contributor Author

sbezverk commented Feb 2, 2018

@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.

@akutz
Copy link
Contributor

akutz commented Feb 2, 2018

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.

@saad-ali
Copy link
Member

saad-ali commented Feb 5, 2018

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.

I don't mind a lot of these changes, but aside from GetNodeID -> NodeGetID, many of them seem to be simply based on preference, and that's not a good reason IMO to break the existing spec. The VolumeInfo to Volume one, for example, will have an especially large impact.

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.

Copy link
Contributor

@julian-hj julian-hj left a comment

Choose a reason for hiding this comment

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

👍

@sbezverk
Copy link
Contributor Author

sbezverk commented Feb 5, 2018

@jdef appreciate if you could review this revision of the spec. thanks a lot.

@saad-ali
Copy link
Member

saad-ali commented Feb 8, 2018

Merging. Please ensure future PRs are broken in to logical commits.

@saad-ali saad-ali merged commit 7ab01a9 into container-storage-interface:master Feb 8, 2018
@akutz
Copy link
Contributor

akutz commented Feb 8, 2018

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.

@sbezverk
Copy link
Contributor Author

sbezverk commented Feb 8, 2018

@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.

@akutz
Copy link
Contributor

akutz commented Feb 8, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants