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

feature(app): Add Limits field to App #203

Merged
merged 1 commit into from
Mar 12, 2021

Conversation

brandon-welsch
Copy link
Member

@brandon-welsch brandon-welsch commented Mar 11, 2021

Related to GRR-42

@brandon-welsch brandon-welsch requested a review from Soulou March 11, 2021 15:58
@brandon-welsch brandon-welsch force-pushed the fix/GRR-42/add-limits-field-to-app branch 2 times, most recently from 8448657 to 1015411 Compare March 11, 2021 16:40
@Soulou Soulou requested review from EtienneM and removed request for Soulou March 12, 2021 08:02
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"`
Copy link
Member

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 ?

Copy link
Member Author

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

Copy link
Member

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

Copy link
Member

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)

Copy link
Member Author

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{}

Copy link
Member Author

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

Copy link
Member

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

Copy link
Member

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

Copy link
Member Author

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{}

Copy link
Member

Choose a reason for hiding this comment

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

Let's go then

@brandon-welsch brandon-welsch requested a review from Soulou March 12, 2021 09:16
@brandon-welsch brandon-welsch force-pushed the fix/GRR-42/add-limits-field-to-app branch from 1015411 to eb3afff Compare March 12, 2021 11:17
@brandon-welsch brandon-welsch requested a review from EtienneM March 12, 2021 11:17
@brandon-welsch brandon-welsch merged commit f589812 into master Mar 12, 2021
@brandon-welsch brandon-welsch deleted the fix/GRR-42/add-limits-field-to-app branch March 12, 2021 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants