Skip to content

Dummy implementation of UsageService (2/5) #11290

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

Merged
merged 1 commit into from
Jul 12, 2022
Merged

Conversation

geropl
Copy link
Member

@geropl geropl commented Jul 11, 2022

Description

Dummy implementation of UsageService

Related Issue(s)

Context: #10325

How to test

  • (cd components/usage && go test -v ./...)

Release Notes

NONE

Documentation

Werft options:

  • /werft with-preview

@geropl geropl force-pushed the gpl/10325-useapi-2 branch 2 times, most recently from 8feacb8 to dfde0b6 Compare July 12, 2022 10:22
@roboquat roboquat added size/XL and removed size/XXL labels Jul 12, 2022
@geropl geropl force-pushed the gpl/10325-useapi-2 branch 2 times, most recently from 4f0ea03 to c9e8162 Compare July 12, 2022 13:07
@roboquat roboquat added size/XXL and removed size/XL labels Jul 12, 2022
@geropl geropl force-pushed the gpl/10325-useapi-2 branch from c9e8162 to 6e30b14 Compare July 12, 2022 13:23
@geropl geropl changed the title Hook up server with UsageService (2/3) Dummy implementation of UsageService Jul 12, 2022
@roboquat roboquat added size/L and removed size/XXL labels Jul 12, 2022
@geropl geropl changed the title Dummy implementation of UsageService Dummy implementation of UsageService (2/3) Jul 12, 2022
@geropl geropl changed the title Dummy implementation of UsageService (2/3) Dummy implementation of UsageService (2/4) Jul 12, 2022
@geropl geropl marked this pull request as ready for review July 12, 2022 13:37
@geropl geropl requested a review from a team July 12, 2022 13:37
@github-actions github-actions bot added the team: webapp Issue belongs to the WebApp team label Jul 12, 2022
@geropl geropl changed the title Dummy implementation of UsageService (2/4) Dummy implementation of UsageService (2/5) Jul 12, 2022
"google.golang.org/protobuf/testing/protocmp"
)

func TestUsageService_GetBilledUsage(t *testing.T) {
Copy link
Member

Choose a reason for hiding this comment

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

<3

Comment on lines +19 to +23
func (us *UsageService) GetBilledUsage(ctx context.Context, in *v1.GetBilledUsageRequest) (*v1.GetBilledUsageResponse, error) {
// TODO(geropl) Dummy data for now
response := v1.GetBilledUsageResponse{}
return &response, nil
}
Copy link
Member

Choose a reason for hiding this comment

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

If you wanted a terser version, you could do

Suggested change
func (us *UsageService) GetBilledUsage(ctx context.Context, in *v1.GetBilledUsageRequest) (*v1.GetBilledUsageResponse, error) {
// TODO(geropl) Dummy data for now
response := v1.GetBilledUsageResponse{}
return &response, nil
}
func (us *UsageService) GetBilledUsage(ctx context.Context, in *v1.GetBilledUsageRequest) (resp *v1.GetBilledUsageResponse, err error) {
return resp, err
}

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 know, but I generally prefer the explicit syntax - and room for the comment. 😉

@roboquat roboquat merged commit 0a83195 into main Jul 12, 2022
@roboquat roboquat deleted the gpl/10325-useapi-2 branch July 12, 2022 14:02
@roboquat roboquat added deployed: webapp Meta team change is running in production deployed Change is completely running in production labels Jul 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployed: webapp Meta team change is running in production deployed Change is completely running in production release-note-none size/L team: webapp Issue belongs to the WebApp team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants