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

Counters and Lists: Remove Bool Returns #3738

Merged
merged 22 commits into from
Apr 19, 2024

Conversation

Kalaiselvi84
Copy link
Contributor

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 #3737

Special notes for your reviewer:

@Kalaiselvi84
Copy link
Contributor Author

Once the testing is completed, I will move this PR to ready for review.

@Kalaiselvi84 Kalaiselvi84 changed the title Cl rm bool Counters and Lists: Remove Bool Returns Mar 27, 2024
@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 4b2593e5-ac8e-4664-9ed4-ed3d6258b320

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@Kalaiselvi84
Copy link
Contributor Author

@markmandel Could you please share the expected output for the methods from which we plan to remove the boolean return type?
Here is the list:
IncrementCounter,
DecrementCounter,
SetCounterCount,
SetCounterCapacity,
SetListCapacity,
AppendListValue,
DeleteListValue.

I've tried testing with IncrementCounter:

nc -u localhost 7654
GET_COUNTER_COUNT rooms
COUNTER: 1
INCREMENT_COUNTER games 1
ERROR: INCREMENT_COUNTER games 1
INCREMENT_COUNTER rooms 1
INCREMENT_COUNTER rooms 1GET_COUNTER_COUNT rooms [Please note that for the success use case, the return value will be `nil`. Should we include (string, error) as return types to include the `\n`?]
COUNTER: 2
INCREMENT_COUNTER rooms 100
ERROR: INCREMENT_COUNTER rooms 100
INCREMENT_COUNTER rooms -1    
ERROR: INCREMENT_COUNTER rooms -1

@github-actions github-actions bot added the size/S label Apr 4, 2024
@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 9647b3b8-5ffc-4eac-a36b-b0796077f4c5

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@Kalaiselvi84 Kalaiselvi84 marked this pull request as ready for review April 5, 2024 22:13
@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 0fffb6b6-e1df-4f05-ad0a-c1e64e4024da

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

Copy link
Member

@markmandel markmandel left a comment

Choose a reason for hiding this comment

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

Just some small tweaks. @igooch did you want to review as well?

sdks/go/alpha.go Outdated Show resolved Hide resolved
sdks/go/alpha.go Outdated Show resolved Hide resolved
sdks/go/alpha.go Outdated Show resolved Hide resolved
@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 6d49ae21-b80c-4e3f-8559-727b59bc4342

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

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 with a few minor formatting suggestions.

As you probably already know we'll need to push the updated simple-game-server and update the simple-game-server version in framework.go.

sdks/go/alpha.go Show resolved Hide resolved
sdks/go/alpha.go Show resolved Hide resolved
@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 7ea05270-11dd-4b98-8603-474812a9a22d

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

Copy link
Member

@markmandel markmandel left a comment

Choose a reason for hiding this comment

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

LGTM! @igooch any last comments?

@Kalaiselvi84
Copy link
Contributor Author

The simple-game-server example has been updated with a new image in the registry and the associated files.

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: ecd3d77b-e22b-4576-a344-8ba0ed3d4636

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 467082b3-c698-4f20-b29c-722dae9f447e

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 93da1a87-af2e-4717-a995-6a1980ec341b

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 776f85a0-c962-437c-818e-8c141541a9c3

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@@ -322,26 +323,23 @@ func handleResponse(txt string, s *sdk.SDK, cancel context.CancelFunc) (response
responseError = fmt.Errorf("Invalid INCREMENT_COUNTER, should have 2 arguments")
return
}
response, responseError = incrementCounter(s, parts[1], parts[2])
addACK = false
Copy link
Collaborator

Choose a reason for hiding this comment

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

When addACK = true then any response will start with "ACK" which why we're seeing actual : "ACK: SUCCESS\n" as the result.

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 haven't made any modifications to the value of this addACK.

Here's the code snippet:

if err != nil {
		return err.Error(), false, err
	}

Copy link
Collaborator

Choose a reason for hiding this comment

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

That's in the case where there is an error. In the case where there is no error it returns the default addACK = true.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes I understand this part, when there is no error, the default value will be addAck = true.
Sorry, I want to make sure I get it right. Could you please share your suggestion differently?

Copy link
Member

Choose a reason for hiding this comment

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

