Skip to content

SharedFileSystems: apiversions package - #409

Merged
jrperritt merged 2 commits into
gophercloud:masterfrom
jtopjian:sfs-apiversions
Jul 20, 2017
Merged

jrperritt merged 2 commits into
gophercloud:masterfrom
jtopjian:sfs-apiversions

Conversation

@jtopjian

Copy link
Copy Markdown
Contributor

For #408

@jrperritt There's some discussion here:

jtopjian@5bf58ab
jtopjian@7f48e23

This implementation could definitely use some critique when you have time.

Should proper error types be created?

The most notable oddity is that when retrieving a major version, an array is returned. I can't see why more than one result would be returned, but is that a safe assumption?

If it's best to handle multiple results, then this gets a little weird. The way I see it, a Get should be treated like a List and there should then be some convenience functions to extract the best result (or specify the type of result). But since there's no example of what multiple results would look like, it's really hard to think ahead.

/cc @pospispa

@jtopjian
jtopjian requested a review from jrperritt June 24, 2017 03:30
@coveralls

coveralls commented Jun 24, 2017 •

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.03%) to 71.053% when pulling 8b4ec44 on jtopjian:sfs-apiversions into 5102b60 on gophercloud:master.

@jtopjian jtopjian changed the title SharedFileSystems v2: apiversions package SharedFileSystems: apiversions package Jun 24, 2017
@pospispa

Copy link
Copy Markdown
Contributor

LGTM.

@pospispa

Copy link
Copy Markdown
Contributor

@jrperritt I'll appreciate if you have a look at this PR as there are two other PRs #346 and #381 that depend on this PR.

@j-griffith j-griffith left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

+1 for me

@pospispa

Copy link
Copy Markdown
Contributor

@jtopjian is it possible to merge this PR or do you prefer to wait for review from @jrperritt

Using types for Errors. Added erroneous API results to validate errors.
@jtopjian

Copy link
Copy Markdown
Contributor Author

Implemented Error types to better conform to how other errors are handled.

@coveralls

coveralls commented Jul 19, 2017 •

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.1%) to 71.134% when pulling 4408b27 on jtopjian:sfs-apiversions into 5102b60 on gophercloud:master.

// could not be found.
type ErrVersionNotFound struct{}

func (e ErrVersionNotFound) Error() string {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There is a kind of framework for errors in the gophercloud library.
This framework is used for defining errors, e.g. in https://github.com/gophercloud/gophercloud/blob/master/openstack/errors.go

However, the framework is not used here so it feels inconsistent.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

There is a kind of framework for errors in the gophercloud library.

I am aware of this.

However, the framework is not used here so it feels inconsistent.

Can you provide a more concrete example of how it can be used? I did not see an existing error type that would best fit the errors defined here and I didn't want to use BaseError just to say I used BaseError.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I agree that there is no existing error that would fit.

My point is that BaseError and func choseErrString are not used. However, I understand that you don't see much benefit using BaseError and func choseErrString.

@jrperritt jrperritt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks fine. There is already an issue for changing how errors are dealt with.

@jrperritt
jrperritt merged commit 4af874e into gophercloud:master Jul 20, 2017
cardoe pushed a commit to cardoe/gophercloud that referenced this pull request Aug 27, 2020
* vendor: Updating Gophercloud

* Image Service v2: Support Updating Properties

This commit enables full addition, modification, and removal
of properties during an image update.

In addition, the "direct_url" property will automatically be
added to the list of all properties if it is detected.

* Addressing review comments
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.

5 participants