From 6f72b3c82efb9593a548f8e8930be11d2d20931e Mon Sep 17 00:00:00 2001 From: Cody Oss <6331106+codyoss@users.noreply.github.com> Date: Fri, 13 Jan 2023 21:14:27 +0000 Subject: [PATCH] chore(internal): fixups for postprocessor (#7239) - Fixed cloudbuild job. More work is still needed to get this automated. Filed #7240 for tracking that request. For now I manually kicked off a build and published the image. - Updated workspace for owlbot. - Add some more files to preserve. --- .github/.OwlBot.lock.yaml | 2 +- .github/.OwlBot.yaml | 2 ++ internal/README.md | 10 +++++++++- internal/{postprocessor => }/cloudbuild.yaml | 5 ++--- internal/postprocessor/main.go | 2 +- 5 files changed, 15 insertions(+), 6 deletions(-) rename internal/{postprocessor => }/cloudbuild.yaml (89%) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 5ce4de60646d..190659bdf6af 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -1,3 +1,3 @@ docker: - digest: sha256:a36c83b620de88ba0c6248617e928f53ebd781d9f3fe219543bc1c6b00a37899 + digest: sha256:289c9fb3f2f6deae65d25cf97e1cc94c3fb09df93e82c6780f3ef53c13cf76b4 image: gcr.io/cloud-devrel-public-resources/owlbot-go:latest diff --git a/.github/.OwlBot.yaml b/.github/.OwlBot.yaml index 76e5e036a179..1e30c93fcfb5 100644 --- a/.github/.OwlBot.yaml +++ b/.github/.OwlBot.yaml @@ -11,6 +11,8 @@ deep-remove-regex: deep-preserve-regex: - /.*/version.go + - /secretmanager/apiv1/iam.go + - /secretmanager/apiv1/iam_example_test.go deep-copy-regex: - source: /google/cloud/dialogflow/cx/v3beta1/cloud.google.com/go/dialogflow/cx/apiv3beta1 diff --git a/internal/README.md b/internal/README.md index 8857c8f6fea1..f3f4ccf37537 100644 --- a/internal/README.md +++ b/internal/README.md @@ -15,4 +15,12 @@ One day, we may want to create individual `.repo-metadata.json` files next to each package, which is the pattern followed by some other languages. External tools would then talk to pkg.go.dev or some other service to get the overall list of packages and use the `.repo-metadata.json` files to get the additional -metadata required. For now, `.repo-metadata-full.json` includes everything. \ No newline at end of file +metadata required. For now, `.repo-metadata-full.json` includes everything. + +## cloudbuild.yaml + +To kick off a build locally run from the repo root: + +```bash +gcloud builds submit --project=cloud-devrel-kokoro-resources --config=internal/cloudbuild.yaml +``` diff --git a/internal/postprocessor/cloudbuild.yaml b/internal/cloudbuild.yaml similarity index 89% rename from internal/postprocessor/cloudbuild.yaml rename to internal/cloudbuild.yaml index 2e64ad61d8b1..71281cec24a2 100644 --- a/internal/postprocessor/cloudbuild.yaml +++ b/internal/cloudbuild.yaml @@ -18,9 +18,8 @@ timeout: 7200s # 2 hours steps: - name: gcr.io/cloud-builders/docker - args: ['build', '-t', 'gcr.io/cloud-devrel-public-resources/owlbot-go', '.'] - dir: internal/postprocessor + args: ['build', '-t', 'gcr.io/cloud-devrel-public-resources/owlbot-go', '-f', 'postprocessor/Dockerfile', '.'] + dir: internal images: -- gcr.io/cloud-devrel-public-resources/owlbot-go:$SHORT_SHA - gcr.io/cloud-devrel-public-resources/owlbot-go:latest diff --git a/internal/postprocessor/main.go b/internal/postprocessor/main.go index 98cf825465d0..49b063f7f35c 100644 --- a/internal/postprocessor/main.go +++ b/internal/postprocessor/main.go @@ -49,7 +49,7 @@ var firstPartTitlePattern = regexp.MustCompile(`(?P)(\: *\` + ap var secondPartTitlePattern = regexp.MustCompile(`.*\: *\` + apiNameOwlBotScope + ` *(?P.*)`) func main() { - clientRoot := flag.String("client-root", "/repo", "Path to clients.") + clientRoot := flag.String("client-root", "/workspace/google-cloud-go", "Path to clients.") googleapisDir := flag.String("googleapis-dir", "", "Path to googleapis/googleapis repo.") directories := flag.String("dirs", "", "Comma-separated list of module names to run (not paths).") branchPrefix := flag.String("branch", "owl-bot-copy-", "The prefix of the branch that OwlBot opens when working on a PR.")