I believe @igooch is saying that when you look at the e2e tests:

    fleet_test.go:1745: 
        	Error Trace:	/go/src/agones.dev/agones/test/e2e/fleet_test.go:1745
        	Error:      	Not equal: 
        	            	expected: "SUCCESS: true\n"
        	            	actual  : "ACK: SUCCESS\n"

The reason that the actual response is ACK: SUCCESS, is because you removed the line addACK = false -- whereas it should remain in to remove the "ACK: " from the response we're seeing in e2e tests (and I expect locally as well).

Copy link
Member

Choose a reason for hiding this comment

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

That's a good pickup @igooch - I didn't see the "ACK: SUCCESS" output in #3738 (comment) - whereas the output should just be "SUCCESS".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for explaining. I've made changes to the code in the main.go and gameserver_test.go files. Please review the testing for the success use case. Once you both confirm the changes, will push a new image to production.

$ nc -u localhost 7654
GET_COUNTER_COUNT rooms
COUNTER: 1
INCREMENT_COUNTER rooms 1
SUCCESS
INCREMENT_COUNTER rooms 1
SUCCESS
DECREMENT_COUNTER rooms 1
SUCCESS
SET_COUNTER_COUNT rooms 5
SUCCESS
SET_COUNTER_CAPACITY rooms 6
SUCCESS
SET_LIST_CAPACITY players 1000
SUCCESS
APPEND_LIST_VALUE players test3
SUCCESS
DELETE_LIST_VALUE players test2
SUCCESS

Copy link
Member

Choose a reason for hiding this comment

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

That looks good!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@igooch I look forward to hearing your thoughts at your convenience!🙂

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: eb429176-2c8f-4179-978d-ca3f8c1c2505

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 63343479-86dd-4cb5-be5d-ce7459104a6b

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@zmerlynn zmerlynn enabled auto-merge (squash) April 19, 2024 20:36
@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 42cf8722-c134-480c-af86-d331f3b90425

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@zmerlynn
Copy link
Collaborator

@Kalaiselvi84

Step #1 - "e2e-feature-gates":         	Error Trace:	/go/src/agones.dev/agones/test/e2e/fleet_test.go:1662
Step #1 - "e2e-feature-gates":         	Error:      	Not equal: 
Step #1 - "e2e-feature-gates":         	            	expected: "SUCCESS: true\n"
Step #1 - "e2e-feature-gates":         	            	actual  : "SUCCESS\n"
Step #1 - "e2e-feature-gates":         	            	
Step #1 - "e2e-feature-gates":         	            	Diff:
Step #1 - "e2e-feature-gates":         	            	--- Expected
Step #1 - "e2e-feature-gates":         	            	+++ Actual
Step #1 - "e2e-feature-gates":         	            	@@ -1,2 +1,2 @@
Step #1 - "e2e-feature-gates":         	            	-SUCCESS: true
Step #1 - "e2e-feature-gates":         	            	+SUCCESS

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 5de71090-0210-4f07-8689-0f96a5305e37

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: e1c4fba8-7a19-478d-a4e2-66c0c9c0b642

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/3738/head:pr_3738 && git checkout pr_3738
  • 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.40.0-dev-8e6d7b3-amd64

