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

Support Unity Package Manager #2343

Conversation

aaronchapin-tocaboca
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

What this PR does / Why we need it:
Unity has its own package manager, which can be used to load external dependencies. This change allows unity developers to add the Agones SDK to their project by simply adding a line to their manifest.json file that follows this format:
"com.googleforgames.agones": "https://github.com/googleforgames/agones.git?path=/sdks/unity#<TAG>",
Instead of manually downloading the SDK code locally and placing it in their project's folder structure.

Which issue(s) this PR fixes:
Closes #2338

Special notes for your reviewer:
I took some educated guesses about the desired values for fields like the version number, author name/url etc. Any of these can be changed without an issue - just let me know what is preferred.

Added:

  • Agones Unity SDK assembly definition file
  • Package information json
  • Meta files required by the Unity engine

- Agones assembly definition
- Package information
- Meta files required for the engine
@google-oss-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: aaronchapin-tocaboca
To complete the pull request process, please assign pooneh-m after the PR has been reviewed.
You can assign the PR to them by writing /assign @pooneh-m in a comment when ready.

The full list of commands accepted by this bot can be found 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

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: f31fb896-b1a0-409e-8c61-0d04609a9f4b

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/2343/head:pr_2343 && git checkout pr_2343
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.19.0-7873509

@@ -0,0 +1,11 @@
{
"name": "com.googleforgames.agones",
"version": "1.18.1",
Copy link
Member

Choose a reason for hiding this comment

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

Is this the version of Unity it works with, or is this the version of Agones it corresponds to?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This would be the version of Agones that the package corresponds to.

A complete list of all the properties and their descriptions can be found here: https://docs.unity3d.com/Manual/upm-manifestPkg.html

Copy link
Member

Choose a reason for hiding this comment

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

That page says that the version must be MAJOR.MINOR.PATCH but also says it can follow semantic versioning, which would allow us to have this version match what we use elsewhere, e.g. 1.19.0-dev (then 1.19.0-rc, then 1.19.0, then 1.20.0-dev, and so on).

Do you know if unity will work correctly with our semantic versioning scheme.

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 answered this question in another thread, but just to have the info here as well: I tested this semantic versioning scheme and it is supported.

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 2daae425-5842-4b5b-85b9-9cb16d5f40a8

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/2343/head:pr_2343 && git checkout pr_2343
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.19.0-64f7b52

Copy link
Member

@roberthbailey roberthbailey left a comment

Choose a reason for hiding this comment

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

There are a lot of guid values in these files. Where do they come from? And when do they need to be updated?

If we change the version during the release process, does that require updating any other fields?

@@ -0,0 +1,11 @@
{
"name": "com.googleforgames.agones",
"version": "1.18.1",
Copy link
Member

Choose a reason for hiding this comment

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

That page says that the version must be MAJOR.MINOR.PATCH but also says it can follow semantic versioning, which would allow us to have this version match what we use elsewhere, e.g. 1.19.0-dev (then 1.19.0-rc, then 1.19.0, then 1.20.0-dev, and so on).

Do you know if unity will work correctly with our semantic versioning scheme.

"description": "The Unity Gameserver SDK for Agones",
"unity": "2019.1",
"author": {
"name": "Google For Games",
Copy link
Member

Choose a reason for hiding this comment

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

The NodeJS and csharp SDKs has the author set to "Google LLC"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Regarding semantic versioning - yes it does work. I tried out a -dev append on a separate branch (here) and it functioned as expected. So that shouldn't be a problem.
Screen Shot 2021-10-29 at 11 36 37 AM

I wasn't sure what to set the version number to, but I assumed that if this PR is accepted it'll go out with the next release. Do you have a way of updating the version number across the repo that I could utilize here?

Regarding author name, that has been updated.

Copy link
Member

Choose a reason for hiding this comment

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

Please add a new step to the section "Update SDK Package Versions" in https://github.com/googleforgames/agones/blob/main/docs/governance/templates/release_issue.md to bump the version number (we currently have steps for the nodejs and csharp SDKs). You should also add a step near the very end to bump the version after a full release (look for "If full release, change to the sdks/nodejs directory").

Since this will pull from github, it sounds like we don't need to update the "Publish SDK packages" section.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated 👍

@aaronchapin-tocaboca
Copy link
Contributor Author

There are a lot of guid values in these files. Where do they come from? And when do they need to be updated?

They are created by the Unity engine on file creation. They don't need to be updated aside from removing the .meta file if the file is removed. In fact, if they are updated it could cause issues.
More information about unity meta files can be found here:
https://docs.unity3d.com/Manual/AssetMetadata.html
https://unityatscale.com/unity-meta-file-guide/faq/

If we change the version during the release process, does that require updating any other fields?

Not as far as I'm aware.

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 310decd9-3a26-45d2-8c17-e026227400be

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/2343/head:pr_2343 && git checkout pr_2343
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.19.0-5ac61b9

@aaronchapin-tocaboca aaronchapin-tocaboca changed the title Add files to support Unity Package Manager Support Unity Package Manager Oct 29, 2021
@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 8bbc7671-f1da-446e-9538-6572e2f1131f

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

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 180406dc-a5ef-4a7b-aa3b-9989b6f47858

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

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 7158a89a-04f8-4b50-80b2-1a548aa073c3

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/2343/head:pr_2343 && git checkout pr_2343
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.19.0-34c3440

@@ -80,6 +80,7 @@ and copy it into a release issue. Fill in relevant values, found inside {}
- [ ] If full release move the [helm `Chart` version values][chart] is to {version}+1-dev
- [ ] If full release, change to the `sdks/nodejs` directory and run the command `npm version {version}+1-dev` to update the package version
- [ ] If full release move the [`sdks/csharp/sdk/AgonesSDK.nuspec` and `sdks/csharp/sdk/csharp-sdk.csproj`][csharp] to {version}+1-dev
- [ ] If full release update the [`sdks/unity/package.json`][unity] package file's `Version` field to {version}+1-dev
Copy link
Member

Choose a reason for hiding this comment

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

We should also add a checklist item in the Update SDK Package Versions section as well to increment the Unity version 👍🏻

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done 👍

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 93900d10-2f49-4af3-8b3a-54628bddd2f3

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

@markmandel
Copy link
Member

Looks like a flake of TestAutoscalerStressCreate

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.

This LGTM!

The only thing I just realised was outstanding on my end -

We should update https://agones.dev/site/docs/guides/client-sdks/unity/#download to have the new instructions on the best way to install.

We'll need to use the feature shortcode to hide and show the current vs new content:
https://agones.dev/site/docs/contribute/#within-a-page

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 387e7f2e-a8ce-47df-9e46-c44f6e6bc632

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/2343/head:pr_2343 && git checkout pr_2343
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.19.0-3daebb4

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: bbd8a3fd-65b7-4c91-a731-4e09981d400a

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/2343/head:pr_2343 && git checkout pr_2343
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.19.0-a5d7c90

@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 Nov 15, 2021
@markmandel markmandel added this to the 1.19.0 milestone Nov 15, 2021
@google-oss-prow
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aaronchapin-tocaboca, markmandel

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

@markmandel
Copy link
Member

markmandel commented Nov 15, 2021

Nice work!

@google-oss-prow
Copy link

New changes are detected. LGTM label has been removed.

@google-oss-prow google-oss-prow bot removed the lgtm label Nov 15, 2021
@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 0c36225e-53d1-4b9b-8bc7-ee2034fdc9f7

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/2343/head:pr_2343 && git checkout pr_2343
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.19.0-3c99121

@markmandel markmandel merged commit 2be5e3b into googleforgames:main Nov 16, 2021
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/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unity package for Unity SDK
5 participants