Skip to content
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

SDK server not clearing lists on update #3606

Merged
merged 5 commits into from
Jan 27, 2024

Conversation

jlory
Copy link
Contributor

@jlory jlory commented Jan 23, 2024

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 cleanup
/kind documentation
/kind feature
/kind hotfix
/kind release

/kind bug

What this PR does / Why we need it:

Fixes the issue where items in list could not be removed.

Which issue(s) this PR fixes:

#3593

Special notes for your reviewer:

Had to recreate the PR because of CLA issues.

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: b78bf70d-80aa-4a27-b33e-573c64133a00

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/3606/head:pr_3606 && git checkout pr_3606
  • 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.38.0-dev-4373e87-amd64

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 9e3f7f6d-e01b-4797-aa58-173ccd859a80

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/3606/head:pr_3606 && git checkout pr_3606
  • 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.38.0-dev-324cdfc-amd64

// Clear the gsCounterUpdates
s.gsCounterUpdates = map[string]counterUpdateRequest{}
// Clear the gsListUpdates
s.gsListUpdates = map[string]listUpdateRequest{}
Copy link
Member

Choose a reason for hiding this comment

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

Do we need an update to a unit test to ensure this doesn't happen again?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll have a look in the unit test file to see what's doable.

Copy link
Member

Choose a reason for hiding this comment

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

Appreciate you taking a look.

No rush, but just a heads up - we're cutting a release next Tuesday, so if you want this in the next release, we should get some unit tests in.

@igooch any advice on a good spot to write a unit test?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have something actually but it's at work, so tomorrow I should send an update to this MR, idea is:

  • add a function that get the len() of the outgoing lists
  • happy path = len() == 0
  • network failure / issues updating = original len

Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks good! The only thing I'd add is checking that the gsListUpdates has the update, i.e. is not zero after the update/add/remove call and before the get list call. Something like

if testCase.updated {
  updates := sc.gsListUpdatesLen()
  assert.Equal(t, 1, updates)
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

^Scratch that above suggestion, it would introduce a race condition. Code looks good as it stands.

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 63226160-64fe-4be2-815f-1ecc42098740

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/3606/head:pr_3606 && git checkout pr_3606
  • 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.38.0-dev-98fa9c1-amd64

@igooch igooch enabled auto-merge (squash) January 27, 2024 01:01
Copy link
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.

LGTM

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 2c1b7e2e-dc12-4ef0-bb36-20bc3fafc2aa

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/3606/head:pr_3606 && git checkout pr_3606
  • 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.38.0-dev-5207c9a-amd64

@igooch igooch merged commit d96fb3c into googleforgames:main Jan 27, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants