Skip to content

Commit

Permalink
Generator naming fix
Browse files Browse the repository at this point in the history
  • Loading branch information
abdolence committed Jul 8, 2022
1 parent 8582778 commit 36336c2
Show file tree
Hide file tree
Showing 5,915 changed files with 1,112,645 additions and 80 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion .cargo/config
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[alias]
xtask = "run --release --package xtask --bin xtask --"
protosgen = "run --release --package protosgen --bin protosgen --"
27 changes: 0 additions & 27 deletions .github/workflows/ci.yml

This file was deleted.

30 changes: 0 additions & 30 deletions .github/workflows/doc.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[submodule "xtask/proto/googleapis"]
path = xtask/proto/googleapis
[submodule "gcloud-protos-generator/proto/googleapis"]
path = gcloud-protos-generator/proto/googleapis
url = https://github.com/googleapis/googleapis
shallow = true
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[workspace]
members = [
"gcloud-sdk",
"xtask",
"gcloud-protos-generator",
"examples/spanner-admin",
]
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# gcloud-sdk for Rust

[![ci](https://github.com/abdolence/gcloud-sdk-rs/workflows/ci/badge.svg)](https://github.com/abdolence/gcloud-sdk-rs/actions?query=workflow:ci)
[![Rust Documentation](https://docs.rs/gcloud-sdk/badge.svg)](https://docs.rs/gcloud-sdk)
[![Latest Version](https://img.shields.io/crates/v/gcloud-sdk.svg)](https://crates.io/crates/gcloud-sdk)

Expand Down
2 changes: 1 addition & 1 deletion xtask/Cargo.toml → gcloud-protos-generator/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "xtask"
name = "protosgen"
version = "0.4.2"
authors = ["mechiru <[email protected]>", "[email protected]"]
edition = "2021"
Expand Down
2 changes: 2 additions & 0 deletions gcloud-protos-generator/proto/googleapis/.bazeliskrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# See https://github.com/bazelbuild/bazelisk
USE_BAZEL_VERSION=4.2.2
8 changes: 8 additions & 0 deletions gcloud-protos-generator/proto/googleapis/.bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# To make proto_library rules to include source info in the descriptor
build --protocopt=--include_source_info
build --protocopt=--experimental_allow_proto3_optional

# This is to avoid JVM SIGBUS crashes on highly parallel builds,
# see https://github.com/bazelbuild/bazel/issues/3236 for more details
build --enable_platform_specific_config
build:linux --sandbox_tmpfs_path=/tmp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM gcr.io/cloud-builders/bazel

RUN apt-get update && apt-get install -y \
zip \
libxml2-dev \
build-essential

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
steps:
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-f', '.cloudbuild/Dockerfile.bazel-gapic', '-t', 'bazel-gapic', '.']
- name: 'bazel-gapic'
args: ['build', '--remote_http_cache=https://storage.googleapis.com/$PROJECT_ID-cloud-build-artifacts/$REPO_NAME/bazel-remote-cache', '--google_default_credentials', '//:gapic-cloud-build']
- name: 'ubuntu'
args: ['mkdir', 'gapic-cloud-build']
- name: 'ubuntu'
args: ['tar', '-xf', 'bazel-bin/gapic-cloud-build.tar', '-C', 'gapic-cloud-build']
- name: 'gcr.io/cloud-builders/gsutil'
args: ['-m', 'cp', '-r', 'gapic-cloud-build', 'gs://$PROJECT_ID-cloud-build-artifacts/$REPO_NAME/$COMMIT_SHA/gapic-cloud-build']
- name: 'ubuntu'
args: ['bash', './.cloudbuild/write-latest.sh', '$COMMIT_SHA']
artifacts:
objects:
location: 'gs://$PROJECT_ID-cloud-build-artifacts/$REPO_NAME/'
paths:
- 'cloud_build_latest'
options:
machineType: 'N1_HIGHCPU_32'
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

echo $1 > cloud_build_latest
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# The JSONPath filter expression used to identify which PRs to close.
# The data filtered is the pull request data along with other metadata passed in
# by probot.
# Default behavior: Close all PRs.
filters:
# Don't close PRs in the pubsub_dev branch.
- '@.pull_request.base.ref != "pubsub_dev"'
- '@.pull_request.base.ref != "diregapic"'

# The message to post to the closed PR.
commentBody: |
Thanks for your contribution! Unfortunately, we don't use GitHub pull
requests to manage code contributions to this repository. Instead, please
see [CONTRIBUTING.md](../blob/master/CONTRIBUTING.md) which provides full
instructions on how to get involved.
# Whether to add a label to the closed PR.
addLabel: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
name: DIREGAPIC Updater
on: # yamllint disable-line rule:truthy
schedule:
- cron: '19 */8 * * *'
workflow_dispatch:

jobs:
regenerate-compute:
runs-on: ubuntu-latest
container: gcr.io/gapic-images/googleapis:20220222
steps:
- name: Checkout master
uses: actions/checkout@v3
with:
ref: master
- name: Download discovery docs
run: |
curl https://www.googleapis.com/discovery/v1/apis/compute/v1/rest --output google/cloud/compute/v1/compute.v1.json
echo compute_revision=$(grep -oP '"revision":\s*"\d+"' google/cloud/compute/v1/compute.v1.json | grep -oP '\d+') >> $GITHUB_ENV
- name: Regenerate API definitions
run: |
bazel build //google/cloud/compute/v1:compute_gen
cp bazel-bin/google/cloud/compute/v1/compute_gen.proto google/cloud/compute/v1/compute.proto
bazel build //google/cloud/compute/v1:compute_grpc_service_config_gen
cp bazel-bin/google/cloud/compute/v1/compute_grpc_service_config_gen.json google/cloud/compute/v1/compute_grpc_service_config.json
bazel build //google/cloud/compute/v1:compute_gapic_gen
cp bazel-bin/google/cloud/compute/v1/compute_gapic_gen.yaml google/cloud/compute/v1/compute_gapic.yaml
echo api_changes=$(git diff-index --shortstat HEAD) >> $GITHUB_ENV
- name: Build GAPIC clients
if: contains(env.api_changes, 'file')
run: |
bazel build //google/cloud/compute/v1/...
bazel build //google/cloud/compute/v1/...
- name: Create PR
uses: googleapis/code-suggester@v2
env:
ACCESS_TOKEN: ${{ secrets.YOSHI_CODE_BOT_TOKEN }}
with:
command: pr
upstream_owner: googleapis
upstream_repo: googleapis
title: 'feat: [DIREGAPIC] Update API definitions'
description: 'feat: Update Compute Engine API to revision ${{ env.compute_revision }}'
message: 'feat: Update Compute Engine API to revision ${{ env.compute_revision }}'
primary: 'master'
branch: diregapic
git_dir: '.'
force: true
fork: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Generate API Index
on: # yamllint disable-line rule:truthy
push:
branches: [master]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Setup .NET Core SDK
uses: actions/[email protected]
- name: Checkout googleapis (this repository)
uses: actions/checkout@v2
with:
path: googleapis
- name: Checkout index generator
uses: actions/checkout@v2
with:
repository: googleapis/googleapis-api-index-generator
path: gen
- name: Generate API index
run: |
gen/scripts/generate-schema.sh
gen/scripts/generate-index.sh $PWD/googleapis
cp gen/tmp/api-index-v1.json $PWD/googleapis
- name: Commit API index
run: |
cd googleapis
[[ ! $(git diff --exit-code api-index-v1.json) ]] && echo "Nothing to commit." && exit 0
git config user.name "Google APIs"
git add api-index-v1.json
git commit -m "chore: regenerate API index"
git push
7 changes: 7 additions & 0 deletions gcloud-protos-generator/proto/googleapis/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
OWNERS
README.google
google/internal
google/protobuf
.project
artman-genfiles/
bazel-*
1 change: 1 addition & 0 deletions gcloud-protos-generator/proto/googleapis/.kokoro/.bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

27 changes: 27 additions & 0 deletions gcloud-protos-generator/proto/googleapis/.kokoro/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM python:3.8

RUN apt-get update

RUN apt-get install -y \
zip \
build-essential \
python-dev \
python3-dev \
openjdk-11-jdk

RUN mkdir -p /tools
WORKDIR /tools
RUN curl -L https://github.com/bazelbuild/bazelisk/releases/download/v1.8.0/bazelisk-linux-amd64 -o bazelisk
RUN chmod +x bazelisk
RUN curl -L https://github.com/bazelbuild/bazel/releases/download/4.0.0/bazel-4.0.0-linux-x86_64 -o bazel
RUN chmod +x bazel
WORKDIR /

ENV PATH="/tools:${PATH}"

ENV BAZELISK_BIN=/tools/bazelisk
ENV BAZEL_BIN=/tools/bazelisk

RUN apt-get clean

ENTRYPOINT [ "/bin/bash" ]
14 changes: 14 additions & 0 deletions gcloud-protos-generator/proto/googleapis/.kokoro/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

set -e

cd ${KOKORO_ARTIFACTS_DIR}/github/googleapis
cp .kokoro/.bazelrc $HOME/.bazelrc
CACHE_BUCKET=client-libraries-bazel-cache-github
CACHE_CMDLINE="--remote_cache=https://storage.googleapis.com/${CACHE_BUCKET} --google_default_credentials"

#
# Run build and tests
#
${BAZELISK_BIN} --output_user_root=${BAZEL_ROOT} build ${CACHE_CMDLINE} --keep_going //...
${BAZELISK_BIN} --output_user_root=${BAZEL_ROOT} test ${CACHE_CMDLINE} --flaky_test_attempts=3 --keep_going //...
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Format: //devtools/kokoro/config/proto/build.proto

# This configuration file defines Kokoro job for GitHub presubmit,
# the build_file will be looked up in https://github.com/googleapis/googleapis/
build_file: "googleapis/.kokoro/start.sh"
Loading

0 comments on commit 36336c2

Please sign in to comment.