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

Client refactor #48

Merged
merged 2 commits into from
Feb 27, 2015
Merged

Client refactor #48

merged 2 commits into from
Feb 27, 2015

Conversation

anweiss
Copy link

@anweiss anweiss commented Feb 18, 2015

Refactor client for consolidation and to support custom config options

@ahmetb
Copy link
Contributor

ahmetb commented Feb 18, 2015

Better commit message maybe?

//NewAnonymouseClient creates a new azure.Client with no credentials set.
// ClientConfig provides a configuration for use by a Client
type ClientConfig struct {
ManagementCert []byte
Copy link
Contributor

Choose a reason for hiding this comment

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

since you switched PRs (something we shouldn't do 😄) you lost my comment here. this ManagementCert is not a client configuration. It's regarding how the client is fundamentally built.

Assume you're adding OAuth support and now are you gonna put a token string right next to this? That would be weird... When something like this happens it just means there's a design mistake, in this case you're putting unrelated things together. Config should be things that are shared regardless of how the client is built. Some examples: managementURL, useHTTPS, logger, timeout, retryPolicy etc...

So you should probably replace the NewClientFromConfig to take managementCert []byte parameter along with config.

Copy link
Author

Choose a reason for hiding this comment

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

I agree. Good points. Will refactor this.

@anweiss
Copy link
Author

anweiss commented Feb 26, 2015

@ahmetalpbalkan this is driving me insane. So I cloned the MSOpenTech repo in to my Go workspace and added my fork as a separate remote. What should my exact steps be to update my feature branch off my fork to ensure that when I make subsequent commits on this feature branch it doesn't include commits that are already part of the master branch? The steps that I'm using now are as follows:

  1. Pull latest from origin/master
  2. Checkout anweiss/master
  3. Merge origin/master in to anweiss/master
  4. Checkout anweiss/multi-env
  5. Merge anweiss/master in to anweiss/multi-env
  6. Add new commits to feature branch
  7. Rebase feature branch to consolidate my commits
  8. Force push anweiss/multi-env

@ahmetb
Copy link
Contributor

ahmetb commented Feb 26, 2015

  1. remote all anweiss/ branches (or remove the dir and re-clone)
  2. git remote add anweiss (or do not clone from msopentech, instead clone your remote)
  3. git fetch anweiss
  4. git checkout anweiss/multi-env
  5. git checkout -b multi-env
  6. git log (verify it's the commit you see here)
  7. do changes
  8. git push -f anweiss multi-env

@anweiss
Copy link
Author

anweiss commented Feb 26, 2015

Thanks @ahmetalpbalkan so those steps I have down...but how do I update my multi-env branch with the latest revisions in origin/master?

@ahmetb
Copy link
Contributor

ahmetb commented Feb 26, 2015

you shouldn't be working on your master. all your changes must be on a branch named multi-env.

$ git checkout multi-env
$ git fetch msopentech
$ git rebase msopentech/master
## resolve merge conflicts, if any. run git status -s, see if "U" exists.
$ git add ??
$ git rebase --continue

Signed-off-by: Andrew Weiss <andrew.weiss@microsoft.com>
@anweiss
Copy link
Author

anweiss commented Feb 26, 2015

Thanks! Got it all fixed and now know the process for future PRs.

// NewClient creates a new Client using the given subscription ID and
// management certificate
func NewClient(subscriptionID string, managementCert []byte) (Client, error) {
return makeClient(subscriptionID, managementCert, defaultAzureManagementURL)
Copy link
Contributor

Choose a reason for hiding this comment

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

this should really call NewClientFromConfig with "default config" (in this case we just have the URL but in the future, default retry policy, etc).

Signed-off-by: Andrew Weiss <andrew.weiss@microsoft.com>
@ahmetb
Copy link
Contributor

ahmetb commented Feb 26, 2015

LGTM, will merge.

ahmetb added a commit that referenced this pull request Feb 27, 2015
Support custom configuration and `[]byte` cert constructor
@ahmetb ahmetb merged commit ae28d1e into Azure:master Feb 27, 2015
marstr pushed a commit to marstr/azure-sdk-for-go that referenced this pull request Apr 27, 2017
* Complete parameters for table operations

* Complete parameters in entity operations

* Complete parameters in query table operation

* Added get entity operation

* Added get table operation

* Included test recordings

* Fixed merge little mess

* Fix travis
marstr pushed a commit that referenced this pull request Apr 28, 2017
* Complete parameters for table operations

* Complete parameters in entity operations

* Complete parameters in query table operation

* Added get entity operation

* Added get table operation

* Included test recordings

* Fixed merge little mess

* Fix travis
mcardosos added a commit that referenced this pull request May 4, 2017
* Complete parameters for table operations

* Complete parameters in entity operations

* Complete parameters in query table operation

* Added get entity operation

* Added get table operation

* Included test recordings

* Fixed merge little mess

* Fix travis
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.

2 participants