Skip to content

Commit

Permalink
Fix URLs, Post Submit, add gofmt to presubmit (#381)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyje committed May 9, 2019
1 parent fba1bcf commit 3623adb
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 20 deletions.
13 changes: 8 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,7 @@ stress-frontend-%: build/toolchain/python/

fmt:
$(GO) fmt ./...
gofmt -s -w .

vet:
$(GO) vet ./...
Expand Down Expand Up @@ -653,15 +654,17 @@ ifeq ($(_GCB_POST_SUBMIT),1)
@echo "Deploying website to $(GAE_SERVICE_NAME).open-match.dev version=$(GAE_SITE_VERSION)..."
# Replace "service:"" with "service: $(GAE_SERVICE_NAME)" example, "service: 0-5"
sed -i 's/service:.*/service: $(GAE_SERVICE_NAME)/g' $(BUILD_DIR)/site/.app.yaml
(cd $(BUILD_DIR)/site && gcloud $(OM_SITE_GCP_PROJECT_FLAG) app deploy .app.yaml --promote --version=$(GAE_SITE_VERSION) --verbosity=info)
(cd $(BUILD_DIR)/site && gcloud --quiet $(OM_SITE_GCP_PROJECT_FLAG) app deploy .app.yaml --promote --version=$(GAE_SITE_VERSION) --verbosity=info)
# If the version matches the "latest" version from CI then also deploy to the default instance.
ifeq ($(MAJOR_MINOR_VERSION),$(_GCB_LATEST_VERSION))
ifeq ($(MAJOR_MINOR_VERSION),$(_GCB_LATEST_VERSION))
@echo "Deploying website to open-match.dev version=$(GAE_SITE_VERSION)..."
sed -i 's/service:.*/service: default/g' $(BUILD_DIR)/site/.app.yaml
(cd $(BUILD_DIR)/site && gcloud $(OM_SITE_GCP_PROJECT_FLAG) app deploy .app.yaml --promote --version=$(GAE_SITE_VERSION) --verbosity=info)
(cd $(BUILD_DIR)/site && gcloud --quiet $(OM_SITE_GCP_PROJECT_FLAG) app deploy .app.yaml --promote --version=$(GAE_SITE_VERSION) --verbosity=info)
# Set CORS policy on GCS bucket so that Swagger UI will work against it.
# This only needs to be set once but in the interest of enforcing a consistency we'll apply this every deployment.
# CORS policies signal to browsers that it's ok to use this resource in services not hosted from itself (open-match.dev)
gsutil cors set $(REPOSITORY_ROOT)/site/gcs-cors.json gs://open-match-chart/
endif
endif
else
@echo "Not deploying $(GAE_SERVICE_NAME).open-match.dev because this is not a post commit change."
endif
Expand All @@ -679,7 +682,7 @@ ifeq ($(_GCB_POST_SUBMIT),1)
# TODO Add Helm Artifacts later.
# Example: https://github.com/GoogleCloudPlatform/agones/blob/3b324a74e5e8f7049c2169ec589e627d4c8cab79/build/Makefile#L211
else
@echo "Not deploying development.open-match.dev because this is not a post commit change."
@echo "Not deploying build artifacts to open-match.dev because this is not a post commit change."
endif

# For presubmit we want to update the protobuf generated files and verify that tests are good.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
![Open Match](site/static/images/logo-with-name.png)

[![GoDoc](https://godoc.org/github.com/GoogleCloudPlatform/open-match?status.svg)](https://godoc.org/github.com/GoogleCloudPlatform/open-match)
[![Go Report Card](https://goreportcard.com/badge/github.com/GoogleCloudPlatform/open-match)](https://goreportcard.com/report/github.com/GoogleCloudPlatform/open-match)
[![GoDoc](https://godoc.org/open-match.dev/open-match?status.svg)](https://godoc.org/open-match.dev/open-match)
[![Go Report Card](https://goreportcard.com/badge/open-match.dev/open-match)](https://goreportcard.com/report/open-match.dev/open-match)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/GoogleCloudPlatform/open-match/blob/master/LICENSE)
[![GitHub release](https://img.shields.io/github/release-pre/GoogleCloudPlatform/open-match.svg)](https://github.com/GoogleCloudPlatform/open-match/releases)
[![Follow on Twitter](https://img.shields.io/twitter/follow/Open_Match.svg?style=social&logo=twitter)](https://twitter.com/intent/follow?screen_name=Open_Match)
Expand Down
2 changes: 1 addition & 1 deletion doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
// limitations under the License.

// Package openmatch provides flexible, extensible, and scalable video game matchmaking.
package openmatch
package openmatch // import "open-match.dev/open-match"
6 changes: 3 additions & 3 deletions internal/future/statestore/public.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"github.com/gomodule/redigo/redis"
"github.com/sirupsen/logrus"
"open-match.dev/open-match/internal/config"
"open-match.dev/open-match/internal/future/pb"
"open-match.dev/open-match/internal/future/pb"
)

var (
Expand All @@ -32,7 +32,7 @@ var (

// Service is a generic interface for talking to a storage backend.
type Service interface {
// CreateTicket creates a new Ticket in the state storage. This method fails if the Ticket already exists.
// CreateTicket creates a new Ticket in the state storage. This method fails if the Ticket already exists.
CreateTicket(ctx context.Context, ticket pb.Ticket, ttl int) error

// GetTicket gets the Ticket with the specified id from state storage. This method fails if the Ticket does not exist.
Expand All @@ -47,7 +47,7 @@ type Service interface {
// DeindexTicket removes the indexing for the specified Ticket. Only the indexes are removed but the Ticket continues to exist.
DeindexTicket(ctx context.Context, id string, indices []string) error

// FilterTickets returns the Ticket ids for the Tickets meeting the specified filtering criteria.
// FilterTickets returns the Ticket ids for the Tickets meeting the specified filtering criteria.
FilterTickets(ctx context.Context, filters []pb.Filter) ([]string, error)

// Closes the connection to the underlying storage.
Expand Down
2 changes: 1 addition & 1 deletion internal/serving/bindata/backend/bindata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/serving/bindata/frontend/bindata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/serving/bindata/matchfunction/bindata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/serving/bindata/mmlogic/bindata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/serving/testing/minimatch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import (
func TestNewMiniMatch(t *goTesting.T) {
ff := &FakeFrontend{}
mm, closer, err := NewMiniMatch([]*serving.ServerParams{
&serving.ServerParams{
{
BaseLogFields: logrus.Fields{
"app": "openmatch",
"component": "frontend",
Expand Down
4 changes: 2 additions & 2 deletions site/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ func (h *handler) Host(r *http.Request) string {
// This is ok because we are not serving executable code (javascript) from these locations, only configuration.
func (h *handler) withCors(w http.ResponseWriter) {
w.Header().Set("Access-Control-Allow-Origin", "*")
w.Header().Set("Access-Control-Allow-Methods", "POST, GET, OPTIONS, PUT, DELETE")
w.Header().Set("Access-Control-Allow-Headers", "Accept, Content-Type, Content-Length, Accept-Encoding, X-CSRF-Token, Authorization")
w.Header().Set("Access-Control-Allow-Methods", "POST, GET, OPTIONS, PUT, DELETE")
w.Header().Set("Access-Control-Allow-Headers", "Accept, Content-Type, Content-Length, Accept-Encoding, X-CSRF-Token, Authorization")
}

var vanityTmpl = template.Must(template.New("vanity").Parse(`<!DOCTYPE html>
Expand Down
4 changes: 2 additions & 2 deletions site/redirect/redirection.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ func (h *handler) serveIndex(w http.ResponseWriter, r *http.Request) {
// This is ok because we are not serving executable code (javascript) from these locations, only configuration.
func (h *handler) withCors(w http.ResponseWriter) {
w.Header().Set("Access-Control-Allow-Origin", "*")
w.Header().Set("Access-Control-Allow-Methods", "POST, GET, OPTIONS, PUT, DELETE")
w.Header().Set("Access-Control-Allow-Headers", "Accept, Content-Type, Content-Length, Accept-Encoding, X-CSRF-Token, Authorization")
w.Header().Set("Access-Control-Allow-Methods", "POST, GET, OPTIONS, PUT, DELETE")
w.Header().Set("Access-Control-Allow-Headers", "Accept, Content-Type, Content-Length, Accept-Encoding, X-CSRF-Token, Authorization")
}

func (h *handler) Host(r *http.Request) string {
Expand Down

0 comments on commit 3623adb

Please sign in to comment.