@zmerlynn zmerlynn merged commit 53a70b3 into googleforgames:main Apr 19, 2024
4 checks passed
@Kalaiselvi84 Kalaiselvi84 added kind/cleanup Refactoring code, fixing up documentation, etc kind/breaking Breaking change and removed kind/other labels Apr 22, 2024
spiceratops added a commit to spiceratops/k8s-gitops that referenced this pull request May 13, 2024
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [agones](https://agones.dev)
([source](https://togithub.com/googleforgames/agones)) | minor |
`1.39.0` -> `1.40.0` |

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency
Dashboard for more information.

---

### Release Notes

<details>
<summary>googleforgames/agones (agones)</summary>

###
[`v1.40.0`](https://togithub.com/googleforgames/agones/blob/HEAD/CHANGELOG.md#v1400-2024-04-23)

[Compare
Source](https://togithub.com/googleforgames/agones/compare/v1.39.0...v1.40.0)

[Full
Changelog](https://togithub.com/googleforgames/agones/compare/v1.39.0...v1.40.0)

**Breaking changes:**

- Counters and Lists: Remove Bool Returns by
[@&#8203;Kalaiselvi84](https://togithub.com/Kalaiselvi84) in
[googleforgames/agones#3738

**Implemented enhancements:**

- Leader Election in Custom Controller by
[@&#8203;Kalaiselvi84](https://togithub.com/Kalaiselvi84) in
[googleforgames/agones#3696
- Migrating from generate-groups.sh to kube_codegen.sh by
[@&#8203;Kalaiselvi84](https://togithub.com/Kalaiselvi84) in
[googleforgames/agones#3722
- Move GKEAutopilotExtendedDurationPods to Alpha in 1.28+ by
[@&#8203;zmerlynn](https://togithub.com/zmerlynn) in
[googleforgames/agones#3729
- Move DisableResyncOnSDKServer to Beta by
[@&#8203;Kalaiselvi84](https://togithub.com/Kalaiselvi84) in
[googleforgames/agones#3732
- Counters & Lists landing page and doc improvements by
[@&#8203;markmandel](https://togithub.com/markmandel) in
[googleforgames/agones#3649
- Graduate FleetAllocationOverflow to Stable by
[@&#8203;Kalaiselvi84](https://togithub.com/Kalaiselvi84) in
[googleforgames/agones#3733
- Adds Counters and Lists to CSharp SDK by
[@&#8203;igooch](https://togithub.com/igooch) in
[googleforgames/agones#3581
- Feat/counter and list defaulting order to ascending by
[@&#8203;lacroixthomas](https://togithub.com/lacroixthomas) in
[googleforgames/agones#3734
- Add handling for StatusAddresses in GameServerStatus for the Unity SDK
by [@&#8203;charlesvien](https://togithub.com/charlesvien) in
[googleforgames/agones#3739
- Feat(gameservers): Shared pod IPs with GameServer Addresses by
[@&#8203;lacroixthomas](https://togithub.com/lacroixthomas) in
[googleforgames/agones#3764
- Be prescriptive about rotating regions when updating Kubernetes
versions by [@&#8203;zmerlynn](https://togithub.com/zmerlynn) in
[googleforgames/agones#3716
- Fix ensure-e2e-infra-state-bucket by
[@&#8203;zmerlynn](https://togithub.com/zmerlynn) in
[googleforgames/agones#3719
- Create Performance Cluster 1.28 by
[@&#8203;Kalaiselvi84](https://togithub.com/Kalaiselvi84) in
[googleforgames/agones#3720
- Optimise GameServer Sub-Controller Queues by
[@&#8203;markmandel](https://togithub.com/markmandel) in
[googleforgames/agones#3781

**Fixed bugs:**

- Counters & Lists: Consolidate `priorities` sorting by
[@&#8203;markmandel](https://togithub.com/markmandel) in
[googleforgames/agones#3690
- Fix(Counter & Lists): Add validation for `priorities` by
[@&#8203;lacroixthomas](https://togithub.com/lacroixthomas) in
[googleforgames/agones#3714
- fix:
[#&#8203;3607](https://togithub.com/googleforgames/agones/issues/3607)
Metrics data loss in K8S controller by
[@&#8203;alvin-7](https://togithub.com/alvin-7) in
[googleforgames/agones#3692
- Deflake GameServerAllocationDuringMultipleAllocationClients by
allowing errors by
[@&#8203;Kalaiselvi84](https://togithub.com/Kalaiselvi84) in
[googleforgames/agones#3750

**Security fixes:**

- Bump protobufjs from 7.2.4 to 7.2.6 in /sdks/nodejs by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[googleforgames/agones#3755
- Bump golang.org/x/net from 0.19.0 to 0.23.0 by
[@&#8203;zmerlynn](https://togithub.com/zmerlynn) in
[googleforgames/agones#3793

**Other:**

- Flaky: TestGameServerCreationAfterDeletingOneExtensionsPod by
[@&#8203;markmandel](https://togithub.com/markmandel) in
[googleforgames/agones#3699
- Prep for release v1.40.0 by
[@&#8203;Kalaiselvi84](https://togithub.com/Kalaiselvi84) in
[googleforgames/agones#3700
- Bumps cpp-simple Image and Refactoring Example Makefiles by
[@&#8203;Kalaiselvi84](https://togithub.com/Kalaiselvi84) in
[googleforgames/agones#3695
- Upgrade Protobuf to 1.33.0 by
[@&#8203;Kalaiselvi84](https://togithub.com/Kalaiselvi84) in
[googleforgames/agones#3711
- Modify Script for Makefile Version Updates in Examples Directory by
[@&#8203;Kalaiselvi84](https://togithub.com/Kalaiselvi84) in
[googleforgames/agones#3712
- Adds simple genai server example documentation to the Agones site by
[@&#8203;igooch](https://togithub.com/igooch) in
[googleforgames/agones#3713
- Update Supported Kubernetes to 1.27, 1.28, 1.29 by
[@&#8203;Kalaiselvi84](https://togithub.com/Kalaiselvi84) in
[googleforgames/agones#3654
- fix: typo in docs by [@&#8203;qhyun2](https://togithub.com/qhyun2) in
[googleforgames/agones#3723
- Tweak: Setting up the Game Server by
[@&#8203;Kalaiselvi84](https://togithub.com/Kalaiselvi84) in
[googleforgames/agones#3717
- Docs: gke.md - spelling by
[@&#8203;daniellee](https://togithub.com/daniellee) in
[googleforgames/agones#3740
- Aesthetic rearrangement of cloudbuild.yaml by
[@&#8203;zmerlynn](https://togithub.com/zmerlynn) in
[googleforgames/agones#3741
- Docs: Make hitting <enter> on connection explicit by
[@&#8203;markmandel](https://togithub.com/markmandel) in
[googleforgames/agones#3743
- CI: Don't check Unreal Link by
[@&#8203;markmandel](https://togithub.com/markmandel) in
[googleforgames/agones#3745
- New recommendation for multi-cluster allocation by
[@&#8203;markmandel](https://togithub.com/markmandel) in
[googleforgames/agones#3744
- Custom Controller Example Page on Agones Website by
[@&#8203;Kalaiselvi84](https://togithub.com/Kalaiselvi84) in
[googleforgames/agones#3725
- Add Nitrado logo by [@&#8203;towolf](https://togithub.com/towolf) in
[googleforgames/agones#3753
- Remove unnecessary args from e2e-test-cloudbuild by
[@&#8203;zmerlynn](https://togithub.com/zmerlynn) in
[googleforgames/agones#3754
- Update Allocation from Fleet Documentation by
[@&#8203;Kalaiselvi84](https://togithub.com/Kalaiselvi84) in
[googleforgames/agones#3761
- Transform Lint Warnings into Errors by
[@&#8203;Kalaiselvi84](https://togithub.com/Kalaiselvi84) in
[googleforgames/agones#3756
- Update Canary Testing Documentation by
[@&#8203;Kalaiselvi84](https://togithub.com/Kalaiselvi84) in
[googleforgames/agones#3760
- Supertuxkart Example on Agones Site by
[@&#8203;Kalaiselvi84](https://togithub.com/Kalaiselvi84) in
[googleforgames/agones#3728
- Xonotic Example on Agones Site by
[@&#8203;Kalaiselvi84](https://togithub.com/Kalaiselvi84) in
[googleforgames/agones#3742
- nit documentation fix in kind cluster section when building Agones by
[@&#8203;vicentefb](https://togithub.com/vicentefb) in
[googleforgames/agones#3770
- Merged steps inside documentation about webhook certificate creation
by [@&#8203;vicentefb](https://togithub.com/vicentefb) in
[googleforgames/agones#3768
- Example Images: Increment Tags by
[@&#8203;Kalaiselvi84](https://togithub.com/Kalaiselvi84) in
[googleforgames/agones#3796
- Update simple game server example documentation by
[@&#8203;vicentefb](https://togithub.com/vicentefb) in
[googleforgames/agones#3776

**New Contributors:**

- [@&#8203;lacroixthomas](https://togithub.com/lacroixthomas) made their
first contribution in
[googleforgames/agones#3714
- [@&#8203;daniellee](https://togithub.com/daniellee) made their first
contribution in
[googleforgames/agones#3740
- [@&#8203;charlesvien](https://togithub.com/charlesvien) made their
first contribution in
[googleforgames/agones#3739
- [@&#8203;vicentefb](https://togithub.com/vicentefb) made their first
contribution in
[googleforgames/agones#3770

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://togithub.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zNTYuMSIsInVwZGF0ZWRJblZlciI6IjM3LjM1Ni4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJyZW5vdmF0ZS9oZWxtIiwidHlwZS9taW5vciJdfQ==-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/breaking Breaking change kind/cleanup Refactoring code, fixing up documentation, etc size/M size/S
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Go SDK] Remove boolean returned from relevant Counters and Lists methods
5 participants