Update Add and Remove List Value in SDK Server#4279
Conversation
|
Build Failed 😭 Build Id: c340657c-d6c5-4306-a3de-5ee09a0f45f1 Status: FAILURE To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
|
/gcbrun |
|
Build Failed 😭 Build Id: fcc10e19-65b1-4747-b427-255971ef3391 Status: FAILURE To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
|
/gcbrun |
|
Build Failed 😭 Build Id: 6214c52a-00b3-4f12-80b7-e7e456cd8338 Status: FAILURE To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
|
/gcbrun |
|
Build Failed 😭 Build Id: 8b56e249-dccc-485b-80db-8d7f07b16bbe Status: FAILURE To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
|
Build Succeeded 🥳 Build Id: 51d1511e-f5d2-4ff8-a3ad-d60e3d8cd798 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version: |
|
Maybe we could add some unit tests to ensure there will be no regression in the future ? It's strange that no unit tests fails now that we returns the proper values (maybe we were not checking returned values at all) |
|
Build Succeeded 🥳 Build Id: 4d3255bd-acb6-4b65-b6dc-d0670723a8c1 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version: |
|
Build Failed 😭 Build Id: 950d3964-ec8d-426b-9dee-35062e2728b1 Status: FAILURE To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
|
/gcbrun |
|
Build Succeeded 🥳 Build Id: 5e208ab9-9790-46d7-9f26-fd6846633adb The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version: |
|
Build Succeeded 🥳 Build Id: 122449e5-7cbc-4d8e-b0fd-aba027f435ca The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version: |
igooch
left a comment
There was a problem hiding this comment.
Not explicitly mentioned in the issue for this PR is that the RemoveListValues and AddListValues are expected to be atomic. In general, I'm not sure what the benefit is of only holding the update diffs gsCounterUpdates map[string]counterUpdateRequest and gsListUpdates map[string]listUpdateRequest instead of keeping a full copy of the Counter or List that will be updated, and then on batch applying the copy of the Counter or List. If this List is large there might be some memory benefit.
pkg/sdkserver/sdkserver.go
Outdated
| return nil, errors.Errorf("already exists. Value: %s already in List: %s", in.Value, in.Name) | ||
| } | ||
| } | ||
| if in.Value == "" { |
There was a problem hiding this comment.
Why this check? We don't have a requirement specifying that the string cannot be empty, only that a string must be unique.
pkg/sdkserver/sdkserver.go
Outdated
| for _, val := range list.Values { | ||
| if in.Value != val { | ||
| continue | ||
| // Remove the first matching value directly from the in-memory list |
There was a problem hiding this comment.
We don't allow duplicate values, so there should only be one matching value in the list.
pkg/sdkserver/sdkserver.go
Outdated
| list.Values = append(list.Values, in.Value) | ||
| batchList := s.gsListUpdates[in.Name] | ||
| batchList.valuesToAppend = list.Values |
There was a problem hiding this comment.
Looks like this is a pre-existing bug. The valuesToAppend shouldn't contain the entire list, only the valuesToAppend and the new value.
| list.Values = append(list.Values, in.Value) | |
| batchList := s.gsListUpdates[in.Name] | |
| batchList.valuesToAppend = list.Values | |
| batchList := s.gsListUpdates[in.Name] | |
| batchList.valuesToAppend = append(batchList.valuesToAppend, in.Value) |
You might need to do the append(batchList.valuesToAppend, in.Value) in a separate variable first.
|
Build Succeeded 🥳 Build Id: c5b17758-356c-4d25-95a7-428f12a3be24 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version: |
|
Build Failed 😭 Build Id: b798db6a-1710-460f-909d-a34a206dd5dd Status: FAILURE To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
|
/gcbrun |
|
Build Failed 😭 Build Id: 3f3aa7b5-a4f8-4053-9a7f-42ea085bd7ff Status: FAILURE To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
|
Build Failed 😭 Build Id: 028670b0-5f44-4707-bc96-ea216530b19c Status: FAILURE To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
|
Build Failed 😭 Build Id: 67640fd5-63c7-4a66-84b6-45e0c2ae4542 Status: FAILURE To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
|
Build Failed 😭 Build Id: a7f53c10-eee1-4f09-ae85-21d7a264246c Status: FAILURE To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
|
Build Failed 😭 Build Id: cabfc04c-82fe-4dcc-a153-70a3650e35d4 Status: FAILURE To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
|
Build Failed 😭 Build Id: 3f79f1c8-7f8e-4e0c-b1d4-dc46d499f743 Status: FAILURE To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
|
Build Failed 😭 Build Id: c3bae748-ed99-4bcc-9985-ab891f0e800f Status: FAILURE To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
|
/gcbrun |
|
Build Failed 😭 Build Id: 80423dbf-9b12-49ae-8fb0-514253d73c6f Status: FAILURE To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
d032f05 to
5a67cef
Compare
|
Build Failed 😭 Build Id: f40f4268-7cc6-4b4f-9303-0893bb53765b Status: FAILURE To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
|
Build Succeeded 🥳 Build Id: 23b51bdd-c463-4c4d-b7fd-f68608d843ce The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version: |
|
Build Succeeded 🥳 Build Id: 26dd346a-b6a7-4920-9780-aa630239e574 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version: |
|
Build Failed 😭 Build Id: 353b1c23-773f-4978-9392-f684d55c3228 Status: FAILURE To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
|
/gcbrun |
|
Build Succeeded 🥳 Build Id: 87eee7a0-7baa-4a6a-ade4-62c535b69138 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version: |
* Update Add and Remove List Value in SDK Server * fix add and remove list value testcases * Update comments changes * remove string empty condition * remove unwanted lines * Remove health state in Supertukart test * Update Inital Delay Seconds * Restore previous values in Initial Delay Seconds * Update inital Delay Seconds * Update inital Delay Seconds * Update inital Delay Seconds * update gameserver e2e file


What type of PR is this?
/kind bug
What this PR does / Why we need it:
Which issue(s) this PR fixes:
Closes #4275
Special notes for your reviewer: