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

Supports Rust Alpha SDK #1717

Merged
merged 5 commits into from
Jul 29, 2020
Merged

Conversation

yoshd
Copy link
Contributor

@yoshd yoshd commented Jul 25, 2020

What type of PR is this?

/kind feature

What this PR does / Why we need it:

Add Rust Alpha SDK. This makes it easy to use the feature gate for player tracking in the Rust SDK.

For example, GetPlayerCount can be called like this:

let sdk = agones::Sdk::new()?;
let player_count = sdk.alpha().get_player_count()?;

Special notes for your reviewer:

Relates to #1033

@yoshd
Copy link
Contributor Author

yoshd commented Jul 25, 2020

/assign @roberthbailey

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 26463400-ef72-4203-aedc-822e8e27cf63

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/1717/head:pr_1717 && git checkout pr_1717
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.8.0-c357d8d

test/sdk/rust/src/main.rs Outdated Show resolved Hide resolved
test/sdk/rust/src/main.rs Outdated Show resolved Hide resolved
@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 48d7e9f9-dc94-473c-bacd-7a760ab6c58c

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/1717/head:pr_1717 && git checkout pr_1717
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.8.0-8b4c100

@roberthbailey
Copy link
Member

I am definitely a rust noobie and I think @markmandel has been writing some more rust lately so I'll let him take a look.

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.

Yay! More Rust! 😄

Added some notes, but I think it's minor type cleanup stuff. Thanks for doing this work!

@@ -165,7 +165,7 @@ run-sdk-conformance-test-go:
$(MAKE) run-sdk-conformance-no-build SDK_FOLDER=go GRPC_PORT=9001 HTTP_PORT=9101 FEATURE_GATES=PlayerTracking=true TESTS=$(DEFAULT_CONFORMANCE_TESTS),$(ALPHA_CONFORMANCE_TESTS)

run-sdk-conformance-test-rust:
$(MAKE) run-sdk-conformance-test SDK_FOLDER=rust
$(MAKE) run-sdk-conformance-test SDK_FOLDER=rust FEATURE_GATES=PlayerTracking=true TESTS=$(DEFAULT_CONFORMANCE_TESTS),$(ALPHA_CONFORMANCE_TESTS)
Copy link
Member

Choose a reason for hiding this comment

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

This should probably follow what Go is doing - which is running one without the flag, and then one with:

$(MAKE) run-sdk-conformance-test SDK_FOLDER=go GRPC_PORT=9001 HTTP_PORT=9101

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 the review.
OK. As far as I can see, it seems better not to duplicate ports between tests in each language.
I'll fix it like that.

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 fixed it.

sdks/rust/src/alpha.rs Show resolved Hide resolved
@@ -112,6 +112,69 @@ fn run() -> Result<(), String> {
sdk.set_label("test-label", &creation_ts.to_string())
.map_err(|e| format!("Could not run SetLabel(): {}. Exiting!", e))?;

println!("Setting player capacity...");
Copy link
Member

Choose a reason for hiding this comment

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

We could do a simple string comparison to see if "PlayerTracking=true" is contained in the FEATURE_GATES environment variable as a way to determine whether to run these tests or not?

Keep things simple, WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK. It seems easy to implement so I'll fix.

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 fixed it.

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: eedfc6e8-4d95-4c56-86e3-16a95792517f

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/1717/head:pr_1717 && git checkout pr_1717
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.8.0-c2a3600

@yoshd
Copy link
Contributor Author

yoshd commented Jul 28, 2020

/assign @markmandel

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.

Looks great! love it!

@google-oss-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: markmandel, yoshd

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-robot
Copy link

New changes are detected. LGTM label has been removed.

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: df14540a-632f-4177-b51b-187d2c6185ff

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/1717/head:pr_1717 && git checkout pr_1717
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.8.0-4c8e95f

@markmandel markmandel added area/user-experience Pertaining to developers trying to use Agones, e.g. SDK, installation, etc kind/feature New features for Agones labels Jul 29, 2020
@markmandel markmandel added this to the 1.8.0 milestone Jul 29, 2020
@markmandel markmandel merged commit b320b49 into googleforgames:master Jul 29, 2020
ilkercelikyilmaz pushed a commit to ilkercelikyilmaz/agones that referenced this pull request Oct 23, 2020
* Supports Rust Alpha SDK

Co-authored-by: Mark Mandel <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved area/user-experience Pertaining to developers trying to use Agones, e.g. SDK, installation, etc cla: yes kind/feature New features for Agones size/XXL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants