-
Notifications
You must be signed in to change notification settings - Fork 813
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
Simple Game Server: Add \n to Counters and Lists Response #3589
Conversation
I only changed |
Build Failed 😱 Build Id: a16f7069-4ac7-406e-8019-5ea68bc354fa To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The build will fail until the example simple-game-server image has been updated (otherwise the tests pull from the old image and don't "see" any changes to the simple-game-server/main.go file.) Although we should wait to update the image until all the tests pass locally.
Build Failed 😱 Build Id: b027e7a3-fd45-49e3-883f-195f4c93a437 To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
Tests |
Build Failed 😱 Build Id: 3ee7fa76-94ab-4e6f-99e6-01a9ac3fd1a0 To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. The only item that looked off was there appeared to be an empty error message for the GET_LIST_VALUES
when the passed List does not exist.
~/agones/examples$ nc -u 34.168.36.96 7477
INCREMENT_COUNTER games 1
SUCCESS: true
GET_COUNTER_COUNT games
COUNTER: 2
DECREMENT_COUNTER sessions 1
SUCCESS: true
GET_COUNTER_COUNT sessions
COUNTER: 0
SET_COUNTER_COUNT sessions 10000
ERROR: false
SET_COUNTER_COUNT sessions 10
SUCCESS: true
GET_COUNTER_COUNT sessions
COUNTER: 10
GET_COUNTER_CAPACITY sessions
CAPACITY: 1000
SET_COUNTER_CAPACITY games 99
SUCCESS: true
GET_COUNTER_CAPACITY games
CAPACITY: 99
GET_LIST_CAPACITY rooms
CAPACITY: 333
SET_LIST_CAPACITY rooms 100
SUCCESS: true
GET_LIST_CAPACITY rooms
CAPACITY: 100
LIST_CONTAINS room1
ERROR: Invalid LIST_CONTAINS, should have 2 arguments
LIST_CONTAINS rooms room1
SUCCESS: true
LIST_CONTAINS rooms room_1
false
ACK:
GET_LIST_LENGTH rooms
LENGTH: 3
GET_LIST_VALUES rooms
VALUES: room1,room2,room3
APPEND_LIST_VALUE rooms room4
SUCCESS: true
GET_LIST_VALUES abc
ERROR:
GET_LIST_VALUES rooms
VALUES: room1,room2,room3,room4
DELETE_LIST_VALUE room1
ERROR: Invalid DELETE_LIST_VALUE, should have 2 arguments
DELETE_LIST_VALUE rooms room1
SUCCESS: true
Right, also the response for the LIST_CONTAINS method should be prepended with LIST_CONTAINS rooms room_1 Will look into it. |
Could you also update some typos in the readme too? They're missing the second " agones/examples/simple-game-server/README.md Lines 42 to 47 in e52f20a
|
Build Failed 😱 Build Id: 16e003c0-d733-4979-b4d3-cef8765c21ab To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
Build Failed 😱 Build Id: bb0851ce-a0ee-4b5c-8fd9-ad0465f9998c To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
I have made updates to the Please review it and share your thoughts. |
examples/simple-game-server/main.go
Outdated
if len(values) > 0 { | ||
return "VALUES: " + strings.Join(values, ",") + "\n", nil | ||
} | ||
return "Empty List" + strings.Join(values, ",") + "\n", err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return "Empty List" + strings.Join(values, ",") + "\n", err | |
return "VALUES: <none>\n", err |
Or something like that? To be consistent with the other responses of having a "DESCRIPTOR:RESULT" format.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The response for the GetListValues empty
is "VALUES: <none>\n"
, and the ERROR: INVALID LIST NAME
response is returned for the list name if the given list name is incorrect.
$ nc -u localhost 7654
GET_COUNTER_COUNT rooms
COUNTER: 1
GET_LIST_VALUES players
VALUES: test0,test1,test2
LIST_CONTAINS players test1
FOUND: true
GET_LIST_VALUES abc
ERROR: INVALID LIST NAME
DELETE_LIST_VALUE test0
ERROR: Invalid DELETE_LIST_VALUE, should have 2 arguments
DELETE_LIST_VALUE players test0
SUCCESS: true
DELETE_LIST_VALUE players test1
SUCCESS: true
DELETE_LIST_VALUE players test2
SUCCESS: true
GET_LIST_VALUES players
VALUES:
Build Failed 😱 Build Id: d3c6ea83-1495-4ffd-843f-2d00759bf8e6 To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
Build Failed 😱 Build Id: a4e6ace8-2853-4797-b7d6-93c6a6ea3635 To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like the updated image reference is missing in a couple places like test/e2e/framework.go
.
Will update the new image in the |
Build Failed 😱 Build Id: 95dd8212-b214-4d84-999f-cff162a0a619 To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
A new image has been pushed for the simple-game-server in prod, and the necessary files have been updated with this new image. |
Build Failed 😱 Build Id: a5518d8b-eabc-4538-b057-d3a63a9fc32d To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
I've pushed a new image to the simple-game-server in production. However, I'm not really sure about the reason for the build failure. Am I missing anything that needs updating? If we can't fix this build issue, should we delete the new tag from the simple-game-server since tomorrow is the release day? |
Build Succeeded 👏 Build Id: 0472e475-800f-45f1-9bd5-5b9e29b1f174 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:
|
Log for passed tests - https://gist.github.com/Kalaiselvi84/4196d647e4c069bbe3b1237e8033ca66 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Congrats on getting this to pass!
I think one of my review comments kept getting lost, so I tried to make it as clear as possible. I think that's about it on review though. Lemme know if that's not clear. Shouldn't need to delete 0.26, since the current release isn't using it.
Since K8s clusters will cache existing image tags for a while, so once the review change has made, we will need to increment the version number and push again, as we can't force remove it from all clusters.
examples/simple-game-server/main.go
Outdated
return strconv.FormatBool(ok), err | ||
} | ||
if ok { | ||
return "FOUND: " + strconv.FormatBool(ok) + "\n", nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this review comment got lost somewhere - but this result should be the following.
func listContains(s *sdk.SDK, listName string, value string) (string, error) {
log.Printf("Getting List %s contains value %s", listName, value)
ok, err := s.Alpha().ListContains(listName, value)
if err != nil {
log.Printf("Error getting List %s contains value %s: %s", listName, value, err)
return strconv.FormatBool(ok), err
}
return "FOUND: " + strconv.FormatBool(ok) + "\n", nil
}
Not finding a value shouldn't be an error - it's just a search function.
test/e2e/gameserver_test.go
Outdated
}, | ||
"ListContains false": { | ||
msg: "LIST_CONTAINS games game0", | ||
want: "false", | ||
want: "ERROR: false\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test will need to change with the update to the response.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I thought the response for ListContains false
should be ERROR: false
. I have now updated it as per your suggestion. The response for the ListContains
is FOUND: true
and for ListContains false
it is FOUND: false
. Does this look good to you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏻 no worries - had a feeling my suggestion wasn't 100% clear. I feel like this will break the e2e test, since a new image.
This all LGTM! We just need it to pass! Probably best bet is to increment the tag again everywhere and push a new image.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will increment the tag now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've pushed the new image to the agones-images project and updated the necessary files with the new tag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤞🏻
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Success! The build has finished without any issues.
Build Failed 😱 Build Id: 9c0b19fa-d44b-4c1f-a241-ccd35430a178 To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
Build Succeeded 👏 Build Id: 24a044f2-fb30-48cf-b679-0a539b825789 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:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! @igooch giving you a last right of refusal, but if you are happy, I'm happy to merge just in time before release 👍🏻
What type of PR is this?
/kind cleanup
What this PR does / Why we need it:
Which issue(s) this PR fixes:
Closes #3586
Special notes for your reviewer: