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

Implement ListDomain API #879

Merged
merged 4 commits into from
Jun 22, 2018

Conversation

longquanzheng
Copy link
Contributor

No description provided.

@longquanzheng longquanzheng requested a review from samarabbas June 22, 2018 00:57
return nil, wh.error(errRequestNotSet, scope)
}

pageSize := 100
Copy link
Contributor

Choose a reason for hiding this comment

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

care to make this configurable? in the service.go file

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would suggest not to use config file for this number unless you really need it.

  1. User can always pass in a pageSize in the API. That would be the most use cases.
  2. It is not necessary that we have to use different default page size in different environment(staging/sjc/dca/autobots/public repo/etc)
  3. Having config will add more code and more configs, which would introduce lots of unnecessary code/config(staging/sjc/dca/autobots/public repo/etc).
  4. If having it in config, we still need to verify if the config value is set or not. If not, do you want to exit the process? Or use a another default value from code? Both look unnecessary.

I am trying to understand why you want this. If this hardcoding number bothers you, I think we can use a constant number defined on the top of the file or somewhere else.

Copy link
Contributor

Choose a reason for hiding this comment

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

if you take a look at the service.go file or at least the top of the file you are changing, you can see a lot of const, which makes it easy to manage.

defining a arbitrary number everywhere in the code is not a good practice.

@@ -802,8 +802,18 @@ struct RegisterDomainRequest {
80: optional map<string,string> data
}

struct ListDomainRequest {
10: optional i32 pageSize
20: optional string nextPageToken
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you binary blob for nextPageToken.

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

Copy link
Contributor

@samarabbas samarabbas left a comment

Choose a reason for hiding this comment

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

Can you also include an integration test for list domain?

@longquanzheng longquanzheng merged commit 4fda6d0 into cadence-workflow:master Jun 22, 2018
@longquanzheng longquanzheng deleted the listdomains branch January 5, 2020 01:17
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