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

Feature/gometalinter #176

Merged
merged 1 commit into from
Apr 15, 2018

Conversation

EricFortin
Copy link
Collaborator

Fixes #163

@EricFortin EricFortin requested a review from markmandel April 14, 2018 14:11
@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: c2825c28-7857-4e75-8bd3-56d693c958ae

The following development artifacts have been built, and will exist for the next 30 days:

@markmandel markmandel requested a review from enocom April 14, 2018 16:19
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.

👍 some comment/thoughts on changes - but so happy to see this in place!!!!

I can see it already picked up on stuff I particularly missed, just using gometalinter manually.

build/Makefile Outdated
@@ -127,10 +127,15 @@ install: ensure-build-image
agones $(mount_path)/install/helm/agones/

# Build a static binary for the gameserver controller
build-controller-binary: ensure-build-image
build-controller-binary: ensure-build-image lint
Copy link
Member

Choose a reason for hiding this comment

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

I feel like lint should run on make test (here)

wdyt?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Makes sense, removed in build targets and put it in test one.

build/Makefile Outdated
docker run --rm -e "CGO_ENABLED=0" $(common_mounts) $(build_tag) go build \
-o $(mount_path)/cmd/controller/bin/controller -a $(go_version_flags) -installsuffix cgo $(agones_package)/cmd/controller

# Lint the go source code.
lint: ensure-build-image
docker run --rm $(common_mounts) -w $(mount_path) $(build_tag) bash -c \
Copy link
Member

Choose a reason for hiding this comment

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

Minor nit - add $(DOCKER_RUN_ARGS) to this line.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

# See the License for the specific language governing permissions and
# limitations under the License.

excluded=$(find . -name "*.go" | grep -v vendor | xargs grep autogenerated | cut -d ':' -f 1 | uniq | sed 's#\./##g')
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 go in build/build-image with the rest of the gen scripts.

Which will mean it will be automatically copied into the build Docker image so it will be easier to call.

May also want to also bump the ForceUpdate value to force the rebuild.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done and nice trick for the rebuild

@@ -0,0 +1,18 @@
#!/usr/bin/env bash

# Copyright 2017 Google Inc. All Rights Reserved.
Copy link
Member

Choose a reason for hiding this comment

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

Minor nit - 2018

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

@@ -56,7 +56,7 @@ var (
)

// main starts the operator for the gameserver CRD
func main() {
func main() { // nolint: gocyclo
Copy link
Member

Choose a reason for hiding this comment

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

Not for this PR - but we should make a ticket for this, because we should fix this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Created #177

@@ -29,7 +29,7 @@ import (

// main starts a UDP server that received 1024 byte sized packets at at time
// converts the bytes to a string, and logs the output
func main() {
func main() { // nolint: gocyclo
Copy link
Member

Choose a reason for hiding this comment

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

Same here, we should make a ticket to fix this one too.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Created #178

@@ -56,6 +57,7 @@ func NewMocks() Mocks {
return m
}

// StartInformers starts new fake informers
Copy link
Member

Choose a reason for hiding this comment

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

👍 it's so good to have all of this picked up

@@ -39,14 +39,14 @@ func TestSDK(t *testing.T) {
assert.False(t, sm.shutdown)
assert.False(t, sm.hm.healthy)

s.Ready()
_ = s.Ready()
Copy link
Member

Choose a reason for hiding this comment

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

I feel like these should actually be

err := s.Ready() # change
assert.Nil(t, err) # add this line
assert.True(t, sm.ready)
assert.False(t, sm.shutdown)

For all the below. Better to fix the test, since we're here (no idea why I didn't do this in the first place)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sorry for this. Totally missed it too.

@EricFortin EricFortin force-pushed the feature/gometalinter branch from 2c69845 to a61fdc5 Compare April 14, 2018 17:46
@EricFortin
Copy link
Collaborator Author

Rebased and squashed

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 067638c6-89dd-4568-a9ef-7e3f21d21cc3

The following development artifacts have been built, and will exist for the next 30 days:

@markmandel
Copy link
Member

This LGTM. @enocom do you have anything extra before we approve and merge this?

@enocom
Copy link
Contributor

enocom commented Apr 15, 2018

LGTM

@markmandel markmandel merged commit 14f8329 into googleforgames:master Apr 15, 2018
@markmandel markmandel added this to the 0.2 milestone Apr 15, 2018
@markmandel markmandel added area/build-tools Development tooling. I.e. pretty much everything in the `build` directory. kind/feature New features for Agones labels Apr 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/build-tools Development tooling. I.e. pretty much everything in the `build` directory. kind/feature New features for Agones
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants