Skip to content

Commit 2fc3abe

Browse files
partheavchudnov-g
andauthored
feat: add google/cloud/compute/v1beta (#1033)
* build: implement matrix strategy for DIREGAPIC action * build: add alpha compute files * build: Include API channel in auto-generated PR * build: fix matrix specification * build: Have DIREGAPIC action use triggering ref or default branch * build: remove the field ScratchDisks The field was also removed purposefully in v1 * build: Add v1 proto for use as "previous proto" in conversion * build: allow all matrix jobs to complete even if some fail * build: fix location of fail-fast setting The original reference I used had it in the wrong place. Correct GitHub ref: https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#jobsjob_idstrategyfail-fast * build: Disable PHP and C# builds for alpha PHP just failed. Not clear what the issue is. C# has some known failures. One of them may be the use of 3 repeated fields. * build: Disable Ruby generation This was causing some errors, too. * build: fix version in Discovery file before further processing * build: jq is supposedly pre-installed in GitHub actions * feat: Move alpha to v1alpha in all paths * build: We do need to install jq * build: Try installing without sudo sudo is not found! * build: Fix regex "version" is the last field, so it has no trailing comma * build: Fix Go imports in BUILD * build: prepare for processing beta: copy files from alpha * build: update the beta file contents to refer to beta symbols * build: configure action to run for beta as well. * build: Have each channel use its own branch for the PR * Update syntax for matrix.version in branch name * add initial versions of alpha/beta discovery docs * Revert "add initial versions of alpha/beta discovery docs" This reverts commit 489a29c. * stage discovery docs * remove alpha * add compute.v1beta.json which is needed for kokoro presubmit * build: add python settings * import changes from PR 1035 * clean up * clean up * Remove redundant bazelisk build --------- Co-authored-by: Victor Chudnovsky <vchudnov@google.com>
1 parent 4ad4d7a commit 2fc3abe

8 files changed

Lines changed: 170345 additions & 15 deletions

File tree

.github/workflows/diregapic.yaml

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,34 +10,44 @@ jobs:
1010
if: github.repository == 'googleapis/googleapis'
1111
runs-on: ubuntu-latest
1212
container: gcr.io/gapic-images/googleapis:prod
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
version: ["beta", "v1"]
1317
steps:
1418
- name: Checkout master
1519
uses: actions/checkout@v3
1620
with:
1721
ref: master
22+
- name: Install jq
23+
run: |
24+
apt-get update
25+
apt-get install -y jq
1826
- name: Download discovery docs
1927
run: |
20-
curl https://raw.githubusercontent.com/googleapis/discovery-artifact-manager/refs/heads/master/discoveries/compute.v1.json --output google/cloud/compute/v1/compute.v1.json
21-
echo compute_revision=$(grep -oP '"revision":\s*"\d+"' google/cloud/compute/v1/compute.v1.json | grep -oP '\d+') >> $GITHUB_ENV
28+
curl https://raw.githubusercontent.com/googleapis/discovery-artifact-manager/refs/heads/master/discoveries/compute.${{ matrix.version }}.json --output /tmp/compute.${{ matrix.version }}.json
29+
sed -i 's|^ "version": "beta"| "version": "v1beta"|' /tmp/compute.${{ matrix.version }}.json
30+
echo compute_revision=$(grep -oP '"revision":\s*"\d+"' /tmp/compute.${{ matrix.version }}.json | grep -oP '\d+') >> $GITHUB_ENV
31+
echo compute_version="$(jq -r '.version' /tmp/compute.${{ matrix.version }}.json)" >> $GITHUB_ENV
2232
- name: Regenerate API definitions
2333
run: |
34+
cp /tmp/compute.${{ matrix.version }}.json google/cloud/compute/${{ env.compute_version }}/compute.${{ env.compute_version }}.json
2435
git config --global --add safe.directory /__w/googleapis/googleapis
25-
bazelisk build --experimental_convenience_symlinks=normal //google/cloud/compute/v1:compute_gen
26-
cp bazel-bin/google/cloud/compute/v1/compute_gen.proto google/cloud/compute/v1/compute.proto
27-
cp bazel-bin/google/cloud/compute/v1/compute_gen.config.out.json google/cloud/compute/v1/compute.config.json
28-
bazelisk build --experimental_convenience_symlinks=normal //google/cloud/compute/v1:compute_grpc_service_config_gen
29-
cp bazel-bin/google/cloud/compute/v1/compute_grpc_service_config_gen.json google/cloud/compute/v1/compute_grpc_service_config.json
30-
bazelisk build --experimental_convenience_symlinks=normal //google/cloud/compute/v1:compute_gapic_gen
31-
cp bazel-bin/google/cloud/compute/v1/compute_gapic_gen.yaml google/cloud/compute/v1/compute_gapic.yaml
36+
bazelisk build --experimental_convenience_symlinks=normal //google/cloud/compute/${{ env.compute_version }}:compute_gen
37+
cp bazel-bin/google/cloud/compute/${{ env.compute_version }}/compute_gen.proto google/cloud/compute/${{ env.compute_version }}/compute.proto
38+
cp bazel-bin/google/cloud/compute/${{ env.compute_version }}/compute_gen.config.out.json google/cloud/compute/${{ env.compute_version }}/compute.config.json
39+
bazelisk build --experimental_convenience_symlinks=normal //google/cloud/compute/${{ env.compute_version }}:compute_grpc_service_config_gen
40+
cp bazel-bin/google/cloud/compute/${{ env.compute_version }}/compute_grpc_service_config_gen.json google/cloud/compute/${{ env.compute_version }}/compute_grpc_service_config.json
41+
bazelisk build --experimental_convenience_symlinks=normal //google/cloud/compute/${{ env.compute_version }}:compute_gapic_gen
42+
cp bazel-bin/google/cloud/compute/${{ env.compute_version }}/compute_gapic_gen.yaml google/cloud/compute/${{ env.compute_version }}/compute_gapic.yaml
3243
# Skip any config-only changes when determining whether the API changed:
3344
# - The execution timestamp recorded in the config will always differ from the previous one
3445
# - Some schema hashes appear to change for no reason (internal issue 406083082)
3546
echo api_changes=$( { git diff --stat | grep -v file | grep -v compute.config.json ; } && git diff-index --shortstat HEAD) >> $GITHUB_ENV
3647
- name: Build GAPIC clients
3748
if: contains(env.api_changes, 'file')
3849
run: |
39-
bazelisk build --experimental_convenience_symlinks=normal //google/cloud/compute/v1/...
40-
bazelisk build --experimental_convenience_symlinks=normal //google/cloud/compute/v1/...
50+
bazelisk build --experimental_convenience_symlinks=normal //google/cloud/compute/${{ env.compute_version }}/...
4151
- name: Create PR
4252
uses: googleapis/code-suggester@v2
4353
if: contains(env.api_changes, 'file')
@@ -47,11 +57,11 @@ jobs:
4757
command: pr
4858
upstream_owner: googleapis
4959
upstream_repo: googleapis
50-
title: 'feat: [DIREGAPIC] Update API definitions'
51-
description: 'feat: Update Compute Engine API to revision ${{ env.compute_revision }}'
52-
message: 'feat: Update Compute Engine API to revision ${{ env.compute_revision }}'
60+
title: 'feat: [DIREGAPIC] Update ${{ env.compute_version }} API definitions'
61+
description: 'feat: Update Compute Engine ${{ env.compute_version }} API to revision ${{ env.compute_revision }}'
62+
message: 'feat: Update Compute Engine ${{ env.compute_version }} API to revision ${{ env.compute_revision }}'
5363
primary: 'master'
54-
branch: diregapic
64+
branch: "diregapic-${{ matrix.version }}"
5565
git_dir: '.'
5666
force: true
5767
fork: true

0 commit comments

Comments
 (0)