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

fix: add time import for compute operations #1292

Merged
merged 2 commits into from
Apr 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 0 additions & 58 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,64 +83,6 @@ jobs:
run: |
cd showcase
apidiff -incompatible pkg.latest github.com/googleapis/gapic-showcase/client > diff.txt && cat diff.txt && ! [ -s diff.txt ]
compute-regen:
runs-on: ubuntu-latest
if: "!contains(github.event.pull_request.labels.*.name, 'disable job: compute-regen')"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
- name: Install protoc
run: |
sudo mkdir -p /usr/src/protoc/
sudo chown -R ${USER} /usr/src/
curl --location https://github.com/google/protobuf/releases/download/v3.17.3/protoc-3.17.3-linux-x86_64.zip --output /usr/src/protoc/protoc-3.17.3.zip
cd /usr/src/protoc/
unzip protoc-3.17.3.zip
sudo ln -s /usr/src/protoc/bin/protoc /usr/local/bin/protoc
export PATH=$PATH:protobuf/bin
- name: Install tools
run: |
go install golang.org/x/exp/cmd/apidiff@latest
go install github.com/golang/protobuf/protoc-gen-go@latest
go install golang.org/x/tools/cmd/goimports@latest
go install ./cmd/protoc-gen-go_gapic
- name: Download protos
run: |
curl -sSL https://github.com/googleapis/googleapis/archive/master.zip > googleapis.zip
unzip googleapis.zip -x "googleapis-master/google/ads/*"
mv googleapis-master /tmp/googleapis
export GOOGLEAPIS=/tmp/googleapis
- name: Clone google-cloud-go
uses: actions/checkout@v3
with:
repository: googleapis/google-cloud-go
- uses: actions/setup-go@v4
with:
go-version-file: 'compute/go.mod'
- name: Create Go package API baseline
if: "!contains(github.event.pull_request.labels.*.name, 'breaking change allowed')"
run: |
cd compute
apidiff -w pkg.latest cloud.google.com/go/compute/apiv1
- name: Regenerate compute
run: |
export CLOUD_GO=$(pwd)
cd internal/gapicgen
go run cloud.google.com/go/internal/gapicgen/cmd/genbot \
-local \
-regen-only \
-only-gapics \
-gapic=cloud.google.com/go/compute/apiv1 \
-gocloud-dir=$CLOUD_GO \
-googleapis-dir=$GOOGLEAPIS
cd $CLOUD_GO/compute && go get -u ./apiv1 && go mod tidy
- name: Compare regenerated code to baseline
if: "!contains(github.event.pull_request.labels.*.name, 'breaking change allowed')"
run: |
cd compute
apidiff -incompatible pkg.latest cloud.google.com/go/compute/apiv1 > diff.txt && cat diff.txt && ! [ -s diff.txt ]
bazel-build:
runs-on: ubuntu-latest
env:
Expand Down
1 change: 1 addition & 0 deletions internal/gengapic/custom_operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ func (g *generator) customOperationType() error {
p("")
g.imports[pbinfo.ImportSpec{Path: "context"}] = true
g.imports[pbinfo.ImportSpec{Name: "gax", Path: "github.com/googleapis/gax-go/v2"}] = true
g.imports[pbinfo.ImportSpec{Path: "time"}] = true

for _, handle := range op.handles {
pollingParams := op.pollingParams[handle]
Expand Down