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

Simplify the selection of the dynamic port in the nodejs sdk. #1128

Merged
merged 1 commit into from
Oct 21, 2019

Conversation

roberthbailey
Copy link
Member

This brings the NodeJS SDK in line with the C++ / Unity / Rust SDKs.

Part of #851.

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 5fabe9d0-a195-4fb9-9488-109ee0200120

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/GoogleCloudPlatform/agones.git pull/1128/head:pr_1128 && git checkout pr_1128
  • helm install install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.1.0-da74bb1

@google-oss-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: pooneh-m, roberthbailey

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:
  • OWNERS [pooneh-m,roberthbailey]

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

@pooneh-m pooneh-m merged commit 15ce0a1 into googleforgames:master Oct 21, 2019
@@ -25,22 +25,8 @@ class AgonesSDK {
}

get port() {
const defaultPort = '59357';
const port = process.env.AGONES_SDK_GRPC_PORT;
Copy link
Collaborator

Choose a reason for hiding this comment

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

In JavaScript it's common to use || e.g. do return process.env.AGONES_SDK_GRPC_PORT || '59357'
Without examining grpc code too much it seems port should be a number so you could cast using return Number(process.env.AGONES_SDK_GRPC_PORT) || 59357

Copy link
Collaborator

Choose a reason for hiding this comment

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

doh too slow :)

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm happy to fix it in a follow-up PR. :)

Copy link
Member Author

Choose a reason for hiding this comment

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

#1129

it seems port should be a number

The value is returned and concatenated with 'localhost' so I think returning a string is ok.

@roberthbailey roberthbailey mentioned this pull request Oct 21, 2019
@markmandel markmandel added this to the 1.1.0 milestone Oct 22, 2019
@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 Oct 22, 2019
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 kind/feature New features for Agones lgtm size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants