-
Notifications
You must be signed in to change notification settings - Fork 8
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
feature(app): Add Limits
field to App
#203
Conversation
8448657
to
1015411
Compare
apps.go
Outdated
ForceHTTPS bool `json:"force_https"` | ||
RouterLogs bool `json:"router_logs"` | ||
Flags map[string]bool `json:"flags"` | ||
Limits map[string]int64 `json:"limits"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My question is: are we sure it's an int, can't it be a float64 sometimes ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently everything is in integer, but indeed if we add a field of another type it could cause some problems. I can put an interface instead if you want
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm afraid it's not safe over time actually
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(So maybe interface{}
is safer, like that at each usage, the developer has to wonder, which type it is)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok i change it to map[string]interface{}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see how we would break applications, knowing that the field is not already present
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then the question is at a different level: I don't think this lib should adapt to the organizational problem of how to think about updating our libs when we update the output of the API. That's why we have this PR template on the API: https://github.com/Scalingo/api/blame/master/.github/pull_request_template.md#L4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To me there is also the thing that we should create libs with nice API that we don't break for any business reason, that's why I was in favor of interface{}
since there are unknowns here and it would prevent us from breaking the API in the future
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm in favor of the interface{}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's go then
1015411
to
eb3afff
Compare
Related to GRR-42