Skip to content

Update Add and Remove List Value in SDK Server#4279

Merged
igooch merged 14 commits intoagones-dev:mainfrom
Sivasankaran25:update_add_remove_value
Oct 17, 2025
Merged

Update Add and Remove List Value in SDK Server#4279
igooch merged 14 commits intoagones-dev:mainfrom
Sivasankaran25:update_add_remove_value

Conversation

@Sivasankaran25
Copy link
Copy Markdown
Collaborator

What type of PR is this?

Uncomment only one /kind <> line, press enter to put that in a new line, and remove leading whitespace from that line:

/kind breaking

/kind bug

/kind cleanup
/kind documentation
/kind feature
/kind hotfix
/kind release

What this PR does / Why we need it:

Which issue(s) this PR fixes:

Closes #4275

Special notes for your reviewer:

@agones-bot
Copy link
Copy Markdown
Collaborator

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.

@Sivasankaran25
Copy link
Copy Markdown
Collaborator Author

/gcbrun

@agones-bot
Copy link
Copy Markdown
Collaborator

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.

@Sivasankaran25
Copy link
Copy Markdown
Collaborator Author

/gcbrun

@agones-bot
Copy link
Copy Markdown
Collaborator

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.

@Sivasankaran25
Copy link
Copy Markdown
Collaborator Author

/gcbrun

@agones-bot
Copy link
Copy Markdown
Collaborator

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.

@agones-bot
Copy link
Copy Markdown
Collaborator

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:

git fetch https://github.com/googleforgames/agones.git pull/4279/head:pr_4279 && git checkout pr_4279
helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.53.0-dev-a4d82a5

@lacroixthomas
Copy link
Copy Markdown
Collaborator

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)

@Sivasankaran25
Copy link
Copy Markdown
Collaborator Author

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)

I have tested the test cases, and they are all passing. I also verified the behavior with the SDK, and it is working as expected.
image
image

@agones-bot
Copy link
Copy Markdown
Collaborator

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:

git fetch https://github.com/googleforgames/agones.git pull/4279/head:pr_4279 && git checkout pr_4279
helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.53.0-dev-a02e3df

@agones-bot
Copy link
Copy Markdown
Collaborator

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.

@Sivasankaran25
Copy link
Copy Markdown
Collaborator Author

/gcbrun

@agones-bot
Copy link
Copy Markdown
Collaborator

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:

git fetch https://github.com/googleforgames/agones.git pull/4279/head:pr_4279 && git checkout pr_4279
helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.53.0-dev-318ae60

@agones-bot
Copy link
Copy Markdown
Collaborator

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:

git fetch https://github.com/googleforgames/agones.git pull/4279/head:pr_4279 && git checkout pr_4279
helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.53.0-dev-3efb943

Copy link
Copy Markdown
Collaborator

@igooch igooch left a comment

Choose a reason for hiding this comment

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

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.

return nil, errors.Errorf("already exists. Value: %s already in List: %s", in.Value, in.Name)
}
}
if in.Value == "" {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why this check? We don't have a requirement specifying that the string cannot be empty, only that a string must be unique.

for _, val := range list.Values {
if in.Value != val {
continue
// Remove the first matching value directly from the in-memory list
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We don't allow duplicate values, so there should only be one matching value in the list.

Comment on lines 1186 to 1188
list.Values = append(list.Values, in.Value)
batchList := s.gsListUpdates[in.Name]
batchList.valuesToAppend = list.Values
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks like this is a pre-existing bug. The valuesToAppend shouldn't contain the entire list, only the valuesToAppend and the new value.

Suggested change
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.

@agones-bot
Copy link
Copy Markdown
Collaborator

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:

git fetch https://github.com/googleforgames/agones.git pull/4279/head:pr_4279 && git checkout pr_4279
helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.53.0-dev-6ff29f2

@agones-bot
Copy link
Copy Markdown
Collaborator

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.

@Sivasankaran25
Copy link
Copy Markdown
Collaborator Author

/gcbrun

@agones-bot
Copy link
Copy Markdown
Collaborator

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.

@agones-bot
Copy link
Copy Markdown
Collaborator

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.

@agones-bot
Copy link
Copy Markdown
Collaborator

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.

@agones-bot
Copy link
Copy Markdown
Collaborator

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.

@agones-bot
Copy link
Copy Markdown
Collaborator

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.

@agones-bot
Copy link
Copy Markdown
Collaborator

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.

@agones-bot
Copy link
Copy Markdown
Collaborator

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.

@Sivasankaran25
Copy link
Copy Markdown
Collaborator Author

/gcbrun

@agones-bot
Copy link
Copy Markdown
Collaborator

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.

@Sivasankaran25 Sivasankaran25 force-pushed the update_add_remove_value branch from d032f05 to 5a67cef Compare October 14, 2025 15:12
@agones-bot
Copy link
Copy Markdown
Collaborator

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.

@agones-bot
Copy link
Copy Markdown
Collaborator

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:

git fetch https://github.com/googleforgames/agones.git pull/4279/head:pr_4279 && git checkout pr_4279
helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.53.0-dev-20b1fb8

@agones-bot
Copy link
Copy Markdown
Collaborator

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:

git fetch https://github.com/googleforgames/agones.git pull/4279/head:pr_4279 && git checkout pr_4279
helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.53.0-dev-3c41560

Copy link
Copy Markdown
Collaborator

@igooch igooch left a comment

Choose a reason for hiding this comment

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

One last item, then looks good!

@agones-bot
Copy link
Copy Markdown
Collaborator

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.

@Sivasankaran25
Copy link
Copy Markdown
Collaborator Author

/gcbrun

@agones-bot
Copy link
Copy Markdown
Collaborator

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:

git fetch https://github.com/googleforgames/agones.git pull/4279/head:pr_4279 && git checkout pr_4279
helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.53.0-dev-9d9f29c

Copy link
Copy Markdown
Collaborator

@igooch igooch left a comment

Choose a reason for hiding this comment

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

Thanks for the work!

@igooch igooch merged commit 1eca765 into agones-dev:main Oct 17, 2025
4 checks passed
mnthe pushed a commit to mnthe/agones that referenced this pull request Mar 23, 2026
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug These are bugs. size/S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect response for list addValue and removeValue (agones SDK)

4 participants