From f80477548568380fc75ad1533b8767b70a1902ec Mon Sep 17 00:00:00 2001 From: Kayla Nguyen Date: Wed, 21 Jul 2021 18:41:11 -0700 Subject: [PATCH 1/3] Update qa github action to be equivalent to master branch. --- .github/workflows/ci.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 66f1a532..55d34f7c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,6 +17,15 @@ jobs: uses: actions/setup-go@v2 with: go-version: ${{ matrix.go-version }} + - name: Cache go modules + uses: actions/cache@v2 + with: + path: | + ~/.cache/go-build + ~/go/pkg/mod + key: ${{ runner.os }}-${{ matrix.go-version }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-${{ matrix.go-version }}-go- - name: Checkout uses: actions/checkout@v2 - name: Install @@ -25,7 +34,6 @@ jobs: run: | go get . - name: Test gomod - shell: bash run: | go test -v -race google.golang.org/appengine/... test-gopath: @@ -47,6 +55,5 @@ jobs: run: | go get -u -v $(go list -f '{{join .Imports "\n"}}{{"\n"}}{{join .TestImports "\n"}}' ./... | sort | uniq | grep -v appengine) - name: Test gopath - shell: bash run: | go test -v -race google.golang.org/appengine/... From 7cc6486ed918cb90c76f9c3a0d4985e45339e31d Mon Sep 17 00:00:00 2001 From: Kayla Nguyen Date: Wed, 29 Dec 2021 14:24:51 -0800 Subject: [PATCH 2/3] pin setup-gcloud gh action to v0 --- .github/workflows/ci-v2.yaml | 4 ++-- .github/workflows/ci.yml | 6 +++--- README.md | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-v2.yaml b/.github/workflows/ci-v2.yaml index f76cd08f..47295f10 100644 --- a/.github/workflows/ci-v2.yaml +++ b/.github/workflows/ci-v2.yaml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - go-version: [ '1.11.x', '1.12.x', '1.13.x', '1.14.x', '1.15.x'] + go-version: [ '1.11.x', '1.12.x', '1.13.x', '1.14.x', '1.15.x', '1.16.x'] env: working-directory: ./v2 @@ -76,7 +76,7 @@ jobs: restore-keys: | ${{ runner.os }}-${{ matrix.go-version }}-go- - name: Set up Cloud SDK - uses: google-github-actions/setup-gcloud@master + uses: google-github-actions/setup-gcloud@v0 - name: Install working-directory: ${{env.working-directory}} env: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dfbf16a7..ff05a206 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - go-version: [ '1.11.x', '1.12.x', '1.13.x', '1.14.x', '1.15.x'] + go-version: [ '1.11.x', '1.12.x', '1.13.x', '1.14.x', '1.15.x', '1.16.x'] steps: - name: Set up Go @@ -70,7 +70,7 @@ jobs: restore-keys: | ${{ runner.os }}-${{ matrix.go-version }}-go- - name: Set up Cloud SDK - uses: google-github-actions/setup-gcloud@master + uses: google-github-actions/setup-gcloud@v0 - name: Install env: GO111MODULE: off @@ -83,4 +83,4 @@ jobs: export APPENGINE_DEV_APPSERVER=$(which dev_appserver.py) go test -v -cover -race google.golang.org/appengine/... # TestAPICallAllocations doesn't run under race detector. - go test -v -cover google.golang.org/appengine/internal/... -run TestAPICallAllocations \ No newline at end of file + go test -v -cover google.golang.org/appengine/internal/... -run TestAPICallAllocations diff --git a/README.md b/README.md index c0cf5cc9..4e3f50f4 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ A few APIs were cleaned up, and there are some differences: * `appengine/socket` is not required on App Engine flexible environment / Managed VMs. Use the standard `net` package instead. -## Key Encode/Decode compatibiltiy to help with datastore library migrations +## Key Encode/Decode compatibility to help with datastore library migrations Key compatibility updates have been added to help customers transition from google.golang.org/appengine/datastore to cloud.google.com/go/datastore. The `EnableKeyConversion` enables automatic conversion from a key encoded with cloud.google.com/go/datastore to google.golang.org/appengine/datastore key type. From 3125734282325e68479480c511a97ad0bb8fa7dc Mon Sep 17 00:00:00 2001 From: Kayla Nguyen Date: Thu, 30 Dec 2021 14:22:30 -0800 Subject: [PATCH 3/3] Change log to stderr and trace to X-Cloud-Trace-Context --- v2/internal/api.go | 2 +- v2/internal/log.go | 2 +- v2/internal/log_test.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/v2/internal/api.go b/v2/internal/api.go index a1c507ab..96df8204 100644 --- a/v2/internal/api.go +++ b/v2/internal/api.go @@ -67,7 +67,7 @@ var ( backgroundContextOnce sync.Once backgroundContext netcontext.Context - logStream io.Writer = os.Stdout // For test hooks. + logStream io.Writer = os.Stderr // For test hooks. timeNow func() time.Time = time.Now // For test hooks. ) diff --git a/v2/internal/log.go b/v2/internal/log.go index e4f14ba6..210df597 100644 --- a/v2/internal/log.go +++ b/v2/internal/log.go @@ -108,7 +108,7 @@ func chunkLog(msg string) []string { } func traceAndSpan(c *context) (string, string) { - headers := c.req.Header["Cloud-Trace-Context"] + headers := c.req.Header["X-Cloud-Trace-Context"] if len(headers) < 1 { return "", "" } diff --git a/v2/internal/log_test.go b/v2/internal/log_test.go index aeecb43e..b724153d 100644 --- a/v2/internal/log_test.go +++ b/v2/internal/log_test.go @@ -437,7 +437,7 @@ func buildContextWithTraceHeaders(t *testing.T, headers []string) *context { t.Fatal(err) } for _, h := range headers { - req.Header.Add("Cloud-Trace-Context", h) + req.Header.Add("X-Cloud-Trace-Context", h) } return fromContext(ContextForTesting(req)) }