chore(modelserving): switch to new SDK structure#1377
Conversation
Merging this branch will decrease overall coverage
Coverage by fileChanged files (no unit tests)
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
|
| // theoretically, should never happen, but still catch zero values | ||
| validUntil := types.StringNull() | ||
| if tokenGetResp.Token.ValidUntil != nil { | ||
| if !tokenGetResp.Token.ValidUntil.IsZero() { | ||
| validUntil = types.StringValue(tokenGetResp.Token.ValidUntil.Format(time.RFC3339)) | ||
| } |
There was a problem hiding this comment.
I'd say this check isn't needed anymore—I'd remove it. But I'd like another opinion.
There was a problem hiding this comment.
I'd also remove it, the old code would also just have assigned a 0-value
| // theoretically, should never happen, but still catch zero values | ||
| validUntil := types.StringNull() | ||
| if tokenGetResp.Token.ValidUntil != nil { | ||
| if !tokenGetResp.Token.ValidUntil.IsZero() { | ||
| validUntil = types.StringValue(tokenGetResp.Token.ValidUntil.Format(time.RFC3339)) | ||
| } |
There was a problem hiding this comment.
I'd also remove it, the old code would also just have assigned a 0-value
| Description: utils.Ptr("desc"), | ||
| TtlDuration: utils.Ptr("1h"), |
There was a problem hiding this comment.
running go fix would reintroduce using new instead of utils.Ptr
| Name: utils.Ptr("name"), | ||
| Description: utils.Ptr("desc"), |
| } | ||
| if utils.Contains(tokensToDestroy, *items[i].Name) { | ||
| _, err := client.DeleteToken(ctx, testutil.Region, testutil.ProjectId, *items[i].Id).Execute() | ||
| if utils.Contains(tokensToDestroy, items[i].Name) { |
There was a problem hiding this comment.
could use slices.Contains instead of custom utility func
Description
relates to STACKITTPR-563
Checklist
make fmtexamples/directory)make generate-docs(will be checked by CI)make test(will be checked by CI)make lint(will be checked by CI)