Skip to content

Conversation

@jmrodri
Copy link
Contributor

@jmrodri jmrodri commented Jun 29, 2019

  • set path and query string properly
  • fix getNextImageURL parsing of path url
  • add unit test for getNextImageURL

@coveralls
Copy link

coveralls commented Jun 29, 2019

Coverage Status

Coverage increased (+0.3%) to 64.333% when pulling 4e560bc on jmrodri:bz1723422 into cf58dcc on automationbroker:master.

* set path and query string properly
* fix getNextImageURL parsing of path url
* add unit test for getNextImageURL
Copy link
Contributor

@shawn-hurley shawn-hurley left a comment

Choose a reason for hiding this comment

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

I think it will fix the problem, just some nits.


// path might be a fully qualified URL and we only want the path
// and query bits
thebits, err := url.Parse(path)
Copy link
Contributor

Choose a reason for hiding this comment

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

personally, I would change the variable name but not a blocker

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed to pathAsUrl let me know if that is not okay.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

actually changed it to pathAsURL since pathAsUrl pissed off lint :)

return nil, err
}

req.URL.Path = thebits.Path
Copy link
Contributor

Choose a reason for hiding this comment

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

could we just set req.URL = thebits?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The comment on NewRequest states they use the base URL from the client. So I wanted to keep the same functionality.

// NewRequest - creates and returns a *http.Request assuming the GET method.
// The base URL configured on the Client gets used with its Path component
// replaced by the path argument. If a token is available, it is added to the
// request automatically. "Accept: application/json" is added to all requests.
// The caller should customize the request as necessary before using it.

@jmrodri jmrodri merged commit 488d938 into automationbroker:master Jul 1, 2019
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.

3 participants