Repository navigation
feat(scf): onboard scf platform describe/list and quota describe/list - #1720
Open
SerseusWasTaken wants to merge 1 commit into
Open
SerseusWasTaken wants to merge 1 commit into
SerseusWasTaken wants to merge 1 commit into
Conversation
…describe/list Relates to STACKITCLI-484
SerseusWasTaken
force-pushed
the
feat/scf-platform-commands
branch
from
October 30, 2026 14:40
2fcc3e0 to
500d923
Compare
Merging this branch will increase overall coverage
Coverage detailsCompared to commit 33ab07e (run #41070632930)
Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code. Changed unit test files:
|
Comment on lines
+111
to
+118
| func buildRequest(ctx context.Context, model *inputModel, apiClient scf.DefaultAPI, page, perPage int64) scf.ApiListPlatformsRequest { | ||
| // the API has non AIP-compliant pagination, which cannot be adapted with out SDK pagination utils. | ||
| pageSize := int64(perPage) | ||
| if model.Limit != nil && *model.Limit < pageSize { | ||
| pageSize = *model.Limit | ||
| } | ||
| return apiClient.ListPlatforms(ctx, model.ProjectId, model.Region).Page(page).PerPage(pageSize) | ||
| } |
Contributor
There was a problem hiding this comment.
Suggested change
| func buildRequest(ctx context.Context, model *inputModel, apiClient scf.DefaultAPI, page, perPage int64) scf.ApiListPlatformsRequest { | |
| // the API has non AIP-compliant pagination, which cannot be adapted with out SDK pagination utils. | |
| pageSize := int64(perPage) | |
| if model.Limit != nil && *model.Limit < pageSize { | |
| pageSize = *model.Limit | |
| } | |
| return apiClient.ListPlatforms(ctx, model.ProjectId, model.Region).Page(page).PerPage(pageSize) | |
| } | |
| func buildRequest(ctx context.Context, model *inputModel, apiClient scf.DefaultAPI) scf.ApiListPlatformsRequest { | |
| // the API has non AIP-compliant pagination, which cannot be adapted with out SDK pagination utils. | |
| pageSize := int64(maxPageSize) | |
| if model.Limit != nil && *model.Limit < pageSize { | |
| pageSize = *model.Limit | |
| } | |
| return apiClient.ListPlatforms(ctx, model.ProjectId, model.Region).Page(1).PerPage(pageSize) | |
| } |
function is always called with constant values, I'd inline them
| }), | ||
| isValid: true, | ||
| expectedRequest: fixtureRequest(func(request *scf.ApiListPlatformsRequest) { | ||
| request.PerPage(maxPageSize) |
Contributor
There was a problem hiding this comment.
Suggested change
| request.PerPage(maxPageSize) | |
| *request = request.PerPage(maxPageSize) |
PerPage has a value receiver.
In line 147 a request is built with testLimit whereas in prod code we always pass maxPageSize. I'd remove this param and also the page param, see comment in list.go
| params := testparams.NewTestParams() | ||
| for _, tt := range tests { | ||
| t.Run(tt.name, func(t *testing.T) { | ||
| if err := outputResult(params.Printer, tt.model, tt.quotas); (err != nil) != tt.wantErr { |
Contributor
There was a problem hiding this comment.
Suggested change
| if err := outputResult(params.Printer, tt.model, tt.quotas); (err != nil) != tt.wantErr { | |
| tt.model.OutputFormat = tt.outputFormat | |
| if err := outputResult(params.Printer, tt.model, tt.quotas); (err != nil) != tt.wantErr { |
tt.outputFormat currently never read
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Relates to STACKITCLI-484
Checklist
make fmtmake generate-docs(will be checked by CI)make test(will be checked by CI)make lint(will be checked by CI)