agones icon indicating copy to clipboard operation
agones copied to clipboard

Rust CountsAndLists SDK implementation and conformance tests

Open igooch opened this issue 1 year ago • 5 comments

Arbitrary Counters and Lists for GameServers, SDKs and Allocation #2716 has been released in Alpha, and is looking for a contributor with Rust experience to implement the Rust SDK. The SDK methods to implement are listed in #2716, and have been implemented in Go https://github.com/googleforgames/agones/blob/main/sdks/go/alpha.go:

  • func (a *Alpha) GetCounterCount(key string) (int64, error)
  • func (a *Alpha) IncrementCounter(key string, amount int64) (error)
  • func (a *Alpha) DecrementCounter(key string, amount int64) (error)
  • func (a *Alpha) SetCounterCount(key string, amount int64) (error)
  • func (a *Alpha) GetCounterCapacity(key string) (int64, error)
  • func (a *Alpha) SetCounterCapacity(key string, amount int64) (error)
  • func (a *Alpha) GetListCapacity(key string) (int64, error)
  • func (a *Alpha) SetListCapacity(key string, amount int64) (error)
  • func (a *Alpha) ListContains(key, value string) (bool, error)
  • func (a *Alpha) GetListLength(key string) (int, error)
  • func (a *Alpha) GetListValues(key string) ([]string, error)
  • func (a *Alpha) AppendListValue(key, value string) (error)
  • func (a *Alpha) DeleteListValue(key, value string) (error)

The Rust SDK should be implemented in the https://github.com/googleforgames/agones/tree/main/sdks/rust directory, and should also contain unit tests. Navigating to agones/build and running make sdk-shell-rust may be helpful when running unit tests.

The proto for these SDK methods are in https://github.com/googleforgames/agones/blob/main/sdks/rust/proto/sdk/alpha/alpha.proto. Note that the proto methods do not exactly match the above listed SDK methods. This is due to the difference between the design in #2716 and the Google AIP https://google.aip.dev/general guidance that the proto follows as closely as possible.

Conformance tests should be implemented in the https://github.com/googleforgames/agones/tree/main/test/sdk/rust directory. Note that the conformance tests use the Local SDK Server. Rust conformance tests can be run by navigating to agones/build and running make run-sdk-conformance-test-rust. The conformance test https://github.com/googleforgames/agones/blob/main/build/includes/sdk.mk will need to be updated to take in the ALPHA_FEATURE_GATES, and the COUNTS_AND_LISTS_TESTS.

igooch avatar Feb 13 '24 21:02 igooch

@Jake-Shadle @MiniaczQ we're looking for contributors with Rust experience. Are you or someone on your teams available to take this on?

igooch avatar Apr 01 '24 23:04 igooch