diff --git a/.cloudbuild/graalvm/cloudbuild-test-a-downstream-kms.yaml b/.cloudbuild/graalvm/cloudbuild-test-a-downstream-kms.yaml index bc87bf54d3..aadc719fc7 100644 --- a/.cloudbuild/graalvm/cloudbuild-test-a-downstream-kms.yaml +++ b/.cloudbuild/graalvm/cloudbuild-test-a-downstream-kms.yaml @@ -15,7 +15,7 @@ timeout: 7200s # 2 hours substitutions: _SHARED_DEPENDENCIES_VERSION: '3.30.1-SNAPSHOT' # {x-version-update:google-cloud-shared-dependencies:current} - _JAVA_SHARED_CONFIG_VERSION: '1.16.1' + _JAVA_SHARED_CONFIG_VERSION: '1.17.0' options: machineType: 'E2_HIGHCPU_8' logging: CLOUD_LOGGING_ONLY diff --git a/.cloudbuild/graalvm/cloudbuild-test-a-downstream-kmsinventory.yaml b/.cloudbuild/graalvm/cloudbuild-test-a-downstream-kmsinventory.yaml index 6d19e034ce..470dd85679 100644 --- a/.cloudbuild/graalvm/cloudbuild-test-a-downstream-kmsinventory.yaml +++ b/.cloudbuild/graalvm/cloudbuild-test-a-downstream-kmsinventory.yaml @@ -15,7 +15,7 @@ timeout: 7200s # 2 hours substitutions: _SHARED_DEPENDENCIES_VERSION: '3.30.1-SNAPSHOT' # {x-version-update:google-cloud-shared-dependencies:current} - _JAVA_SHARED_CONFIG_VERSION: '1.16.1' + _JAVA_SHARED_CONFIG_VERSION: '1.17.0' options: machineType: 'E2_HIGHCPU_8' logging: CLOUD_LOGGING_ONLY diff --git a/.cloudbuild/graalvm/cloudbuild-test-a.yaml b/.cloudbuild/graalvm/cloudbuild-test-a.yaml index 24cc27bfe4..4072561d32 100644 --- a/.cloudbuild/graalvm/cloudbuild-test-a.yaml +++ b/.cloudbuild/graalvm/cloudbuild-test-a.yaml @@ -14,8 +14,8 @@ timeout: 7200s # 2 hours substitutions: - _SHARED_DEPENDENCIES_VERSION: '3.52.3' # {x-version-update:google-cloud-shared-dependencies:current} - _JAVA_SHARED_CONFIG_VERSION: '1.16.1' + _SHARED_DEPENDENCIES_VERSION: '3.53.0' # {x-version-update:google-cloud-shared-dependencies:current} + _JAVA_SHARED_CONFIG_VERSION: '1.17.0' options: machineType: 'E2_HIGHCPU_8' logging: CLOUD_LOGGING_ONLY diff --git a/.cloudbuild/graalvm/cloudbuild-test-b-downstream-kms.yaml b/.cloudbuild/graalvm/cloudbuild-test-b-downstream-kms.yaml index fcbff819fd..8001e5ca3f 100644 --- a/.cloudbuild/graalvm/cloudbuild-test-b-downstream-kms.yaml +++ b/.cloudbuild/graalvm/cloudbuild-test-b-downstream-kms.yaml @@ -15,7 +15,7 @@ timeout: 7200s # 2 hours substitutions: _SHARED_DEPENDENCIES_VERSION: '3.30.1-SNAPSHOT' # {x-version-update:google-cloud-shared-dependencies:current} - _JAVA_SHARED_CONFIG_VERSION: '1.16.1' + _JAVA_SHARED_CONFIG_VERSION: '1.17.0' options: machineType: 'E2_HIGHCPU_8' logging: CLOUD_LOGGING_ONLY diff --git a/.cloudbuild/graalvm/cloudbuild-test-b-downstream-kmsinventory.yaml b/.cloudbuild/graalvm/cloudbuild-test-b-downstream-kmsinventory.yaml index f115e0b5c8..45559307e5 100644 --- a/.cloudbuild/graalvm/cloudbuild-test-b-downstream-kmsinventory.yaml +++ b/.cloudbuild/graalvm/cloudbuild-test-b-downstream-kmsinventory.yaml @@ -15,7 +15,7 @@ timeout: 7200s # 2 hours substitutions: _SHARED_DEPENDENCIES_VERSION: '3.30.1-SNAPSHOT' # {x-version-update:google-cloud-shared-dependencies:current} - _JAVA_SHARED_CONFIG_VERSION: '1.16.1' + _JAVA_SHARED_CONFIG_VERSION: '1.17.0' options: machineType: 'E2_HIGHCPU_8' logging: CLOUD_LOGGING_ONLY diff --git a/.cloudbuild/graalvm/cloudbuild-test-b.yaml b/.cloudbuild/graalvm/cloudbuild-test-b.yaml index fca172c3ca..0a14f3e009 100644 --- a/.cloudbuild/graalvm/cloudbuild-test-b.yaml +++ b/.cloudbuild/graalvm/cloudbuild-test-b.yaml @@ -14,8 +14,8 @@ timeout: 7200s # 2 hours substitutions: - _SHARED_DEPENDENCIES_VERSION: '3.52.3' # {x-version-update:google-cloud-shared-dependencies:current} - _JAVA_SHARED_CONFIG_VERSION: '1.16.1' + _SHARED_DEPENDENCIES_VERSION: '3.53.0' # {x-version-update:google-cloud-shared-dependencies:current} + _JAVA_SHARED_CONFIG_VERSION: '1.17.0' options: machineType: 'E2_HIGHCPU_8' logging: CLOUD_LOGGING_ONLY diff --git a/.cloudbuild/graalvm/cloudbuild-test-c-downstream-kms.yaml b/.cloudbuild/graalvm/cloudbuild-test-c-downstream-kms.yaml index c855429205..deed4f544f 100644 --- a/.cloudbuild/graalvm/cloudbuild-test-c-downstream-kms.yaml +++ b/.cloudbuild/graalvm/cloudbuild-test-c-downstream-kms.yaml @@ -15,7 +15,7 @@ timeout: 7200s # 2 hours substitutions: _SHARED_DEPENDENCIES_VERSION: '3.30.1-SNAPSHOT' # {x-version-update:google-cloud-shared-dependencies:current} - _JAVA_SHARED_CONFIG_VERSION: '1.16.1' + _JAVA_SHARED_CONFIG_VERSION: '1.17.0' options: machineType: 'E2_HIGHCPU_8' logging: CLOUD_LOGGING_ONLY diff --git a/.cloudbuild/graalvm/cloudbuild-test-c-downstream-kmsinventory.yaml b/.cloudbuild/graalvm/cloudbuild-test-c-downstream-kmsinventory.yaml index 07500c482c..a1a33b2662 100644 --- a/.cloudbuild/graalvm/cloudbuild-test-c-downstream-kmsinventory.yaml +++ b/.cloudbuild/graalvm/cloudbuild-test-c-downstream-kmsinventory.yaml @@ -15,7 +15,7 @@ timeout: 7200s # 2 hours substitutions: _SHARED_DEPENDENCIES_VERSION: '3.30.1-SNAPSHOT' # {x-version-update:google-cloud-shared-dependencies:current} - _JAVA_SHARED_CONFIG_VERSION: '1.16.1' + _JAVA_SHARED_CONFIG_VERSION: '1.17.0' options: machineType: 'E2_HIGHCPU_8' logging: CLOUD_LOGGING_ONLY diff --git a/.cloudbuild/graalvm/cloudbuild-test-c.yaml b/.cloudbuild/graalvm/cloudbuild-test-c.yaml index c37b2878dc..3066766261 100644 --- a/.cloudbuild/graalvm/cloudbuild-test-c.yaml +++ b/.cloudbuild/graalvm/cloudbuild-test-c.yaml @@ -14,8 +14,8 @@ timeout: 7200s # 2 hours substitutions: - _SHARED_DEPENDENCIES_VERSION: '3.52.3' # {x-version-update:google-cloud-shared-dependencies:current} - _JAVA_SHARED_CONFIG_VERSION: '1.16.1' + _SHARED_DEPENDENCIES_VERSION: '3.53.0' # {x-version-update:google-cloud-shared-dependencies:current} + _JAVA_SHARED_CONFIG_VERSION: '1.17.0' options: machineType: 'E2_HIGHCPU_8' logging: CLOUD_LOGGING_ONLY diff --git a/.cloudbuild/graalvm/cloudbuild.yaml b/.cloudbuild/graalvm/cloudbuild.yaml index 9f317f32e6..ffce549ef7 100644 --- a/.cloudbuild/graalvm/cloudbuild.yaml +++ b/.cloudbuild/graalvm/cloudbuild.yaml @@ -14,8 +14,8 @@ timeout: 7200s # 2 hours substitutions: - _SHARED_DEPENDENCIES_VERSION: '3.52.3' # {x-version-update:google-cloud-shared-dependencies:current} - _JAVA_SHARED_CONFIG_VERSION: '1.16.1' + _SHARED_DEPENDENCIES_VERSION: '3.53.0' # {x-version-update:google-cloud-shared-dependencies:current} + _JAVA_SHARED_CONFIG_VERSION: '1.17.0' steps: # GraalVM A build - name: gcr.io/cloud-builders/docker diff --git a/.cloudbuild/library_generation/cloudbuild-library-generation-push.yaml b/.cloudbuild/library_generation/cloudbuild-library-generation-push.yaml index b9c5704e63..6f7a48c5a9 100644 --- a/.cloudbuild/library_generation/cloudbuild-library-generation-push.yaml +++ b/.cloudbuild/library_generation/cloudbuild-library-generation-push.yaml @@ -14,7 +14,7 @@ timeout: 7200s # 2 hours substitutions: - _GAPIC_GENERATOR_JAVA_VERSION: '2.62.3' # {x-version-update:gapic-generator-java:current} + _GAPIC_GENERATOR_JAVA_VERSION: '2.63.0' # {x-version-update:gapic-generator-java:current} _PRIVATE_IMAGE_NAME: "us-docker.pkg.dev/java-hermetic-build-prod/private-resources/java-library-generation" _PRIVATE_SHA_IMAGE_ID: "${_PRIVATE_IMAGE_NAME}:${COMMIT_SHA}" _PRIVATE_LATEST_IMAGE_ID: "${_PRIVATE_IMAGE_NAME}:latest" diff --git a/.cloudbuild/library_generation/library_generation.Dockerfile b/.cloudbuild/library_generation/library_generation.Dockerfile index 8390c56f60..46ff3a72e2 100644 --- a/.cloudbuild/library_generation/library_generation.Dockerfile +++ b/.cloudbuild/library_generation/library_generation.Dockerfile @@ -21,7 +21,7 @@ FROM docker.io/library/maven:3.9.9-eclipse-temurin-17-alpine@sha256:969014ee8852 WORKDIR /sdk-platform-java COPY . . # {x-version-update-start:gapic-generator-java:current} -ENV DOCKER_GAPIC_GENERATOR_VERSION="2.62.3" +ENV DOCKER_GAPIC_GENERATOR_VERSION="2.63.0" # {x-version-update-end} # Download the java formatter diff --git a/.cloudbuild/library_generation/library_generation_airlock.Dockerfile b/.cloudbuild/library_generation/library_generation_airlock.Dockerfile index e8acdfdf8d..6608ba48ab 100644 --- a/.cloudbuild/library_generation/library_generation_airlock.Dockerfile +++ b/.cloudbuild/library_generation/library_generation_airlock.Dockerfile @@ -21,7 +21,7 @@ FROM us-docker.pkg.dev/artifact-foundry-prod/docker-3p-trusted/maven@sha256:d3f0 WORKDIR /sdk-platform-java COPY . . # {x-version-update-start:gapic-generator-java:current} -ENV DOCKER_GAPIC_GENERATOR_VERSION="2.62.3" +ENV DOCKER_GAPIC_GENERATOR_VERSION="2.63.0" # {x-version-update-end} # Download the java formatter diff --git a/.github/scripts/test_dependency_compatibility.sh b/.github/scripts/test_dependency_compatibility.sh index f2a5ae638e..9b07efd1ce 100755 --- a/.github/scripts/test_dependency_compatibility.sh +++ b/.github/scripts/test_dependency_compatibility.sh @@ -18,8 +18,7 @@ # an input for the deps_list to manually run a subset of dependencies. # # The default upper-bound dependencies file is `dependencies.txt` located in the root -# of sdk-platform-java. The upper-bound dependencies file will be in the format of: -# ${dependency.name}=${dependency.version} +# of sdk-platform-java. See the upper-bound dependencies file for the dependency format. set -ex @@ -29,18 +28,6 @@ function print_help() { echo "Use -l {deps_list} for a comma-separated list of dependencies to test (Format: dep1=1.0,dep2=2.0)" } -# Function to parse a dependency string and append it to the Maven command -function add_dependency_to_maven_command() { - local dep_pair=$1 - if [[ ! "${dep_pair}" =~ .*=.* ]]; then - echo "Malformed dependency string: ${dep_pair}. Expected format: dependency=version" - exit 1 - fi - local dependency=$(echo "${dep_pair}" | cut -d'=' -f1 | tr -d '[:space:]') - local version=$(echo "${dep_pair}" | cut -d'=' -f2 | sed 's/^[[:space:]]*//;s/[[:space:]]*$//') - MAVEN_COMMAND+=" -D${dependency}.version=${version}" -} - # Default to the upper bounds file in the root of the repo file='dependencies.txt' dependency_list='' @@ -59,7 +46,7 @@ if [[ -z "${file}" && -z "${dependency_list}" ]]; then print_help && exit 1 fi -MAVEN_COMMAND="mvn verify -Penable-integration-tests -Dclirr.skip -Dcheckstyle.skip -Dfmt.skip -Denforcer.skip " +MAVEN_COMMAND="mvn -ntp -B verify -Penable-integration-tests -Dclirr.skip -Dcheckstyle.skip -Dfmt.skip -Denforcer.skip" # Check if a list of dependencies was provided as an argument. If the list of dependency inputted # is empty, then run with the upper-bound dependencies file @@ -77,7 +64,11 @@ if [ -z "${dependency_list}" ]; then if [[ "${line}" =~ ^[[:space:]]*# ]] || [[ -z "${line}" ]]; then continue fi - add_dependency_to_maven_command "${line}" + # Format from `dependencies.txt`: {GroupID}:{ArtifactID},{PropertyName}={Version} + propertyVersion=$(echo "${line}" | cut -d',' -f2) + dependency=$(echo "${propertyVersion}" | cut -d'=' -f1) + version=$(echo "${propertyVersion}" | cut -d'=' -f2) + MAVEN_COMMAND+=" -D${dependency}.version=${version}" done < "${UPPER_BOUND_DEPENDENCY_FILE}" else # This else block means that a list of dependencies was inputted # Set the Internal Field Separator (IFS) to a comma. @@ -91,7 +82,10 @@ else # This else block means that a list of dependencies was inputted if [ -z "${DEP_PAIR}" ]; then continue fi - add_dependency_to_maven_command "${DEP_PAIR}" + # Format: {MavenPropertyName}={Version} + dependency=$(echo "${DEP_PAIR}" | cut -d'=' -f1) + version=$(echo "${DEP_PAIR}" | cut -d'=' -f2) + MAVEN_COMMAND+=" -D${dependency}.version=${version}" done fi diff --git a/.github/workflows/dependency_compatibility_test.yaml b/.github/workflows/dependency_compatibility_test.yaml index f13ce1e0cf..e1b5203fac 100644 --- a/.github/workflows/dependency_compatibility_test.yaml +++ b/.github/workflows/dependency_compatibility_test.yaml @@ -8,6 +8,7 @@ on: inputs: dependencies-list: description: 'Comma-separated list of dependencies to test (Example format: protobuf=4.31.0,guava=33.4.8-jre). + Note: The name should be the maven property. Find this value in the section in the pom. Do not include the `-D` prefix or `.version` suffix. Those values will be appended when generating the command. No input (default) will run the the upper-bound dependencies file.' required: false @@ -34,7 +35,7 @@ jobs: run: echo "DEPENDENCIES_LIST=${{ github.event.inputs.dependencies-list }}" >> $GITHUB_ENV # Run in the root module which should test for everything except for showcase - - name: Perform Dependency Compatibility Testing + - name: Perform Dependency Compatibility Unit Testing shell: bash run: | if [[ -n "${{ env.DEPENDENCIES_LIST }}" ]]; then @@ -63,7 +64,7 @@ jobs: cd - # Run Showcase's Integration Tests - - name: Perform Dependency Compatibility Testing (Showcase only) + - name: Perform Dependency Compatibility Integration Testing (Showcase Tests) shell: bash # Need to cd out of the directory to get the scripts as this step is run inside the java-showcase directory run: | diff --git a/.github/workflows/downstream.yaml b/.github/workflows/downstream.yaml index c6b3f64856..8cee63e1b3 100644 --- a/.github/workflows/downstream.yaml +++ b/.github/workflows/downstream.yaml @@ -9,6 +9,7 @@ on: - library_generation/** - showcase/** - test/** + - internal/librariangen/** name: Downstream Check jobs: diff --git a/.github/workflows/gemini-cli.yml b/.github/workflows/gemini-cli.yml deleted file mode 100644 index 9257b7b2b2..0000000000 --- a/.github/workflows/gemini-cli.yml +++ /dev/null @@ -1,270 +0,0 @@ -#name: '💬 Gemini CLI' -# -#on: -# issue_comment: -# types: [created] -# -#concurrency: -# group: '${{ github.workflow }}-${{ github.event.issue.number }}' -# cancel-in-progress: |- -# ${{ github.event.sender.type == 'User' && ( github.event.issue.author_association == 'OWNER' || github.event.issue.author_association == 'MEMBER' || github.event.issue.author_association == 'COLLABORATOR') }} -# -#defaults: -# run: -# shell: 'bash' -# -#permissions: -# contents: 'write' -# id-token: 'write' -# pull-requests: 'write' -# issues: 'write' -# -#jobs: -# gemini-cli: -# # This condition is complex to ensure we only run when explicitly invoked. -# if: |- -# github.event_name == 'workflow_dispatch' || -# ( -# github.event_name == 'issues' && github.event.action == 'opened' && -# contains(github.event.issue.body, '@gemini-cli') && -# !contains(github.event.issue.body, '@gemini-cli /review') && -# !contains(github.event.issue.body, '@gemini-cli /triage') && -# contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.issue.author_association) -# ) || -# ( -# github.event_name == 'issue_comment' && -# contains(github.event.comment.body, '@gemini-cli') && -# !contains(github.event.comment.body, '@gemini-cli /review') && -# !contains(github.event.comment.body, '@gemini-cli /triage') && -# contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.comment.author_association) -# ) -# timeout-minutes: 10 -# runs-on: 'ubuntu-latest' -# -# steps: -# - name: 'Get context from event' -# id: 'get_context' -# env: -# EVENT_NAME: '${{ github.event_name }}' -# EVENT_PAYLOAD: '${{ toJSON(github.event) }}' -# run: |- -# set -euo pipefail -# -# USER_REQUEST="" -# ISSUE_NUMBER="" -# IS_PR="false" -# -# if [[ "${EVENT_NAME}" == "issues" ]]; then -# USER_REQUEST=$(echo "${EVENT_PAYLOAD}" | jq -r .issue.body) -# ISSUE_NUMBER=$(echo "${EVENT_PAYLOAD}" | jq -r .issue.number) -# elif [[ "${EVENT_NAME}" == "issue_comment" ]]; then -# USER_REQUEST=$(echo "${EVENT_PAYLOAD}" | jq -r .comment.body) -# ISSUE_NUMBER=$(echo "${EVENT_PAYLOAD}" | jq -r .issue.number) -# if [[ $(echo "${EVENT_PAYLOAD}" | jq -r .issue.pull_request) != "null" ]]; then -# IS_PR="true" -# fi -# fi -# -# # Clean up user request -# USER_REQUEST=$(echo "${USER_REQUEST}" | sed 's/.*@gemini-cli//' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//') -# -# { -# echo "user_request=${USER_REQUEST}" -# echo "issue_number=${ISSUE_NUMBER}" -# echo "is_pr=${IS_PR}" -# } >> "${GITHUB_OUTPUT}" -# -# - name: 'Set up git user for commits' -# run: |- -# git config --global user.name 'gemini-cli[bot]' -# git config --global user.email 'gemini-cli[bot]@users.noreply.github.com' -# -# - name: 'Checkout PR branch' -# if: |- -# ${{ steps.get_context.outputs.is_pr == 'true' }} -# uses: 'actions/checkout@v5' -# with: -# token: '${{ steps.generate_token.outputs.token || secrets.GITHUB_TOKEN }}' -# repository: '${{ github.repository }}' -# ref: 'refs/pull/${{ steps.get_context.outputs.issue_number }}/head' -# fetch-depth: 0 -# -# - name: 'Checkout main branch' -# if: |- -# ${{ steps.get_context.outputs.is_pr == 'false' }} -# uses: 'actions/checkout@v5' -# with: -# token: '${{ steps.generate_token.outputs.token || secrets.GITHUB_TOKEN }}' -# repository: '${{ github.repository }}' -# fetch-depth: 0 -# -# - name: 'Acknowledge request' -# env: -# GITHUB_ACTOR: '${{ github.actor }}' -# GITHUB_TOKEN: '${{ steps.generate_token.outputs.token || secrets.GITHUB_TOKEN }}' -# ISSUE_NUMBER: '${{ steps.get_context.outputs.issue_number }}' -# REPOSITORY: '${{ github.repository }}' -# REQUEST_TYPE: '${{ steps.get_context.outputs.request_type }}' -# run: |- -# set -euo pipefail -# MESSAGE="@${GITHUB_ACTOR} I've received your request and I'm working on it now! 🤖" -# if [[ -n "${MESSAGE}" ]]; then -# gh issue comment "${ISSUE_NUMBER}" \ -# --body "${MESSAGE}" \ -# --repo "${REPOSITORY}" -# fi -# -# - name: 'Get description' -# id: 'get_description' -# env: -# GITHUB_TOKEN: '${{ steps.generate_token.outputs.token || secrets.GITHUB_TOKEN }}' -# IS_PR: '${{ steps.get_context.outputs.is_pr }}' -# ISSUE_NUMBER: '${{ steps.get_context.outputs.issue_number }}' -# run: |- -# set -euo pipefail -# if [[ "${IS_PR}" == "true" ]]; then -# DESCRIPTION=$(gh pr view "${ISSUE_NUMBER}" --json body --template '{{.body}}') -# else -# DESCRIPTION=$(gh issue view "${ISSUE_NUMBER}" --json body --template '{{.body}}') -# fi -# { -# echo "description<> "${GITHUB_OUTPUT}" -# -# - name: 'Get comments' -# id: 'get_comments' -# env: -# GITHUB_TOKEN: '${{ steps.generate_token.outputs.token || secrets.GITHUB_TOKEN }}' -# IS_PR: '${{ steps.get_context.outputs.is_pr }}' -# ISSUE_NUMBER: '${{ steps.get_context.outputs.issue_number }}' -# run: |- -# set -euo pipefail -# if [[ "${IS_PR}" == "true" ]]; then -# COMMENTS=$(gh pr view "${ISSUE_NUMBER}" --json comments --template '{{range .comments}}{{.author.login}}: {{.body}}{{"\n"}}{{end}}') -# else -# COMMENTS=$(gh issue view "${ISSUE_NUMBER}" --json comments --template '{{range .comments}}{{.author.login}}: {{.body}}{{"\n"}}{{end}}') -# fi -# { -# echo "comments<> "${GITHUB_OUTPUT}" -# -# - name: 'Run Gemini' -# id: 'run_gemini' -# uses: 'google-github-actions/run-gemini-cli@v0' -# env: -# GITHUB_TOKEN: '${{ steps.generate_token.outputs.token || secrets.GITHUB_TOKEN }}' -# REPOSITORY: '${{ github.repository }}' -# USER_REQUEST: '${{ steps.get_context.outputs.user_request }}' -# ISSUE_NUMBER: '${{ steps.get_context.outputs.issue_number }}' -# IS_PR: '${{ steps.get_context.outputs.is_pr }}' -# with: -# gemini_api_key: '${{ secrets.GEMINI_API_KEY }}' -# gcp_workload_identity_provider: '${{ vars.GCP_WIF_PROVIDER }}' -# gcp_project_id: '${{ vars.GOOGLE_CLOUD_PROJECT }}' -# gcp_location: '${{ vars.GOOGLE_CLOUD_LOCATION }}' -# gcp_service_account: '${{ vars.SERVICE_ACCOUNT_EMAIL }}' -# use_vertex_ai: '${{ vars.GOOGLE_GENAI_USE_VERTEXAI }}' -# use_gemini_code_assist: '${{ vars.GOOGLE_GENAI_USE_GCA }}' -# settings: |- -# { -# "maxSessionTurns": 50, -# "telemetry": { -# "enabled": false, -# "target": "gcp" -# } -# } -# prompt: |- -# ## Role -# -# You are a helpful AI assistant invoked via a CLI interface in a GitHub workflow. You have access to tools to interact with the repository and respond to the user. -# -# ## Context -# -# - **Repository**: `${{ github.repository }}` -# - **Triggering Event**: `${{ github.event_name }}` -# - **Issue/PR Number**: `${{ steps.get_context.outputs.issue_number }}` -# - **Is this a PR?**: `${{ steps.get_context.outputs.is_pr }}` -# - **Issue/PR Description**: -# `${{ steps.get_description.outputs.description }}` -# - **Comments**: -# `${{ steps.get_comments.outputs.comments }}` -# -# ## User Request -# -# The user has sent the following request: -# `${{ steps.get_context.outputs.user_request }}` -# -# ## How to Respond to Issues, PR Comments, and Questions -# -# This workflow supports three main scenarios: -# -# 1. **Creating a Fix for an Issue** -# - Carefully read the user request and the related issue or PR description. -# - Use available tools to gather all relevant context (e.g., `gh issue view`, `gh pr view`, `gh pr diff`, `cat`, `head`, `tail`). -# - Identify the root cause of the problem before proceeding. -# - **Show and maintain a plan as a checklist**: -# - At the very beginning, outline the steps needed to resolve the issue or address the request and post them as a checklist comment on the issue or PR (use GitHub markdown checkboxes: `- [ ] Task`). -# - Example: -# ``` -# ### Plan -# - [ ] Investigate the root cause -# - [ ] Implement the fix in `file.py` -# - [ ] Add/modify tests -# - [ ] Update documentation -# - [ ] Verify the fix and close the issue -# ``` -# - Use: `gh pr comment "${ISSUE_NUMBER}" --body ""` or `gh issue comment "${ISSUE_NUMBER}" --body ""` to post the initial plan. -# - As you make progress, keep the checklist visible and up to date by editing the same comment (check off completed tasks with `- [x]`). -# - To update the checklist: -# 1. Find the comment ID for the checklist (use `gh pr comment list "${ISSUE_NUMBER}"` or `gh issue comment list "${ISSUE_NUMBER}"`). -# 2. Edit the comment with the updated checklist: -# - For PRs: `gh pr comment --edit --body ""` -# - For Issues: `gh issue comment --edit --body ""` -# 3. The checklist should only be maintained as a comment on the issue or PR. Do not track or update the checklist in code files. -# - If the fix requires code changes, determine which files and lines are affected. If clarification is needed, note any questions for the user. -# - Make the necessary code or documentation changes using the available tools (e.g., `write_file`). Ensure all changes follow project conventions and best practices. Reference all shell variables as `"${VAR}"` (with quotes and braces) to prevent errors. -# - Run any relevant tests or checks to verify the fix works as intended. If possible, provide evidence (test output, screenshots, etc.) that the issue is resolved. -# - **Branching and Committing**: -# - **NEVER commit directly to the `main` branch.** -# - If you are working on a **pull request** (`IS_PR` is `true`), the correct branch is already checked out. Simply commit and push to it. -# - `git add .` -# - `git commit -m "feat: "` -# - `git push` -# - If you are working on an **issue** (`IS_PR` is `false`), create a new branch for your changes. A good branch name would be `issue/${ISSUE_NUMBER}/`. -# - `git checkout -b issue/${ISSUE_NUMBER}/my-fix` -# - `git add .` -# - `git commit -m "feat: "` -# - `git push origin issue/${ISSUE_NUMBER}/my-fix` -# - After pushing, you can create a pull request: `gh pr create --title "Fixes #${ISSUE_NUMBER}: " --body "This PR addresses issue #${ISSUE_NUMBER}."` -# - Summarize what was changed and why in a markdown file: `write_file("response.md", "")` -# - Post the response as a comment: -# - For PRs: `gh pr comment "${ISSUE_NUMBER}" --body-file response.md` -# - For Issues: `gh issue comment "${ISSUE_NUMBER}" --body-file response.md` -# -# 2. **Addressing Comments on a Pull Request** -# - Read the specific comment and the context of the PR. -# - Use tools like `gh pr view`, `gh pr diff`, and `cat` to understand the code and discussion. -# - If the comment requests a change or clarification, follow the same process as for fixing an issue: create a checklist plan, implement, test, and commit any required changes, updating the checklist as you go. -# - **Committing Changes**: The correct PR branch is already checked out. Simply add, commit, and push your changes. -# - `git add .` -# - `git commit -m "fix: address review comments"` -# - `git push` -# - If the comment is a question, answer it directly and clearly, referencing code or documentation as needed. -# - Document your response in `response.md` and post it as a PR comment: `gh pr comment "${ISSUE_NUMBER}" --body-file response.md` -# -# 3. **Answering Any Question on an Issue** -# - Read the question and the full issue context using `gh issue view` and related tools. -# - Research or analyze the codebase as needed to provide an accurate answer. -# - If the question requires code or documentation changes, follow the fix process above, including creating and updating a checklist plan and **creating a new branch for your changes as described in section 1.** -# - Write a clear, concise answer in `response.md` and post it as an issue comment: `gh issue comment "${ISSUE_NUMBER}" --body-file response.md` -# -# ## Guidelines -# -# - **Be concise and actionable.** Focus on solving the user's problem efficiently. -# - **Always commit and push your changes if you modify code or documentation.** -# - **If you are unsure about the fix or answer, explain your reasoning and ask clarifying questions.** -# - **Follow project conventions and best practices.** diff --git a/.github/workflows/gemini-issue-automated-triage.yml b/.github/workflows/gemini-issue-automated-triage.yml deleted file mode 100644 index d4ae486fd6..0000000000 --- a/.github/workflows/gemini-issue-automated-triage.yml +++ /dev/null @@ -1,123 +0,0 @@ -#name: '🏷️ Gemini Automated Issue Triage' -# -#on: -# issues: -# types: -# - 'opened' -# - 'reopened' -# issue_comment: -# types: -# - 'created' -# workflow_dispatch: -# inputs: -# issue_number: -# description: 'issue number to triage' -# required: true -# type: 'number' -# -#concurrency: -# group: '${{ github.workflow }}-${{ github.event.issue.number }}' -# cancel-in-progress: true -# -#defaults: -# run: -# shell: 'bash' -# -#permissions: -# contents: 'read' -# id-token: 'write' -# issues: 'write' -# statuses: 'write' -# -#jobs: -# triage-issue: -# if: |- -# github.event_name == 'issues' || -# github.event_name == 'workflow_dispatch' || -# ( -# github.event_name == 'issue_comment' && -# contains(github.event.comment.body, '@gemini-cli /triage') && -# contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.comment.author_association) -# ) -# timeout-minutes: 5 -# runs-on: 'ubuntu-latest' -# -# steps: -# - name: 'Checkout repository' -# uses: 'actions/checkout@v5' -# -# - name: 'Run Gemini Issue Triage' -# uses: 'google-github-actions/run-gemini-cli@v0' -# id: 'gemini_issue_triage' -# env: -# GITHUB_TOKEN: '${{ steps.generate_token.outputs.token || secrets.GITHUB_TOKEN }}' -# ISSUE_TITLE: '${{ github.event.issue.title }}' -# ISSUE_BODY: '${{ github.event.issue.body }}' -# ISSUE_NUMBER: '${{ github.event.issue.number }}' -# REPOSITORY: '${{ github.repository }}' -# with: -# gemini_cli_version: '${{ vars.GEMINI_CLI_VERSION }}' -# gcp_workload_identity_provider: '${{ vars.GCP_WIF_PROVIDER }}' -# gcp_project_id: '${{ vars.GOOGLE_CLOUD_PROJECT }}' -# gcp_location: '${{ vars.GOOGLE_CLOUD_LOCATION }}' -# gcp_service_account: '${{ vars.SERVICE_ACCOUNT_EMAIL }}' -# gemini_api_key: '${{ secrets.GEMINI_API_KEY }}' -# use_vertex_ai: '${{ vars.GOOGLE_GENAI_USE_VERTEXAI }}' -# use_gemini_code_assist: '${{ vars.GOOGLE_GENAI_USE_GCA }}' -# settings: |- -# { -# "maxSessionTurns": 25, -# "coreTools": [ -# "run_shell_command(echo)", -# "run_shell_command(gh label list)", -# "run_shell_command(gh issue edit)" -# ], -# "telemetry": { -# "enabled": true, -# "target": "gcp" -# } -# } -# prompt: |- -# ## Role -# -# You are an issue triage assistant. Analyze the current GitHub issue -# and apply the most appropriate existing labels. Use the available -# tools to gather information; do not ask for information to be -# provided. -# -# ## Steps -# -# 1. Run: `gh label list` to get all available labels. -# 2. Review the issue title and body provided in the environment -# variables: "${ISSUE_TITLE}" and "${ISSUE_BODY}". -# 3. Classify issues by their type (bug, enhancement, documentation, -# cleanup, etc) and their priority (p0, p1, p2, p3). Set the -# labels according to the format `type: *` and `priority: *` patterns. -# If the priority is determined to be more urgent than p2 (e.g. p0 or p1), mark the issue -# as p2 and add a comment in the issue with the reason. The comment should ping -# @blakeli0, @lqiu96, and @zhumin8 to notify them. -# 4. Apply the selected labels to this issue using: -# `gh issue edit "${ISSUE_NUMBER}" --add-label "label1,label2"` -# -# ## Guidelines -# -# - If there are already labels for `type: *` and `priority: *` set on the issue, do not modify the labels -# - Only use labels that already exist in the repository -# - Do not modify the original issue content -# - Triage only the current issue -# - Assign all applicable labels based on the issue content -# - Reference all shell variables as "${VAR}" (with quotes and braces) -# -# - name: 'Post Issue Triage Failure Comment' -# if: |- -# ${{ failure() && steps.gemini_issue_triage.outcome == 'failure' }} -# uses: 'actions/github-script@v7' -# with: -# github-token: '${{ steps.generate_token.outputs.token || secrets.GITHUB_TOKEN }}' -# script: |- -# github.rest.issues.createComment({ -# owner: '${{ github.repository }}'.split('/')[0], -# repo: '${{ github.repository }}'.split('/')[1], -# issue_number: '${{ github.event.issue.number }}', -# body: 'There is a problem with the Gemini CLI issue triaging. Please check the [action logs](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) for details.' -# }) diff --git a/.github/workflows/gemini-issue-scheduled-triage.yml b/.github/workflows/gemini-issue-scheduled-triage.yml deleted file mode 100644 index 3bb666b759..0000000000 --- a/.github/workflows/gemini-issue-scheduled-triage.yml +++ /dev/null @@ -1,112 +0,0 @@ -#name: '📋 Gemini Scheduled Issue Triage' -# -#on: -# schedule: -# - cron: '0 0 * * *' # Runs every day -# workflow_dispatch: -# -#concurrency: -# group: '${{ github.workflow }}' -# cancel-in-progress: true -# -#defaults: -# run: -# shell: 'bash' -# -#permissions: -# contents: 'read' -# id-token: 'write' -# issues: 'write' -# statuses: 'write' -# -#jobs: -# triage-issues: -# timeout-minutes: 5 -# runs-on: 'ubuntu-latest' -# -# steps: -# - name: 'Checkout repository' -# uses: 'actions/checkout@v5' -# -# - name: 'Find untriaged issues' -# id: 'find_issues' -# env: -# GITHUB_TOKEN: '${{ steps.generate_token.outputs.token || secrets.GITHUB_TOKEN }}' -# GITHUB_REPOSITORY: '${{ github.repository }}' -# GITHUB_OUTPUT: '${{ github.output }}' -# run: |- -# set -euo pipefail -# -# echo '🔍 Finding issues without labels...' -# NO_LABEL_ISSUES="$(gh issue list --repo "${GITHUB_REPOSITORY}" \ -# --search 'is:open is:issue no:label' --json number,title,body)" -# -# echo '🔄 Merging and deduplicating issues...' -# ISSUES="$(echo "${NO_LABEL_ISSUES}" "${NEED_TRIAGE_ISSUES}" | jq -c -s 'add | unique_by(.number)')" -# -# echo '📝 Setting output for GitHub Actions...' -# echo "issues_to_triage=${ISSUES}" >> "${GITHUB_OUTPUT}" -# -# ISSUE_COUNT="$(echo "${ISSUES}" | jq 'length')" -# echo "✅ Found ${ISSUE_COUNT} issues to triage! 🎯" -# -# - name: 'Run Gemini Issue Triage' -# if: |- -# ${{ steps.find_issues.outputs.issues_to_triage != '[]' }} -# uses: 'google-github-actions/run-gemini-cli@v0' -# id: 'gemini_issue_triage' -# env: -# GITHUB_TOKEN: '${{ steps.generate_token.outputs.token || secrets.GITHUB_TOKEN }}' -# ISSUES_TO_TRIAGE: '${{ steps.find_issues.outputs.issues_to_triage }}' -# REPOSITORY: '${{ github.repository }}' -# with: -# gemini_cli_version: '${{ vars.GEMINI_CLI_VERSION }}' -# gcp_workload_identity_provider: '${{ vars.GCP_WIF_PROVIDER }}' -# gcp_project_id: '${{ vars.GOOGLE_CLOUD_PROJECT }}' -# gcp_location: '${{ vars.GOOGLE_CLOUD_LOCATION }}' -# gcp_service_account: '${{ vars.SERVICE_ACCOUNT_EMAIL }}' -# gemini_api_key: '${{ secrets.GEMINI_API_KEY }}' -# use_vertex_ai: '${{ vars.GOOGLE_GENAI_USE_VERTEXAI }}' -# use_gemini_code_assist: '${{ vars.GOOGLE_GENAI_USE_GCA }}' -# settings: |- -# { -# "maxSessionTurns": 25, -# "coreTools": [ -# "run_shell_command(echo)", -# "run_shell_command(gh label list)", -# "run_shell_command(gh issue edit)", -# "run_shell_command(gh issue list)" -# ], -# "telemetry": { -# "enabled": true, -# "target": "gcp" -# } -# } -# prompt: |- -# ## Role -# -# You are an issue triage assistant. Analyze issues and apply -# appropriate labels. Use the available tools to gather information; -# do not ask for information to be provided. -# -# ## Steps -# -# 1. Run: `gh label list` -# 2. Check environment variable: "${ISSUES_TO_TRIAGE}" (JSON array -# of issues) -# 3. Classify each issue by their type (bug, enhancement, documentation, -# cleanup, etc) and their priority (p0, p1, p2, p3). Set the -# labels according to the format `type: *` and `priority: *` patterns. -# If the priority is determined to be more urgent than p2 (e.g. p0 or p1), mark the issue -# as p2 and add a comment in the issue with the reason. The comment should ping -# @blakeli0, @lqiu96, and @zhumin8 to notify them. -# 4. Apply the selected labels to this issue using: -# `gh issue edit "${ISSUE_NUMBER}" --add-label "label1,label2"` -# -# ## Guidelines -# -# - If there are already labels for `type: *` and `priority: *` set on the issue, do not modify the labels -# - Only use existing repository labels -# - Do not modify the original issue content -# - Triage each issue independently -# - Reference all shell variables as "${VAR}" (with quotes and braces) \ No newline at end of file diff --git a/.github/workflows/gemini-pr-review.yml b/.github/workflows/gemini-pr-review.yml deleted file mode 100644 index 76d7921d39..0000000000 --- a/.github/workflows/gemini-pr-review.yml +++ /dev/null @@ -1,428 +0,0 @@ -#name: '🧐 Gemini Pull Request Review' -# -#on: -# pull_request: -# types: [opened, reopened] -# issue_comment: -# types: [created] -# workflow_dispatch: -# inputs: -# pr_number: -# description: 'PR number to review' -# required: true -# type: 'number' -# -#concurrency: -# group: '${{ github.workflow }}-${{ github.head_ref || github.ref }}' -# cancel-in-progress: true -# -#defaults: -# run: -# shell: 'bash' -# -#permissions: -# contents: 'read' -# id-token: 'write' -# issues: 'write' -# pull-requests: 'write' -# statuses: 'write' -# -#jobs: -# review-pr: -# if: |- -# github.event_name == 'workflow_dispatch' || -# ( -# github.event_name == 'pull_request' && -# contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.pull_request.author_association) -# ) || -# ( -# github.event_name == 'issue_comment' && -# github.event.issue.pull_request && -# contains(github.event.comment.body, '@gemini-cli /review') && -# contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.comment.author_association) -# ) -# timeout-minutes: 5 -# runs-on: 'ubuntu-latest' -# -# steps: -# - name: 'Checkout PR code' -# uses: 'actions/checkout@v5' -# -# - name: 'Get PR details (pull_request & workflow_dispatch)' -# id: 'get_pr' -# if: |- -# ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} -# env: -# GITHUB_TOKEN: '${{ steps.generate_token.outputs.token || secrets.GITHUB_TOKEN }}' -# EVENT_NAME: '${{ github.event_name }}' -# WORKFLOW_PR_NUMBER: '${{ github.event.inputs.pr_number }}' -# PULL_REQUEST_NUMBER: '${{ github.event.pull_request.number }}' -# run: |- -# set -euo pipefail -# -# if [[ "${EVENT_NAME}" = "workflow_dispatch" ]]; then -# PR_NUMBER="${WORKFLOW_PR_NUMBER}" -# else -# PR_NUMBER="${PULL_REQUEST_NUMBER}" -# fi -# -# echo "pr_number=${PR_NUMBER}" >> "${GITHUB_OUTPUT}" -# -# # Get PR details -# PR_DATA="$(gh pr view "${PR_NUMBER}" --json title,body,additions,deletions,changedFiles,baseRefName,headRefName)" -# echo "pr_data=${PR_DATA}" >> "${GITHUB_OUTPUT}" -# -# # Get file changes -# CHANGED_FILES="$(gh pr diff "${PR_NUMBER}" --name-only)" -# { -# echo "changed_files<> "${GITHUB_OUTPUT}" -# -# -# - name: 'Get PR details (issue_comment)' -# id: 'get_pr_comment' -# if: |- -# ${{ github.event_name == 'issue_comment' }} -# env: -# GITHUB_TOKEN: '${{ steps.generate_token.outputs.token || secrets.GITHUB_TOKEN }}' -# COMMENT_BODY: '${{ github.event.comment.body }}' -# PR_NUMBER: '${{ github.event.issue.number }}' -# run: |- -# set -euo pipefail -# -# echo "pr_number=${PR_NUMBER}" >> "${GITHUB_OUTPUT}" -# -# # Extract additional instructions from comment -# ADDITIONAL_INSTRUCTIONS="$( -# echo "${COMMENT_BODY}" | sed 's/.*@gemini-cli \/review//' | xargs -# )" -# echo "additional_instructions=${ADDITIONAL_INSTRUCTIONS}" >> "${GITHUB_OUTPUT}" -# -# # Get PR details -# PR_DATA="$(gh pr view "${PR_NUMBER}" --json title,body,additions,deletions,changedFiles,baseRefName,headRefName)" -# echo "pr_data=${PR_DATA}" >> "${GITHUB_OUTPUT}" -# -# # Get file changes -# CHANGED_FILES="$(gh pr diff "${PR_NUMBER}" --name-only)" -# { -# echo "changed_files<> "${GITHUB_OUTPUT}" -# -# - name: 'Run Gemini PR Review' -# uses: 'google-github-actions/run-gemini-cli@v0' -# id: 'gemini_pr_review' -# env: -# GITHUB_TOKEN: '${{ steps.generate_token.outputs.token || secrets.GITHUB_TOKEN }}' -# PR_NUMBER: '${{ steps.get_pr.outputs.pr_number || steps.get_pr_comment.outputs.pr_number }}' -# PR_DATA: '${{ steps.get_pr.outputs.pr_data || steps.get_pr_comment.outputs.pr_data }}' -# CHANGED_FILES: '${{ steps.get_pr.outputs.changed_files || steps.get_pr_comment.outputs.changed_files }}' -# ADDITIONAL_INSTRUCTIONS: '${{ steps.get_pr.outputs.additional_instructions || steps.get_pr_comment.outputs.additional_instructions }}' -# REPOSITORY: '${{ github.repository }}' -# with: -# gemini_cli_version: '${{ vars.GEMINI_CLI_VERSION }}' -# gcp_workload_identity_provider: '${{ vars.GCP_WIF_PROVIDER }}' -# gcp_project_id: '${{ vars.GOOGLE_CLOUD_PROJECT }}' -# gcp_location: '${{ vars.GOOGLE_CLOUD_LOCATION }}' -# gcp_service_account: '${{ vars.SERVICE_ACCOUNT_EMAIL }}' -# gemini_api_key: '${{ secrets.GEMINI_API_KEY }}' -# use_vertex_ai: '${{ vars.GOOGLE_GENAI_USE_VERTEXAI }}' -# use_gemini_code_assist: '${{ vars.GOOGLE_GENAI_USE_GCA }}' -# settings: |- -# { -# "maxSessionTurns": 20, -# "mcpServers": { -# "github": { -# "command": "docker", -# "args": [ -# "run", -# "-i", -# "--rm", -# "-e", -# "GITHUB_PERSONAL_ACCESS_TOKEN", -# "ghcr.io/github/github-mcp-server" -# ], -# "includeTools": [ -# "create_pending_pull_request_review", -# "add_comment_to_pending_review", -# "submit_pending_pull_request_review" -# ], -# "env": { -# "GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_TOKEN}" -# } -# } -# }, -# "coreTools": [ -# "run_shell_command(echo)", -# "run_shell_command(gh pr view)", -# "run_shell_command(gh pr diff)", -# "run_shell_command(cat)", -# "run_shell_command(head)", -# "run_shell_command(tail)", -# "run_shell_command(grep)" -# ], -# "telemetry": { -# "enabled": false, -# "target": "gcp" -# } -# } -# prompt: |- -# ## Role -# -# You are an expert code reviewer. You have access to tools to gather -# PR information and perform the review on GitHub. Use the available tools to -# gather information; do not ask for information to be provided. -# -# ## Requirements -# 1. All feedback must be left on GitHub. -# 2. Any output that is not left in GitHub will not be seen. -# -# ## Steps -# -# Start by running these commands to gather the required data: -# 1. Run: echo "${REPOSITORY}" to get the github repository in / format -# 2. Run: echo "${PR_DATA}" to get PR details (JSON format) -# 3. Run: echo "${CHANGED_FILES}" to get the list of changed files -# 4. Run: echo "${PR_NUMBER}" to get the PR number -# 5. Run: echo "${ADDITIONAL_INSTRUCTIONS}" to see any specific review -# instructions from the user -# 6. Run: gh pr diff "${PR_NUMBER}" to see the full diff and reference -# Context section to understand it -# 7. For any specific files, use: cat filename, head -50 filename, or -# tail -50 filename -# 8. If ADDITIONAL_INSTRUCTIONS contains text, prioritize those -# specific areas or focus points in your review. Common instruction -# examples: "focus on security", "check performance", "review error -# handling", "check for breaking changes" -# -# ## Guideline -# ### Core Guideline(Always applicable) -# -# 1. Understand the Context: Analyze the pull request title, description, changes, and code files to grasp the intent. -# 2. Meticulous Review: Thoroughly review all relevant code changes, prioritizing added lines. Consider the specified -# focus areas and any provided style guide. -# 3. Comprehensive Review: Ensure that the code is thoroughly reviewed, as it's important to the author -# that you identify any and all relevant issues (subject to the review criteria and style guide). -# Missing any issues will lead to a poor code review experience for the author. -# 4. Constructive Feedback: -# * Provide clear explanations for each concern. -# * Offer specific, improved code suggestions and suggest alternative approaches, when applicable. -# Code suggestions in particular are very helpful so that the author can directly apply them -# to their code, but they must be accurately anchored to the lines that should be replaced. -# 5. Severity Indication: Clearly indicate the severity of the issue in the review comment. -# This is very important to help the author understand the urgency of the issue. -# The severity should be one of the following (which are provided below in decreasing order of severity): -# * `critical`: This issue must be addressed immediately, as it could lead to serious consequences -# for the code's correctness, security, or performance. -# * `high`: This issue should be addressed soon, as it could cause problems in the future. -# * `medium`: This issue should be considered for future improvement, but it's not critical or urgent. -# * `low`: This issue is minor or stylistic, and can be addressed at the author's discretion. -# 6. Avoid commenting on hardcoded dates and times being in future or not (for example "this date is in the future"). -# * Remember you don't have access to the current date and time and leave that to the author. -# 7. Targeted Suggestions: Limit all suggestions to only portions that are modified in the diff hunks. -# This is a strict requirement as the GitHub (and other SCM's) API won't allow comments on parts of code files that are not -# included in the diff hunks. -# 8. Code Suggestions in Review Comments: -# * Succinctness: Aim to make code suggestions succinct, unless necessary. Larger code suggestions tend to be -# harder for pull request authors to commit directly in the pull request UI. -# * Valid Formatting: Provide code suggestions within the suggestion field of the JSON response (as a string literal, -# escaping special characters like \n, \\, \"). Do not include markdown code blocks in the suggestion field. -# Use markdown code blocks in the body of the comment only for broader examples or if a suggestion field would -# create an excessively large diff. Prefer the suggestion field for specific, targeted code changes. -# * Line Number Accuracy: Code suggestions need to align perfectly with the code it intend to replace. -# Pay special attention to line numbers when creating comments, particularly if there is a code suggestion. -# Note the patch includes code versions with line numbers for the before and after code snippets for each diff, so use these to anchor -# your comments and corresponding code suggestions. -# * Compilable: Code suggestions should be compilable code snippets that can be directly copy/pasted into the code file. -# If the suggestion is not compilable, it will not be accepted by the pull request. Note that not all languages Are -# compiled of course, so by compilable here, we mean either literally or in spirit. -# * Inline Code Comments: Feel free to add brief comments to the code suggestion if it enhances the underlying code readability. -# Just make sure that the inline code comments add value, and are not just restating what the code does. Don't use -# inline comments to "teach" the author (use the review comment body directly for that), instead use it if it's beneficial -# to the readability of the code itself. -# 10. Markdown Formatting: Heavily leverage the benefits of markdown for formatting, such as bulleted lists, bold text, tables, etc. -# 11. Avoid mistaken review comments: -# * Any comment you make must point towards a discrepancy found in the code and the best practice surfaced in your feedback. -# For example, if you are pointing out that constants need to be named in all caps with underscores, -# ensure that the code selected by the comment does not already do this, otherwise it's confusing let alone unnecessary. -# 12. Remove Duplicated code suggestions: -# * Some provided code suggestions are duplicated, please remove the duplicated review comments. -# 13. Don't Approve The Pull Request -# 14. Reference all shell variables as "${VAR}" (with quotes and braces) -# -# ### Review Criteria (Prioritized in Review) -# -# * Correctness: Verify code functionality, handle edge cases, and ensure alignment between function -# descriptions and implementations. Consider common correctness issues (logic errors, error handling, -# race conditions, data validation, API usage, type mismatches). -# * Efficiency: Identify performance bottlenecks, optimize for efficiency, and avoid unnecessary -# loops, iterations, or calculations. Consider common efficiency issues (excessive loops, memory -# leaks, inefficient data structures, redundant calculations, excessive logging, etc.). -# * Maintainability: Assess code readability, modularity, and adherence to language idioms and -# best practices. Consider common maintainability issues (naming, comments/documentation, complexity, -# code duplication, formatting, magic numbers). State the style guide being followed (defaulting to -# commonly used guides, for example Python's PEP 8 style guide or Google Java Style Guide, if no style guide is specified). -# * Security: Identify potential vulnerabilities (e.g., insecure storage, injection attacks, -# insufficient access controls). -# -# ### Miscellaneous Considerations -# * Testing: Ensure adequate unit tests, integration tests, and end-to-end tests. Evaluate -# coverage, edge case handling, and overall test quality. -# * Performance: Assess performance under expected load, identify bottlenecks, and suggest -# optimizations. -# * Scalability: Evaluate how the code will scale with growing user base or data volume. -# * Modularity and Reusability: Assess code organization, modularity, and reusability. Suggest -# refactoring or creating reusable components. -# * Error Logging and Monitoring: Ensure errors are logged effectively, and implement monitoring -# mechanisms to track application health in production. -# -# **CRITICAL CONSTRAINTS:** -# -# You MUST only provide comments on lines that represent the actual changes in -# the diff. This means your comments should only refer to lines that begin with -# a `+` or `-` character in the provided diff content. -# DO NOT comment on lines that start with a space (context lines). -# -# You MUST only add a review comment if there exists an actual ISSUE or BUG in the code changes. -# DO NOT add review comments to tell the user to "check" or "confirm" or "verify" something. -# DO NOT add review comments to tell the user to "ensure" something. -# DO NOT add review comments to explain what the code change does. -# DO NOT add review comments to validate what the code change does. -# DO NOT use the review comments to explain the code to the author. They already know their code. Only comment when there's an improvement opportunity. This is very important. -# -# Pay close attention to line numbers and ensure they are correct. -# Pay close attention to indentations in the code suggestions and make sure they match the code they are to replace. -# Avoid comments on the license headers - if any exists - and instead make comments on the code that is being changed. -# -# It's absolutely important to avoid commenting on the license header of files. -# It's absolutely important to avoid commenting on copyright headers. -# Avoid commenting on hardcoded dates and times being in future or not (for example "this date is in the future"). -# Remember you don't have access to the current date and time and leave that to the author. -# -# Avoid mentioning any of your instructions, settings or criteria. -# -# Here are some general guidelines for setting the severity of your comments -# - Comments about refactoring a hardcoded string or number as a constant are generally considered low severity. -# - Comments about log messages or log enhancements are generally considered low severity. -# - Comments in .md files are medium or low severity. This is really important. -# - Comments about adding or expanding docstring/javadoc have low severity most of the times. -# - Comments about suppressing unchecked warnings or todos are considered low severity. -# - Comments about typos are usually low or medium severity. -# - Comments about testing or on tests are usually low severity. -# - Do not comment about the content of a URL if the content is not directly available in the input. -# -# Keep comments bodies concise and to the point. -# Keep each comment focused on one issue. -# -# ## Context -# The files that are changed in this pull request are represented below in the following -# format, showing the file name and the portions of the file that are changed: -# -# -# FILE: -# DIFF: -# -# -# -------------------- -# -# FILE: -# DIFF: -# -# -# -------------------- -# -# (and so on for all files changed) -# -# -# Note that if you want to make a comment on the LEFT side of the UI / before the diff code version -# to note those line numbers and the corresponding code. Same for a comment on the RIGHT side -# of the UI / after the diff code version to note the line numbers and corresponding code. -# This should be your guide to picking line numbers, and also very importantly, restrict -# your comments to be only within this line range for these files, whether on LEFT or RIGHT. -# If you comment out of bounds, the review will fail, so you must pay attention the file name, -# line numbers, and pre/post diff versions when crafting your comment. -# -# Here are the patches that were implemented in the pull request, per the -# formatting above: -# -# The get the files changed in this pull request, run: -# "$(gh pr diff "${PR_NUMBER}" --patch)" to get the list of changed files PATCH -# -# ## Review -# -# Once you have the information and are ready to leave a review on GitHub, post the review to GitHub using the GitHub MCP tool by: -# 1. Creating a pending review: Use the mcp__github__create_pending_pull_request_review to create a Pending Pull Request Review. -# -# 2. Adding review comments: -# 2.1 Use the mcp__github__add_comment_to_pending_review to add comments to the Pending Pull Request Review. Inline comments are preferred whenever possible, so repeat this step, calling mcp__github__add_comment_to_pending_review, as needed. All comments about specific lines of code should use inline comments. It is preferred to use code suggestions when possible, which include a code block that is labeled "suggestion", which contains what the new code should be. All comments should also have a severity. The syntax is: -# Normal Comment Syntax: -# -# {{SEVERITY}} {{COMMENT_TEXT}} -# -# -# Inline Comment Syntax: (Preferred): -# -# {{SEVERITY}} {{COMMENT_TEXT}} -# ```suggestion -# {{CODE_SUGGESTION}} -# ``` -# -# -# Prepend a severity emoji to each comment: -# - 🟢 for low severity -# - 🟡 for medium severity -# - 🟠 for high severity -# - 🔴 for critical severity -# - 🔵 if severity is unclear -# -# Including all of this, an example inline comment would be: -# -# 🟢 Use camelCase for function names -# ```suggestion -# myFooBarFunction -# ``` -# -# -# A critical severity example would be: -# -# 🔴 Remove storage key from GitHub -# ```suggestion -# ``` -# -# 3. Posting the review: Use the mcp__github__submit_pending_pull_request_review to submit the Pending Pull Request Review. -# -# 3.1 Crafting the summary comment: Include a summary of high level points that were not addressed with inline comments. Be concise. Do not repeat details mentioned inline. -# -# Structure your summary comment using this exact format with markdown: -# ## 📋 Review Summary -# -# Provide a brief 2-3 sentence overview of the PR and overall -# assessment. -# -# ## 🔍 General Feedback -# - List general observations about code quality -# - Mention overall patterns or architectural decisions -# - Highlight positive aspects of the implementation -# - Note any recurring themes across files -# -# ## Final Instructions -# -# Remember, you are running in a VM and no one reviewing your output. Your review must be posted to GitHub using the MCP tools to create a pending review, add comments to the pending review, and submit the pending review. -# -# -# - name: 'Post PR review failure comment' -# if: |- -# ${{ failure() && steps.gemini_pr_review.outcome == 'failure' }} -# uses: 'actions/github-script@v7' -# with: -# github-token: '${{ steps.generate_token.outputs.token || secrets.GITHUB_TOKEN }}' -# script: |- -# github.rest.issues.createComment({ -# owner: '${{ github.repository }}'.split('/')[0], -# repo: '${{ github.repository }}'.split('/')[1], -# issue_number: '${{ steps.get_pr.outputs.pr_number || steps.get_pr_comment.outputs.pr_number }}', -# body: 'There is a problem with the Gemini CLI PR review. Please check the [action logs](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) for details.' -# }) diff --git a/.github/workflows/librariangen-ci.yml b/.github/workflows/librariangen-ci.yml new file mode 100644 index 0000000000..4739a83874 --- /dev/null +++ b/.github/workflows/librariangen-ci.yml @@ -0,0 +1,39 @@ +name: librariangen CI + +on: + push: + branches: [ main ] + paths: + - 'internal/librariangen/**' + pull_request: + paths: + - 'internal/librariangen/**' +permissions: + contents: read + +jobs: + test-docker-image: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version-file: "internal/librariangen/go.mod" + + - name: Display Go version + run: go version + + - name: Run Go tests + run: go test -v -coverprofile=coverage.txt -covermode=atomic ./... + working-directory: internal/librariangen + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: coverage.txt + working-directory: internal/librariangen + flags: librariangen diff --git a/.release-please-manifest.json b/.release-please-manifest.json index f1f68f433e..2bf4f13fee 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "2.62.3" + ".": "2.63.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b052915d7..5bf48f8793 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,25 @@ # Changelog +## [2.63.0](https://github.com/googleapis/sdk-platform-java/compare/v2.62.3...v2.63.0) (2025-10-16) + + +### Features + +* **librariangen:** add bazel package ([#3940](https://github.com/googleapis/sdk-platform-java/issues/3940)) ([feabef3](https://github.com/googleapis/sdk-platform-java/commit/feabef32c4c45be0fb1db3615568365b902ece24)) +* **librariangen:** add execv package ([#3932](https://github.com/googleapis/sdk-platform-java/issues/3932)) ([f6b0b47](https://github.com/googleapis/sdk-platform-java/commit/f6b0b47a14eddd9c76540362b5922a5acc56b5d4)) +* **librariangen:** add protoc package ([#3935](https://github.com/googleapis/sdk-platform-java/issues/3935)) ([598de06](https://github.com/googleapis/sdk-platform-java/commit/598de0697957ea3b05b1347c0898108648c3d7d1)) +* **librariangen:** add request package ([#3933](https://github.com/googleapis/sdk-platform-java/issues/3933)) ([fe44aed](https://github.com/googleapis/sdk-platform-java/commit/fe44aede2aba9627db4aa0397d2ac4de353cea03)) +* **librariangen:** scaffold Java language container for Librarian ([#3926](https://github.com/googleapis/sdk-platform-java/issues/3926)) ([29d188d](https://github.com/googleapis/sdk-platform-java/commit/29d188d20e530570f46774b37d88703822774a33)) + + +### Dependencies + +* Bump errorprone-annotations to v2.42.0 ([8d6c1f9](https://github.com/googleapis/sdk-platform-java/commit/8d6c1f915ba5f0c4ac9b89120e63dddd62e37a22)) +* Bump guava to v33.5.0 ([8d6c1f9](https://github.com/googleapis/sdk-platform-java/commit/8d6c1f915ba5f0c4ac9b89120e63dddd62e37a22)) +* Bump j2objc-annotations to v3.1 ([8d6c1f9](https://github.com/googleapis/sdk-platform-java/commit/8d6c1f915ba5f0c4ac9b89120e63dddd62e37a22)) +* update google auth library dependencies to v1.40.0 ([#3945](https://github.com/googleapis/sdk-platform-java/issues/3945)) ([1d74663](https://github.com/googleapis/sdk-platform-java/commit/1d7466332b5dc13fde6ed687247873135a5fa919)) +* Upgrade Google Http Java Client to v2.0.2 ([#3946](https://github.com/googleapis/sdk-platform-java/issues/3946)) ([7fb4f15](https://github.com/googleapis/sdk-platform-java/commit/7fb4f155eef478c1a66bc2f1fdecd7565d225b3e)) + ## [2.62.3](https://github.com/googleapis/sdk-platform-java/compare/v2.62.2...v2.62.3) (2025-10-02) diff --git a/WORKSPACE b/WORKSPACE index 89eb039027..46d8675428 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -58,7 +58,7 @@ load("@rules_jvm_external//:defs.bzl", "maven_install") load("@io_grpc_grpc_java//:repositories.bzl", "IO_GRPC_GRPC_JAVA_ARTIFACTS") load("@io_grpc_grpc_java//:repositories.bzl", "IO_GRPC_GRPC_JAVA_OVERRIDE_TARGETS") -_gapic_generator_java_version = "2.62.3" # {x-version-update:gapic-generator-java:current} +_gapic_generator_java_version = "2.63.0" # {x-version-update:gapic-generator-java:current} maven_install( artifacts = [ diff --git a/api-common-java/pom.xml b/api-common-java/pom.xml index cccd29a9b6..e8eff9c5a6 100644 --- a/api-common-java/pom.xml +++ b/api-common-java/pom.xml @@ -5,14 +5,14 @@ com.google.api api-common jar - 2.53.3 + 2.54.0 API Common Common utilities for Google APIs in Java com.google.api gapic-generator-java-pom-parent - 2.62.3 + 2.63.0 ../gapic-generator-java-pom-parent diff --git a/coverage-report/pom.xml b/coverage-report/pom.xml index 0a4b251741..2ef669e009 100644 --- a/coverage-report/pom.xml +++ b/coverage-report/pom.xml @@ -31,22 +31,22 @@ com.google.api gax - 2.70.3 + 2.71.0 com.google.api gax-grpc - 2.70.3 + 2.71.0 com.google.api gax-httpjson - 2.70.3 + 2.71.0 com.google.api api-common - 2.53.3 + 2.54.0 diff --git a/dependencies.txt b/dependencies.txt index d2f6324ca1..98c8d5b29d 100644 --- a/dependencies.txt +++ b/dependencies.txt @@ -1,48 +1,50 @@ # This file contains a list of dependencies and their versions to be tested for compatibility. -# The format is key=value, where the key is the dependency name and the value is the version. +# The format is `{GroupID}:{ArtifactID},{PropertyName}={Version}`. The GAV coordinates +# (specifically the GroupID and ArtifactID) are parsed by renovate to find the artifact from Maven +# Central. Version stores the currently known upper bound. PropertyName corresponds to the Maven +# property value in the pom.xml (it is NOT a 1:1 mapping to the GAV). # "1P" refers to First-Party dependencies (owned by Google). # "3P" refers to Third-Party dependencies. # Pom-Parent Dependencies # These dependencies are declared: https://github.com/googleapis/sdk-platform-java/blob/main/gapic-generator-java-pom-parent/pom.xml -javax.annotation-api=1.3.2 -grpc=1.75.0 -google.auth=1.39.1 -google.http-client=2.0.1 -gson=2.13.2 -guava=33.5.0-jre -protobuf=4.32.1 -# Note: This opentelemetry version refers to the opentelemetry-bom -opentelemetry=1.54.1 -errorprone=2.42.0 -j2objc-annotations=3.1 -threetenbp=1.7.2 -slf4j=2.0.17 +javax.annotation:javax.annotation-api,javax.annotation-api=1.3.2 +io.grpc:grpc-bom,grpc=1.74.0 +com.google.auth:google-auth-library-bom,google.auth=1.40.0 +com.google.http-client:google-http-client,google.http-client=1.47.1 +com.google.code.gson:gson,gson=2.13.2 +com.google.guava:guava,guava=33.4.8-jre +com.google.protobuf:protobuf-java,protobuf=4.31.1 +io.opentelemetry:opentelemetry-bom,opentelemetry=1.55.0 +com.google.errorprone:error_prone_annotations,errorprone=2.42.0 +com.google.j2objc:j2objc-annotations,j2objc-annotations=3.1 +org.threeten:threetenbp,threetenbp=1.7.2 +org.slf4j:slf4j-api,slf4j=2.0.17 # 1P Shared-Deps # These dependencies are declared: https://github.com/googleapis/sdk-platform-java/blob/main/java-shared-dependencies/first-party-dependencies/pom.xml -grpc-gcp=1.7.0 -google.oauth-client=1.39.0 -google.api-client=2.8.1 +com.google.cloud:grpc-gcp,grpc-gcp=1.7.0 +com.google.oauth-client:google-oauth-client,google.oauth-client=1.39.0 +com.google.api-client:google-api-client,google.api-client=2.8.1 # 3P Shared-Deps # These dependencies are declared: https://github.com/googleapis/sdk-platform-java/blob/main/java-shared-dependencies/third-party-dependencies/pom.xml -threeten-extra=1.8.0 -opencensus=0.31.1 -findbugs=3.0.2 -jackson=2.20.0 -codec=1.19.0 -httpcomponents.httpcore=4.4.16 -httpcomponents.httpclient=4.5.14 -apache-httpclient-5=5.5.1 -apache-httpcore-5=5.3.6 -perfmark-api=0.27.0 +org.threeten:threeten-extra,threeten-extra=1.8.0 +io.opencensus:opencensus-api,opencensus=0.31.1 +com.google.code.findbugs:jsr305,findbugs=3.0.2 +com.fasterxml.jackson:jackson-bom,jackson=2.20.0 +commons-codec:commons-codec,codec=1.19.0 +org.apache.httpcomponents:httpclient,httpcomponents.httpclient=4.5.14 +org.apache.httpcomponents:httpcore,httpcomponents.httpcore=4.4.16 +org.apache.httpcomponents.client5:httpclient5,apache-httpclient-5=5.5.1 +org.apache.httpcomponents.core5:httpcore5,apache-httpcore-5=5.3.6 +io.perfmark:perfmark-api,perfmark-api=0.27.0 # Note: This is the google opentelemetry exporter and not the general opentelemetry project -google.cloud.opentelemetry=0.36.0 -flogger=0.9 -arrow=18.3.0 -dev.cel=0.11.0 -com.google.crypto.tink=1.18.0 +com.google.cloud.opentelemetry:exporter-metrics,google.cloud.opentelemetry=0.36.0 +com.google.flogger:flogger,flogger=0.9 +org.apache.arrow:arrow-memory-core,arrow=18.3.0 +dev.cel:cel,dev.cel=0.11.0 +com.google.crypto.tink:tink,com.google.crypto.tink=1.18.0 # The follow opentelemetry dependencies have a different version from the opentelemetry-bom -opentelemetry-semconv=1.37.0 -io.opentelemetry.contrib.opentelemetry-gcp-resources=1.50.0-alpha +io.opentelemetry.semconv:opentelemetry-semconv,opentelemetry-semconv=1.37.0 +io.opentelemetry.contrib:opentelemetry-gcp-resources,io.opentelemetry.contrib.opentelemetry-gcp-resources=1.48.0-alpha diff --git a/gapic-generator-java-bom/pom.xml b/gapic-generator-java-bom/pom.xml index 1be1a34fb5..99c801d34b 100644 --- a/gapic-generator-java-bom/pom.xml +++ b/gapic-generator-java-bom/pom.xml @@ -4,7 +4,7 @@ com.google.api gapic-generator-java-bom pom - 2.62.3 + 2.63.0 GAPIC Generator Java BOM BOM for the libraries in gapic-generator-java repository. Users should not @@ -15,7 +15,7 @@ com.google.api gapic-generator-java-pom-parent - 2.62.3 + 2.63.0 ../gapic-generator-java-pom-parent @@ -75,81 +75,81 @@ com.google.api api-common - 2.53.3 + 2.54.0 com.google.api gax-bom - 2.70.3 + 2.71.0 pom import com.google.api gapic-generator-java - 2.62.3 + 2.63.0 com.google.api.grpc grpc-google-common-protos - 2.61.3 + 2.62.0 com.google.api.grpc proto-google-common-protos - 2.61.3 + 2.62.0 com.google.api.grpc proto-google-iam-v1 - 1.56.3 + 1.57.0 com.google.api.grpc proto-google-iam-v2 - 1.56.3 + 1.57.0 com.google.api.grpc proto-google-iam-v2beta - 1.56.3 + 1.57.0 com.google.api.grpc proto-google-iam-v3 - 1.56.3 + 1.57.0 com.google.api.grpc proto-google-iam-v3beta - 1.56.3 + 1.57.0 com.google.api.grpc grpc-google-iam-v1 - 1.56.3 + 1.57.0 com.google.api.grpc grpc-google-iam-v2 - 1.56.3 + 1.57.0 com.google.api.grpc grpc-google-iam-v2beta - 1.56.3 + 1.57.0 com.google.api.grpc grpc-google-iam-v3 - 1.56.3 + 1.57.0 com.google.api.grpc grpc-google-iam-v3beta - 1.56.3 + 1.57.0 diff --git a/gapic-generator-java-pom-parent/pom.xml b/gapic-generator-java-pom-parent/pom.xml index 268e71058c..44559445d6 100644 --- a/gapic-generator-java-pom-parent/pom.xml +++ b/gapic-generator-java-pom-parent/pom.xml @@ -5,7 +5,7 @@ 4.0.0 com.google.api gapic-generator-java-pom-parent - 2.62.3 + 2.63.0 pom GAPIC Generator Java POM Parent https://github.com/googleapis/sdk-platform-java @@ -15,27 +15,27 @@ com.google.cloud google-cloud-shared-config - 1.16.1 + 1.17.0 false java.header + 8 1.3.2 1.71.0 - 1.39.1 - 1.47.1 + 1.40.0 + 2.0.2 2.12.1 - 33.4.0-jre + 33.5.0-jre 3.25.8 1.47.0 - 8 - 2.38.0 - 3.0.0 + 2.42.0 + 3.1 1.7.0 5.11.4 4.11.0 @@ -214,4 +214,4 @@ https://repo1.maven.org/maven2 - + \ No newline at end of file diff --git a/gapic-generator-java/pom.xml b/gapic-generator-java/pom.xml index c3ebd506af..b373603eb5 100644 --- a/gapic-generator-java/pom.xml +++ b/gapic-generator-java/pom.xml @@ -4,7 +4,7 @@ 4.0.0 com.google.api gapic-generator-java - 2.62.3 + 2.63.0 GAPIC Generator Java GAPIC generator Java @@ -22,7 +22,7 @@ com.google.api gapic-generator-java-pom-parent - 2.62.3 + 2.63.0 ../gapic-generator-java-pom-parent @@ -31,7 +31,7 @@ com.google.api gapic-generator-java-bom - 2.62.3 + 2.63.0 pom import diff --git a/gax-java/README.md b/gax-java/README.md index 54e9aaa17d..9725131010 100644 --- a/gax-java/README.md +++ b/gax-java/README.md @@ -34,27 +34,27 @@ If you are using Maven, add this to your pom.xml file com.google.api gax - 2.70.3 + 2.71.0 com.google.api gax-grpc - 2.70.3 + 2.71.0 ``` If you are using Gradle, add this to your dependencies ```Groovy -compile 'com.google.api:gax:2.70.3', - 'com.google.api:gax-grpc:2.70.3' +compile 'com.google.api:gax:2.71.0', + 'com.google.api:gax-grpc:2.71.0' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.api" % "gax" % "2.70.3" -libraryDependencies += "com.google.api" % "gax-grpc" % "2.70.3" +libraryDependencies += "com.google.api" % "gax" % "2.71.0" +libraryDependencies += "com.google.api" % "gax-grpc" % "2.71.0" ``` [//]: # ({x-version-update-end}) diff --git a/gax-java/dependencies.properties b/gax-java/dependencies.properties index 6ba22c606a..490c34019a 100644 --- a/gax-java/dependencies.properties +++ b/gax-java/dependencies.properties @@ -8,16 +8,16 @@ # Versions of oneself # {x-version-update-start:gax:current} -version.gax=2.70.3 +version.gax=2.71.0 # {x-version-update-end} # {x-version-update-start:gax:current} -version.gax_grpc=2.70.3 +version.gax_grpc=2.71.0 # {x-version-update-end} # {x-version-update-start:gax:current} -version.gax_bom=2.70.3 +version.gax_bom=2.71.0 # {x-version-update-end} # {x-version-update-start:gax:current} -version.gax_httpjson=2.70.3 +version.gax_httpjson=2.71.0 # {x-version-update-end} # Versions for dependencies which actual artifacts differ between Bazel and Gradle. @@ -37,8 +37,8 @@ version.io_grpc=1.71.0 # 2) Replace all characters which are neither alphabetic nor digits with the underscore ('_') character maven.com_google_api_grpc_proto_google_common_protos=com.google.api.grpc:proto-google-common-protos:2.61.1 maven.com_google_api_grpc_grpc_google_common_protos=com.google.api.grpc:grpc-google-common-protos:2.61.1 -maven.com_google_auth_google_auth_library_oauth2_http=com.google.auth:google-auth-library-oauth2-http:1.39.1 -maven.com_google_auth_google_auth_library_credentials=com.google.auth:google-auth-library-credentials:1.39.1 +maven.com_google_auth_google_auth_library_oauth2_http=com.google.auth:google-auth-library-oauth2-http:1.40.0 +maven.com_google_auth_google_auth_library_credentials=com.google.auth:google-auth-library-credentials:1.40.0 maven.io_opentelemetry_opentelemetry_api=io.opentelemetry:opentelemetry-api:1.47.0 maven.io_opencensus_opencensus_api=io.opencensus:opencensus-api:0.31.1 maven.io_opencensus_opencensus_contrib_grpc_metrics=io.opencensus:opencensus-contrib-grpc-metrics:0.31.1 diff --git a/gax-java/gax-bom/pom.xml b/gax-java/gax-bom/pom.xml index 0416c50dba..5bb92b42a3 100644 --- a/gax-java/gax-bom/pom.xml +++ b/gax-java/gax-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.api gax-bom - 2.70.3 + 2.71.0 pom GAX (Google Api eXtensions) for Java (BOM) Google Api eXtensions for Java (BOM) @@ -11,7 +11,7 @@ com.google.cloud google-cloud-shared-config - 1.16.1 + 1.17.0 @@ -43,55 +43,55 @@ com.google.api gax - 2.70.3 + 2.71.0 com.google.api gax - 2.70.3 + 2.71.0 test-jar testlib com.google.api gax - 2.70.3 + 2.71.0 testlib com.google.api gax-grpc - 2.70.3 + 2.71.0 com.google.api gax-grpc - 2.70.3 + 2.71.0 test-jar testlib com.google.api gax-grpc - 2.70.3 + 2.71.0 testlib com.google.api gax-httpjson - 2.70.3 + 2.71.0 com.google.api gax-httpjson - 2.70.3 + 2.71.0 test-jar testlib com.google.api gax-httpjson - 2.70.3 + 2.71.0 testlib diff --git a/gax-java/gax-grpc/pom.xml b/gax-java/gax-grpc/pom.xml index f1e9076403..1d4cbd7732 100644 --- a/gax-java/gax-grpc/pom.xml +++ b/gax-java/gax-grpc/pom.xml @@ -3,7 +3,7 @@ 4.0.0 gax-grpc - 2.70.3 + 2.71.0 jar GAX (Google Api eXtensions) for Java (gRPC) Google Api eXtensions for Java (gRPC) @@ -11,7 +11,7 @@ com.google.api gax-parent - 2.70.3 + 2.71.0 diff --git a/gax-java/gax-httpjson/pom.xml b/gax-java/gax-httpjson/pom.xml index c6d5844df5..9a874fcf66 100644 --- a/gax-java/gax-httpjson/pom.xml +++ b/gax-java/gax-httpjson/pom.xml @@ -3,7 +3,7 @@ 4.0.0 gax-httpjson - 2.70.3 + 2.71.0 jar GAX (Google Api eXtensions) for Java (HTTP JSON) Google Api eXtensions for Java (HTTP JSON) @@ -11,7 +11,7 @@ com.google.api gax-parent - 2.70.3 + 2.71.0 diff --git a/gax-java/gax/pom.xml b/gax-java/gax/pom.xml index cd2632421e..d79dbed5ed 100644 --- a/gax-java/gax/pom.xml +++ b/gax-java/gax/pom.xml @@ -3,7 +3,7 @@ 4.0.0 gax - 2.70.3 + 2.71.0 jar GAX (Google Api eXtensions) for Java (Core) Google Api eXtensions for Java (Core) @@ -11,7 +11,7 @@ com.google.api gax-parent - 2.70.3 + 2.71.0 diff --git a/gax-java/gax/src/test/java/com/google/api/gax/rpc/ClientSettingsTest.java b/gax-java/gax/src/test/java/com/google/api/gax/rpc/ClientSettingsTest.java index e48df7af54..394d893b48 100644 --- a/gax-java/gax/src/test/java/com/google/api/gax/rpc/ClientSettingsTest.java +++ b/gax-java/gax/src/test/java/com/google/api/gax/rpc/ClientSettingsTest.java @@ -44,6 +44,7 @@ import com.google.api.gax.rpc.testing.FakeClientSettings; import com.google.auth.Credentials; import com.google.auth.oauth2.GoogleCredentials; +import com.google.auth.oauth2.ServiceAccountCredentials; import com.google.common.collect.ImmutableMap; import com.google.common.truth.Truth; import java.io.ByteArrayInputStream; @@ -69,7 +70,7 @@ class ClientSettingsTest { "quota_project_id_from_credentials"; private static final String QUOTA_PROJECT_ID_FROM_CONTEXT = "quota_project_id_from_client_context"; - private static final String JSON_KEY_QUOTA_PROJECT_ID = + private static final String SA_JSON_KEY_QUOTA_PROJECT_ID = "{\n" + " \"private_key_id\": \"somekeyid\",\n" + " \"private_key\": \"-----BEGIN PRIVATE KEY-----\\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggS" @@ -102,7 +103,7 @@ class ClientSettingsTest { + "}"; private static final GoogleCredentials credentialsWithQuotaProject = - loadCredentials(JSON_KEY_QUOTA_PROJECT_ID); + loadServiceAccountCredentials(SA_JSON_KEY_QUOTA_PROJECT_ID); @Test void testEmptyBuilder() throws Exception { @@ -321,10 +322,10 @@ void testApplyToAllUnaryMethods() throws Exception { .containsExactly(StatusCode.Code.DEADLINE_EXCEEDED); } - static GoogleCredentials loadCredentials(String credentialFile) { + static GoogleCredentials loadServiceAccountCredentials(String serviceAccountCredentialFile) { try { - InputStream keyStream = new ByteArrayInputStream(credentialFile.getBytes()); - return GoogleCredentials.fromStream(keyStream); + InputStream keyStream = new ByteArrayInputStream(serviceAccountCredentialFile.getBytes()); + return ServiceAccountCredentials.fromStream(keyStream); } catch (IOException e) { fail("Couldn't create fake JSON credentials."); } diff --git a/gax-java/pom.xml b/gax-java/pom.xml index 10ae36b7e1..3bcf93f37c 100644 --- a/gax-java/pom.xml +++ b/gax-java/pom.xml @@ -4,14 +4,14 @@ com.google.api gax-parent pom - 2.70.3 + 2.71.0 GAX (Google Api eXtensions) for Java (Parent) Google Api eXtensions for Java (Parent) com.google.api gapic-generator-java-pom-parent - 2.62.3 + 2.63.0 ../gapic-generator-java-pom-parent @@ -50,7 +50,7 @@ com.google.api api-common - 2.53.3 + 2.54.0 com.google.auth @@ -98,24 +98,24 @@ com.google.api gax - 2.70.3 + 2.71.0 com.google.api gax - 2.70.3 + 2.71.0 test-jar testlib com.google.api.grpc proto-google-common-protos - 2.61.3 + 2.62.0 com.google.api.grpc grpc-google-common-protos - 2.61.3 + 2.62.0 io.grpc diff --git a/generation_config.yaml b/generation_config.yaml index 3de58f128e..970d96946e 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -1,4 +1,4 @@ -googleapis_commitish: 3990e05b25dcaf7ba8d6baa4255d9b012a3a6a4f +googleapis_commitish: ac02e45c23e8f55b81fd1425190dd7d4e11390f7 # the libraries are ordered with respect to library name, which is # java-{library.library_name} or java-{library.api-shortname} when # library.library_name is not defined. diff --git a/hermetic_build/library_generation/owlbot/templates/java_library/.kokoro/presubmit/graalvm-native-a.cfg b/hermetic_build/library_generation/owlbot/templates/java_library/.kokoro/presubmit/graalvm-native-a.cfg index b7567eeb7d..55c5543e26 100644 --- a/hermetic_build/library_generation/owlbot/templates/java_library/.kokoro/presubmit/graalvm-native-a.cfg +++ b/hermetic_build/library_generation/owlbot/templates/java_library/.kokoro/presubmit/graalvm-native-a.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.52.3" # {x-version-update:google-cloud-shared-dependencies:current} + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.53.0" # {x-version-update:google-cloud-shared-dependencies:current} } env_vars: { diff --git a/hermetic_build/library_generation/owlbot/templates/java_library/.kokoro/presubmit/graalvm-native-b.cfg b/hermetic_build/library_generation/owlbot/templates/java_library/.kokoro/presubmit/graalvm-native-b.cfg index c7205f0abd..5c981b9848 100644 --- a/hermetic_build/library_generation/owlbot/templates/java_library/.kokoro/presubmit/graalvm-native-b.cfg +++ b/hermetic_build/library_generation/owlbot/templates/java_library/.kokoro/presubmit/graalvm-native-b.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.52.3" # {x-version-update:google-cloud-shared-dependencies:current} + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.53.0" # {x-version-update:google-cloud-shared-dependencies:current} } env_vars: { diff --git a/hermetic_build/library_generation/owlbot/templates/java_library/.kokoro/presubmit/graalvm-native-c.cfg b/hermetic_build/library_generation/owlbot/templates/java_library/.kokoro/presubmit/graalvm-native-c.cfg index f6ab8976a5..f2032499df 100644 --- a/hermetic_build/library_generation/owlbot/templates/java_library/.kokoro/presubmit/graalvm-native-c.cfg +++ b/hermetic_build/library_generation/owlbot/templates/java_library/.kokoro/presubmit/graalvm-native-c.cfg @@ -3,7 +3,7 @@ # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.52.3" # {x-version-update:google-cloud-shared-dependencies:current} + value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_c:3.53.0" # {x-version-update:google-cloud-shared-dependencies:current} } env_vars: { diff --git a/internal/librariangen/Dockerfile b/internal/librariangen/Dockerfile new file mode 100644 index 0000000000..85fa27d579 --- /dev/null +++ b/internal/librariangen/Dockerfile @@ -0,0 +1,65 @@ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This Dockerfile creates a MOSS-compliant image for the Go librariangen, +# which is invoked by the Librarian tool. It uses a multi-stage build to +# create a minimal final image. + +# --- Builder Stage --- +# This stage builds the librariangen binary using the MOSS-compliant base image. +FROM marketplace.gcr.io/google/debian12:latest AS builder + +# Set environment variables for tool versions for easy updates. +ENV GO_VERSION=1.24.0 + +# Install build dependencies. +RUN apt-get update && \ + apt-get install -y \ + build-essential \ + ca-certificates \ + curl \ + wget && \ + rm -rf /var/lib/apt/lists/* + +# Install the specific Go version required for compatibility. +RUN wget https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz -O go.tar.gz && \ + tar -C /usr/local -xzf go.tar.gz && \ + rm go.tar.gz +ENV PATH=/usr/local/go/bin:$PATH +RUN go version + +WORKDIR /src + +# Copy go.mod and go.sum to download dependencies before copying all the source. +# This allows Docker to cache the dependencies layer. +# COPY go.mod go.sum ./ +# RUN go mod download + +# Copy all source code. +COPY . . + +# Build the librariangen binary. +RUN CGO_ENABLED=0 GOOS=linux go build -v -o /librariangen . + +# --- Final Stage --- +# This stage creates the final, minimal image with the compiled binary and +# all required runtime dependencies pinned to specific versions for compatibility. +FROM marketplace.gcr.io/google/debian12:latest + +# Copy the compiled librariangen binary from the builder stage. +COPY --from=builder /librariangen /usr/local/bin/librariangen + +# Set the entrypoint for the container to run the compiled librariangen. +# The Librarian will provide commands like 'generate' as arguments. +ENTRYPOINT [ "/usr/local/bin/librariangen" ] \ No newline at end of file diff --git a/internal/librariangen/README.md b/internal/librariangen/README.md new file mode 100644 index 0000000000..b310d5567c --- /dev/null +++ b/internal/librariangen/README.md @@ -0,0 +1,3 @@ +# Java GAPIC Generator for Librarian (librariangen) + +This directory contains the source code for `librariangen`, a containerized Go application that serves as the Java-specific code generator within the Librarian pipeline. Its responsibility is to generate release-ready Java GAPIC client libraries from `googleapis` API definitions, replacing the legacy Java hermetic code generation toolchain. diff --git a/internal/librariangen/bazel/parser.go b/internal/librariangen/bazel/parser.go new file mode 100644 index 0000000000..a041903e1c --- /dev/null +++ b/internal/librariangen/bazel/parser.go @@ -0,0 +1,126 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package bazel + +import ( + "errors" + "fmt" + "log/slog" + "os" + "path/filepath" + "regexp" + "strconv" + "strings" + "sync" +) + +// Config holds configuration extracted from a googleapis BUILD.bazel file. +type Config struct { + grpcServiceConfig string + restNumericEnums bool + serviceYAML string + transport string + hasGAPIC bool +} + +// HasGAPIC indicates whether the GAPIC generator should be run. +func (c *Config) HasGAPIC() bool { return c.hasGAPIC } + +// ServiceYAML is the client config file in the API version directory in googleapis. +func (c *Config) ServiceYAML() string { return c.serviceYAML } + +// GRPCServiceConfig is name of the gRPC service config JSON file. +func (c *Config) GRPCServiceConfig() string { return c.grpcServiceConfig } + +// Transport is typically one of "grpc", "rest" or "grpc+rest". +func (c *Config) Transport() string { return c.transport } + +// HasRESTNumericEnums indicates whether the generated client should support numeric enums. +func (c *Config) HasRESTNumericEnums() bool { return c.restNumericEnums } + +// Validate ensures that the configuration is valid. +func (c *Config) Validate() error { + if c.hasGAPIC { + if c.serviceYAML == "" { + return errors.New("librariangen: serviceYAML is not set") + } + } + return nil +} + +var javaGapicLibraryRE = regexp.MustCompile(`java_gapic_library\((?s:.)*?\)`) +// Parse reads a BUILD.bazel file from the given directory and extracts the +// relevant configuration from the java_gapic_library rule. +func Parse(dir string) (*Config, error) { + c := &Config{} + fp := filepath.Join(dir, "BUILD.bazel") + data, err := os.ReadFile(fp) + if err != nil { + return nil, fmt.Errorf("librariangen: failed to read BUILD.bazel file %s: %w", fp, err) + } + content := string(data) + + gapicLibraryBlock := javaGapicLibraryRE.FindString(content) + if gapicLibraryBlock != "" { + c.hasGAPIC = true + c.grpcServiceConfig = findString(gapicLibraryBlock, "grpc_service_config") + c.serviceYAML = strings.TrimPrefix(findString(gapicLibraryBlock, "service_yaml"), ":") + c.transport = findString(gapicLibraryBlock, "transport") + if c.restNumericEnums, err = findBool(gapicLibraryBlock, "rest_numeric_enums"); err != nil { + return nil, fmt.Errorf("librariangen: failed to parse BUILD.bazel file %s: %w", fp, err) + } + } + if err := c.Validate(); err != nil { + return nil, fmt.Errorf("librariangen: invalid bazel config in %s: %w", dir, err) + } + slog.Debug("librariangen: bazel config loaded", "conf", c) + return c, nil +} + +var reCache = &sync.Map{} + +func getRegexp(key, pattern string) *regexp.Regexp { + val, ok := reCache.Load(key) + if !ok { + val = regexp.MustCompile(pattern) + reCache.Store(key, val) + } + return val.(*regexp.Regexp) +} + +func findString(content, name string) string { + re := getRegexp("findString_"+name, fmt.Sprintf(`%s\s*=\s*(?:"([^"]+)"|'([^']+)'){1}`, name)) + match := re.FindStringSubmatch(content) + if len(match) > 2 { + if match[1] != "" { + return match[1] // Double-quoted + } + return match[2] // Single-quoted + } + slog.Debug("librariangen: failed to find string attr in BUILD.bazel", "name", name) + return "" +} + +func findBool(content, name string) (bool, error) { + re := getRegexp("findBool_"+name, fmt.Sprintf(`%s\s*=\s*(\w+)`, name)) + if match := re.FindStringSubmatch(content); len(match) > 1 { + if b, err := strconv.ParseBool(match[1]); err == nil { + return b, nil + } + return false, fmt.Errorf("librariangen: failed to parse bool attr in BUILD.bazel: %q, got: %q", name, match[1]) + } + slog.Debug("librariangen: failed to find bool attr in BUILD.bazel", "name", name) + return false, nil +} diff --git a/internal/librariangen/bazel/parser_test.go b/internal/librariangen/bazel/parser_test.go new file mode 100644 index 0000000000..992665d76d --- /dev/null +++ b/internal/librariangen/bazel/parser_test.go @@ -0,0 +1,248 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package bazel + +import ( + "os" + "path/filepath" + "testing" +) + +func TestParse(t *testing.T) { + content := ` +java_grpc_library( + name = "asset_java_grpc", + srcs = [":asset_proto"], + deps = [":asset_java_proto"], +) + +java_gapic_library( + name = "asset_java_gapic", + srcs = [":asset_proto_with_info"], + grpc_service_config = "cloudasset_grpc_service_config.json", + rest_numeric_enums = True, + service_yaml = "cloudasset_v1.yaml", + test_deps = [ + ":asset_java_grpc", + "//google/iam/v1:iam_java_grpc", + ], + transport = 'grpc+rest', + deps = [ + ":asset_java_proto", + "//google/api:api_java_proto", + "//google/iam/v1:iam_java_proto", + ], +) +` + tmpDir := t.TempDir() + buildPath := filepath.Join(tmpDir, "BUILD.bazel") + if err := os.WriteFile(buildPath, []byte(content), 0644); err != nil { + t.Fatalf("failed to write test file: %v", err) + } + + got, err := Parse(tmpDir) + if err != nil { + t.Fatalf("Parse() failed: %v", err) + } + + t.Run("HasGAPIC", func(t *testing.T) { + if !got.HasGAPIC() { + t.Error("HasGAPIC() = false; want true") + } + }) + t.Run("ServiceYAML", func(t *testing.T) { + if want := "cloudasset_v1.yaml"; got.ServiceYAML() != want { + t.Errorf("ServiceYAML() = %q; want %q", got.ServiceYAML(), want) + } + }) + t.Run("GRPCServiceConfig", func(t *testing.T) { + if want := "cloudasset_grpc_service_config.json"; got.GRPCServiceConfig() != want { + t.Errorf("GRPCServiceConfig() = %q; want %q", got.GRPCServiceConfig(), want) + } + }) + t.Run("Transport", func(t *testing.T) { + if want := "grpc+rest"; got.Transport() != want { + t.Errorf("Transport() = %q; want %q", got.Transport(), want) + } + }) + t.Run("HasRESTNumericEnums", func(t *testing.T) { + if !got.HasRESTNumericEnums() { + t.Error("HasRESTNumericEnums() = false; want true") + } + }) +} + +func TestParse_serviceConfigIsTarget(t *testing.T) { + content := ` +java_grpc_library( + name = "asset_java_grpc", + srcs = [":asset_proto"], + deps = [":asset_java_proto"], +) + +java_gapic_library( + name = "asset_java_gapic", + srcs = [":asset_proto_with_info"], + grpc_service_config = "cloudasset_grpc_service_config.json", + rest_numeric_enums = True, + service_yaml = ":cloudasset_v1.yaml", + test_deps = [ + ":asset_java_grpc", + "//google/iam/v1:iam_java_grpc", + ], + transport = "grpc+rest", + deps = [ + ":asset_java_proto", + "//google/api:api_java_proto", + "//google/iam/v1:iam_java_proto", + ], +) +` + tmpDir := t.TempDir() + buildPath := filepath.Join(tmpDir, "BUILD.bazel") + if err := os.WriteFile(buildPath, []byte(content), 0644); err != nil { + t.Fatalf("failed to write test file: %v", err) + } + + got, err := Parse(tmpDir) + if err != nil { + t.Fatalf("Parse() failed: %v", err) + } + + if want := "cloudasset_v1.yaml"; got.ServiceYAML() != want { + t.Errorf("ServiceYAML() = %q; want %q", got.ServiceYAML(), want) + } +} + +func TestConfig_Validate(t *testing.T) { + tests := []struct { + name string + cfg *Config + wantErr bool + }{ + { + name: "valid GAPIC", + cfg: &Config{ + hasGAPIC: true, + serviceYAML: "b", + grpcServiceConfig: "c", + transport: "d", + }, + wantErr: false, + }, + { + name: "valid non-GAPIC", + cfg: &Config{}, + wantErr: false, + }, + { + name: "gRPC service config and transport are optional", + cfg: &Config{hasGAPIC: true, serviceYAML: "b"}, + wantErr: false, + }, + { + name: "missing serviceYAML", + cfg: &Config{hasGAPIC: true, grpcServiceConfig: "c", transport: "d"}, + wantErr: true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if err := tt.cfg.Validate(); (err != nil) != tt.wantErr { + t.Errorf("Config.Validate() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} + +func TestParse_noGapic(t *testing.T) { + content := ` +java_grpc_library( + name = "asset_java_grpc", + srcs = [":asset_proto"], + deps = [":asset_java_proto"], +) +` + tmpDir := t.TempDir() + buildPath := filepath.Join(tmpDir, "BUILD.bazel") + if err := os.WriteFile(buildPath, []byte(content), 0644); err != nil { + t.Fatalf("failed to write test file: %v", err) + } + + got, err := Parse(tmpDir) + if err != nil { + t.Fatalf("Parse() failed: %v", err) + } + + if got.HasGAPIC() { + t.Error("HasGAPIC() = true; want false") + } +} + +func TestParse_missingSomeAttrs(t *testing.T) { + content := ` +java_gapic_library( + name = "asset_java_gapic", + service_yaml = "cloudasset_v1.yaml", +) +` + tmpDir := t.TempDir() + buildPath := filepath.Join(tmpDir, "BUILD.bazel") + if err := os.WriteFile(buildPath, []byte(content), 0644); err != nil { + t.Fatalf("failed to write test file: %v", err) + } + + got, err := Parse(tmpDir) + if err != nil { + t.Fatalf("Parse() failed: %v", err) + } + + if got.GRPCServiceConfig() != "" { + t.Errorf("GRPCServiceConfig() = %q; want \"\"", got.GRPCServiceConfig()) + } + if got.Transport() != "" { + t.Errorf("Transport() = %q; want \"\"", got.Transport()) + } + if got.HasRESTNumericEnums() { + t.Error("HasRESTNumericEnums() = true; want false") + } +} + +func TestParse_invalidBoolAttr(t *testing.T) { + content := ` +java_gapic_library( + name = "asset_java_gapic", + rest_numeric_enums = "not-a-bool", +) +` + tmpDir := t.TempDir() + buildPath := filepath.Join(tmpDir, "BUILD.bazel") + if err := os.WriteFile(buildPath, []byte(content), 0644); err != nil { + t.Fatalf("failed to write test file: %v", err) + } + + _, err := Parse(tmpDir) + if err == nil { + t.Error("Parse() succeeded; want error") + } +} + +func TestParse_noBuildFile(t *testing.T) { + tmpDir := t.TempDir() + _, err := Parse(tmpDir) + if err == nil { + t.Error("Parse() succeeded; want error") + } +} \ No newline at end of file diff --git a/internal/librariangen/build-docker-and-test.sh b/internal/librariangen/build-docker-and-test.sh new file mode 100755 index 0000000000..1c6fda1428 --- /dev/null +++ b/internal/librariangen/build-docker-and-test.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +set -e +SCRIPT_DIR=$(dirname "$0") +IMAGE_NAME="librariangen-test" + +echo "Building Docker image..." +docker build -t "${IMAGE_NAME}" "${SCRIPT_DIR}" + +echo "Running version check..." +output=$(docker run --rm -e GOOGLE_SDK_JAVA_LOGGING_LEVEL=quiet "${IMAGE_NAME}" --version) + +if [[ ! "$output" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "Version format is incorrect. Got: $output" + exit 1 +fi + +echo "Version check passed. Version is $output" \ No newline at end of file diff --git a/internal/librariangen/cloudbuild-exitgate.yaml b/internal/librariangen/cloudbuild-exitgate.yaml new file mode 100644 index 0000000000..f10a1f9e46 --- /dev/null +++ b/internal/librariangen/cloudbuild-exitgate.yaml @@ -0,0 +1,52 @@ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# note: /workspace is a special directory in the docker image where all the files in this folder +# get placed on your behalf + +timeout: 7200s # 2 hours +steps: + # Attempt to pull the latest image to use as a cache source. + - name: gcr.io/cloud-builders/docker + entrypoint: 'bash' + args: + - -c + - | + docker pull us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-dev/librarian-java:latest || exit 0 + - name: gcr.io/cloud-builders/docker + args: + [ + "build", + "--cache-from", + "us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-dev/librarian-java:latest", + "-t", + "us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-dev/librarian-java:latest", + "-f", + "Dockerfile", + ".", + ] + dir: internal/librariangen +options: + machineType: 'E2_HIGHCPU_8' + requestedVerifyOption: VERIFIED # For provenance attestation generation + logging: CLOUD_LOGGING_ONLY +images: + - us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-dev/librarian-java:latest +dependencies: +- gitSource: + repository: + url: "${_LOUHI_REPOSITORY_URL}" + revision: "${_LOUHI_REF_SHA}" + destPath: "." + diff --git a/internal/librariangen/execv/execv.go b/internal/librariangen/execv/execv.go new file mode 100644 index 0000000000..3000cb761c --- /dev/null +++ b/internal/librariangen/execv/execv.go @@ -0,0 +1,51 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package execv + +import ( + "context" + "errors" + "fmt" + "log/slog" + "os" + "os/exec" + "strings" +) + +// Run executes a command in a specified working directory and logs its output. +func Run(ctx context.Context, args []string, workingDir string) error { + cmd := exec.CommandContext(ctx, args[0], args[1:]...) + cmd.Env = os.Environ() + cmd.Dir = workingDir + slog.Debug("librariangen: running command", "command", strings.Join(cmd.Args, " "), "dir", cmd.Dir) + + output, err := cmd.Output() + if len(output) > 0 { + slog.Debug("librariangen: command stdout", "output", string(output)) + } + if err != nil { + var exitErr *exec.ExitError + if errors.As(err, &exitErr) { + // The command ran and exited with a non-zero exit code. + if len(exitErr.Stderr) > 0 { + slog.Debug("librariangen: command stderr", "output", string(exitErr.Stderr)) + } + return fmt.Errorf("librariangen: command failed with exit error: %s: %w", exitErr.Stderr, err) + } + // Another error occurred (e.g., command not found). + return fmt.Errorf("librariangen: command failed: %w", err) + } + return nil +} \ No newline at end of file diff --git a/internal/librariangen/execv/execv_test.go b/internal/librariangen/execv/execv_test.go new file mode 100644 index 0000000000..b2f28be3c6 --- /dev/null +++ b/internal/librariangen/execv/execv_test.go @@ -0,0 +1,79 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package execv + +import ( + "context" + "errors" + "os/exec" + "strings" + "testing" +) + +func TestRun(t *testing.T) { + tests := []struct { + name string + args []string + wantErr bool + wantExit int + wantInStderr string + }{ + { + name: "valid command", + args: []string{"echo", "hello"}, + wantErr: false, + }, + { + name: "invalid command", + args: []string{"command-that-does-not-exist"}, + wantErr: true, + }, + { + name: "command with non-zero exit", + args: []string{"sh", "-c", "exit 1"}, + wantErr: true, + wantExit: 1, + }, + { + name: "command with stderr output", + args: []string{"sh", "-c", "echo 'test error' >&2; exit 1"}, + wantErr: true, + wantExit: 1, + wantInStderr: "test error", + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + err := Run(context.Background(), tt.args, ".") + if (err != nil) != tt.wantErr { + t.Fatalf("Run() error = %v, wantErr %v", err, tt.wantErr) + } + + if !tt.wantErr { + return + } + + var exitErr *exec.ExitError + if errors.As(err, &exitErr) { + if tt.wantExit != 0 && exitErr.ExitCode() != tt.wantExit { + t.Errorf("Run() exit code = %d, want %d", exitErr.ExitCode(), tt.wantExit) + } + if tt.wantInStderr != "" && !strings.Contains(string(exitErr.Stderr), tt.wantInStderr) { + t.Errorf("Run() stderr = %q, want contains %q", string(exitErr.Stderr), tt.wantInStderr) + } + } + }) + } +} \ No newline at end of file diff --git a/internal/librariangen/go.mod b/internal/librariangen/go.mod new file mode 100644 index 0000000000..87e854c400 --- /dev/null +++ b/internal/librariangen/go.mod @@ -0,0 +1,5 @@ +module cloud.google.com/java/internal/librariangen + +go 1.24.4 + +require github.com/google/go-cmp v0.7.0 // indirect diff --git a/internal/librariangen/go.sum b/internal/librariangen/go.sum new file mode 100644 index 0000000000..40e761ae7c --- /dev/null +++ b/internal/librariangen/go.sum @@ -0,0 +1,2 @@ +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= diff --git a/internal/librariangen/main.go b/internal/librariangen/main.go new file mode 100644 index 0000000000..40e2c6b7b7 --- /dev/null +++ b/internal/librariangen/main.go @@ -0,0 +1,95 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package main + +import ( + "context" + "errors" + "fmt" + "log/slog" + "os" + "strings" +) + +const version = "0.1.0" + +// main is the entrypoint for the librariangen CLI. +func main() { + os.Exit(runCLI(os.Args)) +} + +func runCLI(args []string) int { + logLevel := parseLogLevel(os.Getenv("GOOGLE_SDK_JAVA_LOGGING_LEVEL")) + slog.SetDefault(slog.New(slog.NewTextHandler(os.Stdout, &slog.HandlerOptions{ + Level: logLevel, + }))) + slog.Info("librariangen: invoked", "args", args) + if err := run(context.Background(), args[1:]); err != nil { + slog.Error("librariangen: failed", "error", err) + return 1 + } + slog.Info("librariangen: finished successfully") + return 0 +} + +func parseLogLevel(logLevelEnv string) slog.Level { + switch logLevelEnv { + case "debug": + return slog.LevelDebug + case "quiet": + return slog.LevelError + 1 + default: + return slog.LevelInfo + } +} + +// run executes the appropriate command based on the CLI's invocation arguments. +// The idiomatic structure is `librariangen [command] [flags]`. +func run(ctx context.Context, args []string) error { + if len(args) < 1 { + return errors.New("librariangen: expected a command") + } + + // The --version flag is a special case and not a command. + if args[0] == "--version" { + fmt.Println(version) + return nil + } + + cmd := args[0] + flags := args[1:] + + if strings.HasPrefix(cmd, "-") { + return fmt.Errorf("librariangen: command cannot be a flag: %s", cmd) + } + + switch cmd { + case "generate": + slog.Warn("librariangen: generate command is not yet implemented") + return nil + case "release-init": + slog.Warn("librariangen: release-init command is not yet implemented") + return nil + case "configure": + slog.Warn("librariangen: configure command is not yet implemented") + return nil + case "build": + slog.Warn("librariangen: build command is not yet implemented") + return nil + default: + return fmt.Errorf("librariangen: unknown command: %s (with flags %s)", cmd, flags) + } + +} diff --git a/internal/librariangen/main_test.go b/internal/librariangen/main_test.go new file mode 100644 index 0000000000..75e299f233 --- /dev/null +++ b/internal/librariangen/main_test.go @@ -0,0 +1,141 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package main + +import ( + "context" + "log/slog" + "testing" +) + +func TestRun(t *testing.T) { + ctx := context.Background() + tests := []struct { + name string + args []string + wantErr bool + }{ + { + name: "no args", + args: []string{}, + wantErr: true, + }, + { + name: "version flag", + args: []string{"--version"}, + wantErr: false, + }, + { + name: "flag as command", + args: []string{"--foo"}, + wantErr: true, + }, + { + name: "unknown command", + args: []string{"foo"}, + wantErr: true, + }, + { + name: "build command no flags", + args: []string{"build"}, + wantErr: false, + }, + { + name: "build command with flags", + args: []string{"build", "--repo=.", "--librarian=./.librarian"}, + wantErr: false, + }, + { + name: "configure command", + args: []string{"configure"}, + wantErr: false, + }, + { + name: "generate command no flags", + args: []string{"generate"}, + wantErr: false, + }, + { + name: "generate command with flags", + args: []string{"generate", "--source=.", "--output=./build_out"}, + wantErr: false, + }, + { + name: "release-init command no flags", + args: []string{"release-init"}, + wantErr: false, + }, + { + name: "release-init command with flags", + args: []string{"release-init", "--repo=.", "--output=./build_out"}, + wantErr: false, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + // Since we are only testing the command dispatching, we can pass a nil + // context. The generate function is not actually called. + if err := run(ctx, tt.args); (err != nil) != tt.wantErr { + t.Errorf("run() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} + +func TestRunCLI(t *testing.T) { + tests := []struct { + name string + args []string + wantCode int + }{ + { + name: "success", + args: []string{"librariangen", "build"}, + wantCode: 0, + }, + { + name: "failure", + args: []string{"librariangen", "foo"}, + wantCode: 1, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if gotCode := runCLI(tt.args); gotCode != tt.wantCode { + t.Errorf("runCLI() = %v, want %v", gotCode, tt.wantCode) + } + }) + } +} + +func TestParseLogLevel(t *testing.T) { + tests := []struct { + name string + level string + want slog.Level + }{ + {"default", "", slog.LevelInfo}, + {"debug", "debug", slog.LevelDebug}, + {"quiet", "quiet", slog.LevelError + 1}, + {"invalid", "foo", slog.LevelInfo}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if got := parseLogLevel(tt.level); got != tt.want { + t.Errorf("parseLogLevel() = %v, want %v", got, tt.want) + } + }) + } +} \ No newline at end of file diff --git a/internal/librariangen/protoc/protoc.go b/internal/librariangen/protoc/protoc.go new file mode 100644 index 0000000000..b7bf0ad19e --- /dev/null +++ b/internal/librariangen/protoc/protoc.go @@ -0,0 +1,100 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package protoc + +import ( + "fmt" + "os" + "path/filepath" + "strings" + +) + +// ConfigProvider is an interface that describes the configuration needed +// by the Build function. This allows the protoc package to be decoupled +// from the source of the configuration (e.g., Bazel files, JSON, etc.). +type ConfigProvider interface { + ServiceYAML() string + GapicYAML() string + GRPCServiceConfig() string + Transport() string + HasRESTNumericEnums() bool + HasGAPIC() bool +} + +// Build constructs the full protoc command arguments for a given API. +func Build(apiServiceDir string, config ConfigProvider, sourceDir, outputDir string) ([]string, error) { + // Gather all .proto files in the API's source directory. + entries, err := os.ReadDir(apiServiceDir) + if err != nil { + return nil, fmt.Errorf("librariangen: failed to read API source directory %s: %w", apiServiceDir, err) + } + + var protoFiles []string + for _, entry := range entries { + if !entry.IsDir() && filepath.Ext(entry.Name()) == ".proto" { + protoFiles = append(protoFiles, filepath.Join(apiServiceDir, entry.Name())) + } + } + + if len(protoFiles) == 0 { + return nil, fmt.Errorf("librariangen: no .proto files found in %s", apiServiceDir) + } + + // Construct the protoc command arguments. + var gapicOpts []string + if config.HasGAPIC() { + if config.ServiceYAML() != "" { + gapicOpts = append(gapicOpts, fmt.Sprintf("api-service-config=%s", filepath.Join(apiServiceDir, config.ServiceYAML()))) + } + if config.GapicYAML() != "" { + gapicOpts = append(gapicOpts, fmt.Sprintf("gapic-config=%s", filepath.Join(apiServiceDir, config.GapicYAML()))) + } + if config.GRPCServiceConfig() != "" { + gapicOpts = append(gapicOpts, fmt.Sprintf("grpc-service-config=%s", filepath.Join(apiServiceDir, config.GRPCServiceConfig()))) + } + if config.Transport() != "" { + gapicOpts = append(gapicOpts, fmt.Sprintf("transport=%s", config.Transport())) + } + if config.HasRESTNumericEnums() { + gapicOpts = append(gapicOpts, "rest-numeric-enums") + } + } + + args := []string{ + "protoc", + "--experimental_allow_proto3_optional", + } + + args = append(args, fmt.Sprintf("--java_out=%s", outputDir)) + if config.HasGAPIC() { + args = append(args, fmt.Sprintf("--java_gapic_out=metadata:%s", filepath.Join(outputDir, "java_gapic.zip"))) + + if len(gapicOpts) > 0 { + args = append(args, "--java_gapic_opt="+strings.Join(gapicOpts, ",")) + } + } + + args = append(args, + // The -I flag specifies the import path for protoc. All protos + // and their dependencies must be findable from this path. + // The /source mount contains the complete googleapis repository. + "-I="+sourceDir, + ) + + args = append(args, protoFiles...) + + return args, nil +} \ No newline at end of file diff --git a/internal/librariangen/protoc/protoc_test.go b/internal/librariangen/protoc/protoc_test.go new file mode 100644 index 0000000000..7e7f62aec6 --- /dev/null +++ b/internal/librariangen/protoc/protoc_test.go @@ -0,0 +1,137 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package protoc + +import ( + "path/filepath" + "strings" + "testing" + + "github.com/google/go-cmp/cmp" +) + +// mockConfigProvider is a mock implementation of the ConfigProvider interface for testing. +type mockConfigProvider struct { + serviceYAML string + gapicYAML string + grpcServiceConfig string + transport string + restNumericEnums bool + hasGAPIC bool +} + +func (m *mockConfigProvider) ServiceYAML() string { return m.serviceYAML } +func (m *mockConfigProvider) GapicYAML() string { return m.gapicYAML } +func (m *mockConfigProvider) GRPCServiceConfig() string { return m.grpcServiceConfig } +func (m *mockConfigProvider) Transport() string { return m.transport } +func (m *mockConfigProvider) HasRESTNumericEnums() bool { return m.restNumericEnums } +func (m *mockConfigProvider) HasGAPIC() bool { return m.hasGAPIC } + +func TestBuild(t *testing.T) { + // The testdata directory is a curated version of a valid protoc + // import path that contains all the necessary proto definitions. + sourceDir, err := filepath.Abs("../testdata/generate/source") + if err != nil { + t.Fatalf("failed to get absolute path for sourceDir: %v", err) + } + tests := []struct { + name string + apiPath string + config mockConfigProvider + want []string + }{ + { + name: "java_grpc_library rule", + apiPath: "google/cloud/workflows/v1", + config: mockConfigProvider{ + transport: "grpc", + grpcServiceConfig: "workflows_grpc_service_config.json", + gapicYAML: "workflows_gapic.yaml", + serviceYAML: "workflows_v1.yaml", + restNumericEnums: true, + hasGAPIC: true, + }, + want: []string{ + "protoc", + "--experimental_allow_proto3_optional", + "--java_out=/output", + "--java_gapic_out=metadata:/output/java_gapic.zip", + "--java_gapic_opt=" + strings.Join([]string{ + "api-service-config=" + filepath.Join(sourceDir, "google/cloud/workflows/v1/workflows_v1.yaml"), + "gapic-config=" + filepath.Join(sourceDir, "google/cloud/workflows/v1/workflows_gapic.yaml"), + "grpc-service-config=" + filepath.Join(sourceDir, "google/cloud/workflows/v1/workflows_grpc_service_config.json"), + "transport=grpc", + "rest-numeric-enums", + }, ","), + "-I=" + sourceDir, + filepath.Join(sourceDir, "google/cloud/workflows/v1/workflows.proto"), + }, + }, + { + name: "java_proto_library rule with legacy gRPC", + apiPath: "google/cloud/secretmanager/v1beta2", + config: mockConfigProvider{ + transport: "grpc", + grpcServiceConfig: "secretmanager_grpc_service_config.json", + serviceYAML: "secretmanager_v1beta2.yaml", + restNumericEnums: true, + hasGAPIC: true, + }, + want: []string{ + "protoc", + "--experimental_allow_proto3_optional", + "--java_out=/output", + "--java_gapic_out=metadata:/output/java_gapic.zip", + "--java_gapic_opt=" + strings.Join([]string{ + "api-service-config=" + filepath.Join(sourceDir, "google/cloud/secretmanager/v1beta2/secretmanager_v1beta2.yaml"), + "grpc-service-config=" + filepath.Join(sourceDir, "google/cloud/secretmanager/v1beta2/secretmanager_grpc_service_config.json"), + "transport=grpc", + "rest-numeric-enums", + }, ","), + "-I=" + sourceDir, + filepath.Join(sourceDir, "google/cloud/secretmanager/v1beta2/secretmanager.proto"), + }, + }, + { + // Note: we don't have a separate test directory with a proto-only library; + // the config is used to say "don't generate GAPIC". + name: "proto-only", + apiPath: "google/cloud/secretmanager/v1beta2", + config: mockConfigProvider{ + hasGAPIC: false, + }, + want: []string{ + "protoc", + "--experimental_allow_proto3_optional", + "--java_out=/output", + "-I=" + sourceDir, + filepath.Join(sourceDir, "google/cloud/secretmanager/v1beta2/secretmanager.proto"), + }, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got, err := Build(filepath.Join(sourceDir, tt.apiPath), &tt.config, sourceDir, "/output") + if err != nil { + t.Fatalf("Build() failed: %v", err) + } + + if diff := cmp.Diff(tt.want, got); diff != "" { + t.Errorf("Build() mismatch (-want +got):\n%s", diff) + } + }) + } +} \ No newline at end of file diff --git a/internal/librariangen/request/request.go b/internal/librariangen/request/request.go new file mode 100644 index 0000000000..72734e1edc --- /dev/null +++ b/internal/librariangen/request/request.go @@ -0,0 +1,78 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package request + +import ( + "encoding/json" + "fmt" + "os" +) + +// Library is the combination of all the fields used by CLI requests and responses. +// Each CLI command has its own request/response type, but they all use Library. +type Library struct { + ID string `json:"id,omitempty"` + Version string `json:"version,omitempty"` + APIs []API `json:"apis,omitempty"` + // SourcePaths are the directories to which librarian contributes code. + // For Go, this is typically the Go module directory. + SourcePaths []string `json:"source_roots,omitempty"` + // PreserveRegex are files/directories to leave untouched during generation. + // This is useful for preserving handwritten helper files or customizations. + PreserveRegex []string `json:"preserve_regex,omitempty"` + // RemoveRegex are files/directories to remove during generation. + RemoveRegex []string `json:"remove_regex,omitempty"` + // Changes are the changes being released (in a release request) + Changes []*Change `json:"changes,omitempty"` + // Specifying a tag format allows librarian to honor this format when creating + // a tag for the release of the library. The replacement values of {id} and {version} + // permitted to reference the values configured in the library. If not specified + // the assumed format is {id}-{version}. e.g., {id}/v{version}. + TagFormat string `yaml:"tag_format,omitempty" json:"tag_format,omitempty"` + // ReleaseTriggered indicates whether this library is being released (in a release request) + ReleaseTriggered bool `json:"release_triggered,omitempty"` +} + +// API corresponds to a single API definition within a librarian request/response. +type API struct { + Path string `json:"path,omitempty"` + ServiceConfig string `json:"service_config,omitempty"` +} + +// Change represents a single commit change for a library. +type Change struct { + Type string `json:"type"` + Subject string `json:"subject"` + Body string `json:"body"` + PiperCLNumber string `json:"piper_cl_number"` + SourceCommitHash string `json:"source_commit_hash"` +} + +// ParseLibrary reads a file from the given path and unmarshals +// it into a Library struct. This is used for build and generate, where the requests +// are simply the library, with no wrapping. +func ParseLibrary(path string) (*Library, error) { + data, err := os.ReadFile(path) + if err != nil { + return nil, fmt.Errorf("librariangen: failed to read request file from %s: %w", path, err) + } + + var req Library + if err := json.Unmarshal(data, &req); err != nil { + return nil, fmt.Errorf("librariangen: failed to unmarshal request file %s: %w", path, err) + } + + return &req, nil +} \ No newline at end of file diff --git a/internal/librariangen/request/request_test.go b/internal/librariangen/request/request_test.go new file mode 100644 index 0000000000..03f05b2b23 --- /dev/null +++ b/internal/librariangen/request/request_test.go @@ -0,0 +1,98 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package request + +import ( + "os" + "path/filepath" + "testing" + + "github.com/google/go-cmp/cmp" +) + +func TestParseLibrary(t *testing.T) { + testCases := []struct { + name string + content string + want *Library + wantErr bool + }{ + { + name: "valid request", + content: `{ + "id": "asset", + "version": "1.15.0", + "apis": [ + { + "path": "google/cloud/asset/v1", + "service_config": "cloudasset_v1.yaml" + } + ], + "source_roots": ["asset/apiv1"], + "preserve_regex": ["asset/apiv1/foo.go"], + "remove_regex": ["asset/apiv1/bar.go"] + }`, + want: &Library{ + ID: "asset", + Version: "1.15.0", + APIs: []API{ + { + Path: "google/cloud/asset/v1", + ServiceConfig: "cloudasset_v1.yaml", + }, + }, + SourcePaths: []string{"asset/apiv1"}, + PreserveRegex: []string{"asset/apiv1/foo.go"}, + RemoveRegex: []string{"asset/apiv1/bar.go"}, + }, + wantErr: false, + }, + { + name: "malformed json", + content: `{"id": "foo",`, + wantErr: true, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + tmpDir := t.TempDir() + reqPath := filepath.Join(tmpDir, "generate-request.json") + if err := os.WriteFile(reqPath, []byte(tc.content), 0644); err != nil { + t.Fatalf("failed to write test file: %v", err) + } + + got, err := ParseLibrary(reqPath) + + if (err != nil) != tc.wantErr { + t.Errorf("Parse() error = %v, wantErr %v", err, tc.wantErr) + return + } + + if !tc.wantErr { + if diff := cmp.Diff(tc.want, got); diff != "" { + t.Errorf("Parse() mismatch (-want +got):\n%s", diff) + } + } + }) + } +} + +func TestParseLibrary_FileNotFound(t *testing.T) { + _, err := ParseLibrary("non-existent-file.json") + if err == nil { + t.Error("Parse() expected error for non-existent file, got nil") + } +} \ No newline at end of file diff --git a/internal/librariangen/testdata/generate/source/google/api/annotations.proto b/internal/librariangen/testdata/generate/source/google/api/annotations.proto new file mode 100644 index 0000000000..c749d43d6f --- /dev/null +++ b/internal/librariangen/testdata/generate/source/google/api/annotations.proto @@ -0,0 +1,46 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.api; + +import "google/protobuf/descriptor.proto"; + +option java_multiple_files = true; +option java_outer_classname = "AnnotationsProto"; +option java_package = "com.google.api"; + +extend google.protobuf.MethodOptions { + HttpRule http = 72295728; +} + +message HttpRule { + string selector = 1; + oneof pattern { + string get = 2; + string put = 3; + string post = 4; + string delete = 5; + string patch = 6; + CustomHttpPattern custom = 8; + } + string body = 7; + repeated HttpRule additional_bindings = 11; +} + +message CustomHttpPattern { + string kind = 1; + string path = 2; +} diff --git a/internal/librariangen/testdata/generate/source/google/cloud/secretmanager/v1beta2/BUILD.bazel b/internal/librariangen/testdata/generate/source/google/cloud/secretmanager/v1beta2/BUILD.bazel new file mode 100644 index 0000000000..a010cb6af5 --- /dev/null +++ b/internal/librariangen/testdata/generate/source/google/cloud/secretmanager/v1beta2/BUILD.bazel @@ -0,0 +1,53 @@ +java_proto_library( + name = "secretmanager_java_proto", + deps = [":secretmanager_proto"], +) + +java_grpc_library( + name = "secretmanager_java_grpc", + srcs = [":secretmanager_proto"], + deps = [":secretmanager_java_proto"], +) + +java_gapic_library( + name = "secretmanager_java_gapic", + srcs = [":secretmanager_proto_with_info"], + gapic_yaml = None, + grpc_service_config = "secretmanager_grpc_service_config.json", + rest_numeric_enums = True, + service_yaml = "secretmanager_v1beta2.yaml", + test_deps = [ + "//google/cloud/location:location_java_grpc", + "//google/iam/v1:iam_java_grpc", + ":secretmanager_java_grpc", + ], + transport = "grpc+rest", + deps = [ + ":secretmanager_java_proto", + "//google/api:api_java_proto", + "//google/cloud/location:location_java_proto", + "//google/iam/v1:iam_java_proto", + ], +) + +java_gapic_test( + name = "secretmanager_java_gapic_test_suite", + test_classes = [ + "com.google.cloud.secretmanager.v1beta2.SecretManagerServiceClientHttpJsonTest", + "com.google.cloud.secretmanager.v1beta2.SecretManagerServiceClientTest", + ], + runtime_deps = [":secretmanager_java_gapic_test"], +) + +# Open Source Packages +java_gapic_assembly_gradle_pkg( + name = "google-cloud-secretmanager-v1beta2-java", + transport = "grpc+rest", + deps = [ + ":secretmanager_java_gapic", + ":secretmanager_java_grpc", + ":secretmanager_java_proto", + ":secretmanager_proto", + ], + include_samples = True, +) \ No newline at end of file diff --git a/internal/librariangen/testdata/generate/source/google/cloud/secretmanager/v1beta2/secretmanager.proto b/internal/librariangen/testdata/generate/source/google/cloud/secretmanager/v1beta2/secretmanager.proto new file mode 100644 index 0000000000..a3d1df63be --- /dev/null +++ b/internal/librariangen/testdata/generate/source/google/cloud/secretmanager/v1beta2/secretmanager.proto @@ -0,0 +1,48 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.secretmanager.v1beta2; + +import "google/api/annotations.proto"; + +option java_multiple_files = true; +option java_outer_classname = "ServiceProto"; +option java_package = "com.google.cloud.secretmanager.v1beta2"; + +// A Secret is a secret value. +message Secret { + string name = 1; +} + +// Request for the `ListSecrets` method. +message ListSecretsRequest { + string parent = 1; +} + +// Response for the `ListSecrets` method. +message ListSecretsResponse { + repeated Secret Secrets = 1; +} + +// Service for managing secrets. +service Secrets { + // Lists Secrets in a given project and location. + rpc ListSecrets(ListSecretsRequest) returns (ListSecretsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/Secrets" + }; + } +} diff --git a/internal/librariangen/testdata/generate/source/google/cloud/secretmanager/v1beta2/secretmanager_v1beta2.yaml b/internal/librariangen/testdata/generate/source/google/cloud/secretmanager/v1beta2/secretmanager_v1beta2.yaml new file mode 100644 index 0000000000..a273af4d01 --- /dev/null +++ b/internal/librariangen/testdata/generate/source/google/cloud/secretmanager/v1beta2/secretmanager_v1beta2.yaml @@ -0,0 +1,11 @@ +type: google.api.Service +config_version: 3 +name: secretmanager.googleapis.com +title: Secret Manager API + +apis: +- name: google.cloud.secretmanager.v1beta2.Secrets + +documentation: + summary: |- + Subset of real Secret Manager API. diff --git a/internal/librariangen/testdata/generate/source/google/cloud/workflows/v1/BUILD.bazel b/internal/librariangen/testdata/generate/source/google/cloud/workflows/v1/BUILD.bazel new file mode 100644 index 0000000000..e3c9066a69 --- /dev/null +++ b/internal/librariangen/testdata/generate/source/google/cloud/workflows/v1/BUILD.bazel @@ -0,0 +1,50 @@ +java_proto_library( + name = "workflows_java_proto", + deps = [":workflows_proto"], +) + +java_grpc_library( + name = "workflows_java_grpc", + srcs = [":workflows_proto"], + deps = [":workflows_java_proto"], +) + +java_gapic_library( + name = "workflows_java_gapic", + srcs = [":workflows_proto_with_info"], + grpc_service_config = "workflows_grpc_service_config.json", + rest_numeric_enums = True, + service_yaml = "workflows_v1.yaml", + test_deps = [ + "//google/cloud/location:location_java_grpc", + ":workflows_java_grpc", + ], + transport = "grpc+rest", + deps = [ + ":workflows_java_proto", + "//google/api:api_java_proto", + "//google/cloud/location:location_java_proto", + ], +) + +java_gapic_test( + name = "workflows_java_gapic_test_suite", + test_classes = [ + "com.google.cloud.workflows.v1.WorkflowsClientHttpJsonTest", + "com.google.cloud.workflows.v1.WorkflowsClientTest", + ], + runtime_deps = [":workflows_java_gapic_test"], +) + +# Open Source Packages +java_gapic_assembly_gradle_pkg( + name = "google-cloud-workflows-v1-java", + include_samples = True, + transport = "grpc+rest", + deps = [ + ":workflows_java_gapic", + ":workflows_java_grpc", + ":workflows_java_proto", + ":workflows_proto", + ], +) \ No newline at end of file diff --git a/internal/librariangen/testdata/generate/source/google/cloud/workflows/v1/workflows.proto b/internal/librariangen/testdata/generate/source/google/cloud/workflows/v1/workflows.proto new file mode 100644 index 0000000000..a65843a154 --- /dev/null +++ b/internal/librariangen/testdata/generate/source/google/cloud/workflows/v1/workflows.proto @@ -0,0 +1,48 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.workflows.v1; + +import "google/api/annotations.proto"; + +option java_multiple_files = true; +option java_outer_classname = "WorkflowsProto"; +option java_package = "com.google.cloud.workflows.v1"; + +// A workflow is a collection of steps that are executed in a predefined order. +message Workflow { + string name = 1; +} + +// Request for the `ListWorkflows` method. +message ListWorkflowsRequest { + string parent = 1; +} + +// Response for the `ListWorkflows` method. +message ListWorkflowsResponse { + repeated Workflow workflows = 1; +} + +// Service for managing workflows. +service Workflows { + // Lists workflows in a given project and location. + rpc ListWorkflows(ListWorkflowsRequest) returns (ListWorkflowsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/workflows" + }; + } +} diff --git a/internal/librariangen/testdata/generate/source/google/cloud/workflows/v1/workflows_v1.yaml b/internal/librariangen/testdata/generate/source/google/cloud/workflows/v1/workflows_v1.yaml new file mode 100644 index 0000000000..76eae7cd3c --- /dev/null +++ b/internal/librariangen/testdata/generate/source/google/cloud/workflows/v1/workflows_v1.yaml @@ -0,0 +1,56 @@ +type: google.api.Service +config_version: 3 +name: workflows.googleapis.com +title: Workflows API + +apis: +- name: google.cloud.location.Locations +- name: google.cloud.workflows.v1.Workflows +- name: google.longrunning.Operations + +types: +- name: google.cloud.workflows.v1.OperationMetadata + +documentation: + summary: |- + Manage workflow definitions. To execute workflows and manage executions, + see the Workflows Executions API. + rules: + - selector: google.cloud.location.Locations.GetLocation + description: Gets information about a location. + + - selector: google.cloud.location.Locations.ListLocations + description: Lists information about the supported locations for this service. + +http: + rules: + - selector: google.cloud.location.Locations.GetLocation + get: '/v1/{name=projects/*/locations/*}' + - selector: google.cloud.location.Locations.ListLocations + get: '/v1/{name=projects/*}/locations' + - selector: google.longrunning.Operations.DeleteOperation + delete: '/v1/{name=projects/*/locations/*/operations/*}' + - selector: google.longrunning.Operations.GetOperation + get: '/v1/{name=projects/*/locations/*/operations/*}' + - selector: google.longrunning.Operations.ListOperations + get: '/v1/{name=projects/*/locations/*}/operations' + +authentication: + rules: + - selector: google.cloud.location.Locations.GetLocation + oauth: + canonical_scopes: |- + https://www.googleapis.com/auth/cloud-platform + - selector: google.cloud.location.Locations.ListLocations + oauth: + canonical_scopes: |- + https://www.googleapis.com/auth/cloud-platform + - selector: 'google.cloud.workflows.v1.Workflows.*' + oauth: + canonical_scopes: |- + https://www.googleapis.com/auth/cloud-platform + - selector: 'google.longrunning.Operations.*' + oauth: + canonical_scopes: |- + https://www.googleapis.com/auth/cloud-platform + diff --git a/java-common-protos/grpc-google-common-protos/pom.xml b/java-common-protos/grpc-google-common-protos/pom.xml index 0907a82d7a..d409a6a860 100644 --- a/java-common-protos/grpc-google-common-protos/pom.xml +++ b/java-common-protos/grpc-google-common-protos/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-common-protos - 2.61.3 + 2.62.0 grpc-google-common-protos GRPC library for grpc-google-common-protos com.google.api.grpc google-common-protos-parent - 2.61.3 + 2.62.0 diff --git a/java-common-protos/pom.xml b/java-common-protos/pom.xml index f085843a23..8c3b67d567 100644 --- a/java-common-protos/pom.xml +++ b/java-common-protos/pom.xml @@ -4,7 +4,7 @@ com.google.api.grpc google-common-protos-parent pom - 2.61.3 + 2.62.0 Google Common Protos Parent Java idiomatic client for Google Cloud Platform services. @@ -13,7 +13,7 @@ com.google.api gapic-generator-java-pom-parent - 2.62.3 + 2.63.0 ../gapic-generator-java-pom-parent @@ -50,7 +50,7 @@ com.google.cloud third-party-dependencies - 3.52.3 + 3.53.0 pom import @@ -64,7 +64,7 @@ com.google.api.grpc grpc-google-common-protos - 2.61.3 + 2.62.0 io.grpc @@ -76,7 +76,7 @@ com.google.api.grpc proto-google-common-protos - 2.61.3 + 2.62.0 com.google.guava diff --git a/java-common-protos/proto-google-common-protos/pom.xml b/java-common-protos/proto-google-common-protos/pom.xml index 17c92e27ec..4d7561db10 100644 --- a/java-common-protos/proto-google-common-protos/pom.xml +++ b/java-common-protos/proto-google-common-protos/pom.xml @@ -3,13 +3,13 @@ 4.0.0 com.google.api.grpc proto-google-common-protos - 2.61.3 + 2.62.0 proto-google-common-protos PROTO library for proto-google-common-protos com.google.api.grpc google-common-protos-parent - 2.61.3 + 2.62.0 diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/ListOperationsRequest.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/ListOperationsRequest.java index 9050e054d0..8dbb4a1ee6 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/ListOperationsRequest.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/ListOperationsRequest.java @@ -245,6 +245,34 @@ public com.google.protobuf.ByteString getPageTokenBytes() { } } + public static final int RETURN_PARTIAL_SUCCESS_FIELD_NUMBER = 5; + private boolean returnPartialSuccess_ = false; + + /** + * + * + *
+   * When set to `true`, operations that are reachable are returned as normal,
+   * and those that are unreachable are returned in the
+   * [ListOperationsResponse.unreachable] field.
+   *
+   * This can only be `true` when reading across collections e.g. when `parent`
+   * is set to `"projects/example/locations/-"`.
+   *
+   * This field is not by default supported and will result in an
+   * `UNIMPLEMENTED` error if set unless explicitly documented otherwise in
+   * service or product specific documentation.
+   * 
+ * + * bool return_partial_success = 5; + * + * @return The returnPartialSuccess. + */ + @java.lang.Override + public boolean getReturnPartialSuccess() { + return returnPartialSuccess_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -271,6 +299,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 4, name_); } + if (returnPartialSuccess_ != false) { + output.writeBool(5, returnPartialSuccess_); + } getUnknownFields().writeTo(output); } @@ -292,6 +323,9 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, name_); } + if (returnPartialSuccess_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, returnPartialSuccess_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -312,6 +346,7 @@ public boolean equals(final java.lang.Object obj) { if (!getFilter().equals(other.getFilter())) return false; if (getPageSize() != other.getPageSize()) return false; if (!getPageToken().equals(other.getPageToken())) return false; + if (getReturnPartialSuccess() != other.getReturnPartialSuccess()) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -331,6 +366,8 @@ public int hashCode() { hash = (53 * hash) + getPageSize(); hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + RETURN_PARTIAL_SUCCESS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getReturnPartialSuccess()); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -476,6 +513,7 @@ public Builder clear() { filter_ = ""; pageSize_ = 0; pageToken_ = ""; + returnPartialSuccess_ = false; return this; } @@ -524,6 +562,9 @@ private void buildPartial0(com.google.longrunning.ListOperationsRequest result) if (((from_bitField0_ & 0x00000008) != 0)) { result.pageToken_ = pageToken_; } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.returnPartialSuccess_ = returnPartialSuccess_; + } } @java.lang.Override @@ -589,6 +630,9 @@ public Builder mergeFrom(com.google.longrunning.ListOperationsRequest other) { bitField0_ |= 0x00000008; onChanged(); } + if (other.getReturnPartialSuccess() != false) { + setReturnPartialSuccess(other.getReturnPartialSuccess()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -639,6 +683,12 @@ public Builder mergeFrom( bitField0_ |= 0x00000001; break; } // case 34 + case 40: + { + returnPartialSuccess_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1047,6 +1097,89 @@ public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { return this; } + private boolean returnPartialSuccess_; + + /** + * + * + *
+     * When set to `true`, operations that are reachable are returned as normal,
+     * and those that are unreachable are returned in the
+     * [ListOperationsResponse.unreachable] field.
+     *
+     * This can only be `true` when reading across collections e.g. when `parent`
+     * is set to `"projects/example/locations/-"`.
+     *
+     * This field is not by default supported and will result in an
+     * `UNIMPLEMENTED` error if set unless explicitly documented otherwise in
+     * service or product specific documentation.
+     * 
+ * + * bool return_partial_success = 5; + * + * @return The returnPartialSuccess. + */ + @java.lang.Override + public boolean getReturnPartialSuccess() { + return returnPartialSuccess_; + } + + /** + * + * + *
+     * When set to `true`, operations that are reachable are returned as normal,
+     * and those that are unreachable are returned in the
+     * [ListOperationsResponse.unreachable] field.
+     *
+     * This can only be `true` when reading across collections e.g. when `parent`
+     * is set to `"projects/example/locations/-"`.
+     *
+     * This field is not by default supported and will result in an
+     * `UNIMPLEMENTED` error if set unless explicitly documented otherwise in
+     * service or product specific documentation.
+     * 
+ * + * bool return_partial_success = 5; + * + * @param value The returnPartialSuccess to set. + * @return This builder for chaining. + */ + public Builder setReturnPartialSuccess(boolean value) { + + returnPartialSuccess_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * When set to `true`, operations that are reachable are returned as normal,
+     * and those that are unreachable are returned in the
+     * [ListOperationsResponse.unreachable] field.
+     *
+     * This can only be `true` when reading across collections e.g. when `parent`
+     * is set to `"projects/example/locations/-"`.
+     *
+     * This field is not by default supported and will result in an
+     * `UNIMPLEMENTED` error if set unless explicitly documented otherwise in
+     * service or product specific documentation.
+     * 
+ * + * bool return_partial_success = 5; + * + * @return This builder for chaining. + */ + public Builder clearReturnPartialSuccess() { + bitField0_ = (bitField0_ & ~0x00000010); + returnPartialSuccess_ = false; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/ListOperationsRequestOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/ListOperationsRequestOrBuilder.java index d202042b9f..2d6b5d3f2a 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/ListOperationsRequestOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/ListOperationsRequestOrBuilder.java @@ -114,4 +114,26 @@ public interface ListOperationsRequestOrBuilder * @return The bytes for pageToken. */ com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * When set to `true`, operations that are reachable are returned as normal,
+   * and those that are unreachable are returned in the
+   * [ListOperationsResponse.unreachable] field.
+   *
+   * This can only be `true` when reading across collections e.g. when `parent`
+   * is set to `"projects/example/locations/-"`.
+   *
+   * This field is not by default supported and will result in an
+   * `UNIMPLEMENTED` error if set unless explicitly documented otherwise in
+   * service or product specific documentation.
+   * 
+ * + * bool return_partial_success = 5; + * + * @return The returnPartialSuccess. + */ + boolean getReturnPartialSuccess(); } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/ListOperationsResponse.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/ListOperationsResponse.java index 9941cb4a90..23a021ea53 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/ListOperationsResponse.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/ListOperationsResponse.java @@ -43,6 +43,7 @@ private ListOperationsResponse(com.google.protobuf.GeneratedMessageV3.Builder private ListOperationsResponse() { operations_ = java.util.Collections.emptyList(); nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.emptyList(); } @java.lang.Override @@ -195,6 +196,86 @@ public com.google.protobuf.ByteString getNextPageTokenBytes() { } } + public static final int UNREACHABLE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList unreachable_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+   * Unordered list. Unreachable resources. Populated when the request sets
+   * `ListOperationsRequest.return_partial_success` and reads across
+   * collections e.g. when attempting to list all resources across all supported
+   * locations.
+   * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_; + } + + /** + * + * + *
+   * Unordered list. Unreachable resources. Populated when the request sets
+   * `ListOperationsRequest.return_partial_success` and reads across
+   * collections e.g. when attempting to list all resources across all supported
+   * locations.
+   * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + + /** + * + * + *
+   * Unordered list. Unreachable resources. Populated when the request sets
+   * `ListOperationsRequest.return_partial_success` and reads across
+   * collections e.g. when attempting to list all resources across all supported
+   * locations.
+   * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + + /** + * + * + *
+   * Unordered list. Unreachable resources. Populated when the request sets
+   * `ListOperationsRequest.return_partial_success` and reads across
+   * collections e.g. when attempting to list all resources across all supported
+   * locations.
+   * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -215,6 +296,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); } + for (int i = 0; i < unreachable_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, unreachable_.getRaw(i)); + } getUnknownFields().writeTo(output); } @@ -230,6 +314,14 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); } + { + int dataSize = 0; + for (int i = 0; i < unreachable_.size(); i++) { + dataSize += computeStringSizeNoTag(unreachable_.getRaw(i)); + } + size += dataSize; + size += 1 * getUnreachableList().size(); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -248,6 +340,7 @@ public boolean equals(final java.lang.Object obj) { if (!getOperationsList().equals(other.getOperationsList())) return false; if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnreachableList().equals(other.getUnreachableList())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -265,6 +358,10 @@ public int hashCode() { } hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; hash = (53 * hash) + getNextPageToken().hashCode(); + if (getUnreachableCount() > 0) { + hash = (37 * hash) + UNREACHABLE_FIELD_NUMBER; + hash = (53 * hash) + getUnreachableList().hashCode(); + } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -414,6 +511,7 @@ public Builder clear() { } bitField0_ = (bitField0_ & ~0x00000001); nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.emptyList(); return this; } @@ -466,6 +564,10 @@ private void buildPartial0(com.google.longrunning.ListOperationsResponse result) if (((from_bitField0_ & 0x00000002) != 0)) { result.nextPageToken_ = nextPageToken_; } + if (((from_bitField0_ & 0x00000004) != 0)) { + unreachable_.makeImmutable(); + result.unreachable_ = unreachable_; + } } @java.lang.Override @@ -545,6 +647,16 @@ public Builder mergeFrom(com.google.longrunning.ListOperationsResponse other) { bitField0_ |= 0x00000002; onChanged(); } + if (!other.unreachable_.isEmpty()) { + if (unreachable_.isEmpty()) { + unreachable_ = other.unreachable_; + bitField0_ |= 0x00000004; + } else { + ensureUnreachableIsMutable(); + unreachable_.addAll(other.unreachable_); + } + onChanged(); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -589,6 +701,13 @@ public Builder mergeFrom( bitField0_ |= 0x00000002; break; } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureUnreachableIsMutable(); + unreachable_.add(s); + break; + } // case 26 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -1084,6 +1203,216 @@ public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { return this; } + private com.google.protobuf.LazyStringArrayList unreachable_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureUnreachableIsMutable() { + if (!unreachable_.isModifiable()) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(unreachable_); + } + bitField0_ |= 0x00000004; + } + + /** + * + * + *
+     * Unordered list. Unreachable resources. Populated when the request sets
+     * `ListOperationsRequest.return_partial_success` and reads across
+     * collections e.g. when attempting to list all resources across all supported
+     * locations.
+     * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + unreachable_.makeImmutable(); + return unreachable_; + } + + /** + * + * + *
+     * Unordered list. Unreachable resources. Populated when the request sets
+     * `ListOperationsRequest.return_partial_success` and reads across
+     * collections e.g. when attempting to list all resources across all supported
+     * locations.
+     * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + + /** + * + * + *
+     * Unordered list. Unreachable resources. Populated when the request sets
+     * `ListOperationsRequest.return_partial_success` and reads across
+     * collections e.g. when attempting to list all resources across all supported
+     * locations.
+     * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + + /** + * + * + *
+     * Unordered list. Unreachable resources. Populated when the request sets
+     * `ListOperationsRequest.return_partial_success` and reads across
+     * collections e.g. when attempting to list all resources across all supported
+     * locations.
+     * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + + /** + * + * + *
+     * Unordered list. Unreachable resources. Populated when the request sets
+     * `ListOperationsRequest.return_partial_success` and reads across
+     * collections e.g. when attempting to list all resources across all supported
+     * locations.
+     * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * @param index The index to set the value at. + * @param value The unreachable to set. + * @return This builder for chaining. + */ + public Builder setUnreachable(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.set(index, value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Unordered list. Unreachable resources. Populated when the request sets
+     * `ListOperationsRequest.return_partial_success` and reads across
+     * collections e.g. when attempting to list all resources across all supported
+     * locations.
+     * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * @param value The unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachable(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Unordered list. Unreachable resources. Populated when the request sets
+     * `ListOperationsRequest.return_partial_success` and reads across
+     * collections e.g. when attempting to list all resources across all supported
+     * locations.
+     * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * @param values The unreachable to add. + * @return This builder for chaining. + */ + public Builder addAllUnreachable(java.lang.Iterable values) { + ensureUnreachableIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, unreachable_); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Unordered list. Unreachable resources. Populated when the request sets
+     * `ListOperationsRequest.return_partial_success` and reads across
+     * collections e.g. when attempting to list all resources across all supported
+     * locations.
+     * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * @return This builder for chaining. + */ + public Builder clearUnreachable() { + unreachable_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + ; + onChanged(); + return this; + } + + /** + * + * + *
+     * Unordered list. Unreachable resources. Populated when the request sets
+     * `ListOperationsRequest.return_partial_success` and reads across
+     * collections e.g. when attempting to list all resources across all supported
+     * locations.
+     * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * @param value The bytes of the unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachableBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureUnreachableIsMutable(); + unreachable_.add(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/ListOperationsResponseOrBuilder.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/ListOperationsResponseOrBuilder.java index 4cde056b84..9a1f526dc1 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/ListOperationsResponseOrBuilder.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/ListOperationsResponseOrBuilder.java @@ -104,4 +104,70 @@ public interface ListOperationsResponseOrBuilder * @return The bytes for nextPageToken. */ com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * Unordered list. Unreachable resources. Populated when the request sets
+   * `ListOperationsRequest.return_partial_success` and reads across
+   * collections e.g. when attempting to list all resources across all supported
+   * locations.
+   * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * @return A list containing the unreachable. + */ + java.util.List getUnreachableList(); + + /** + * + * + *
+   * Unordered list. Unreachable resources. Populated when the request sets
+   * `ListOperationsRequest.return_partial_success` and reads across
+   * collections e.g. when attempting to list all resources across all supported
+   * locations.
+   * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * @return The count of unreachable. + */ + int getUnreachableCount(); + + /** + * + * + *
+   * Unordered list. Unreachable resources. Populated when the request sets
+   * `ListOperationsRequest.return_partial_success` and reads across
+   * collections e.g. when attempting to list all resources across all supported
+   * locations.
+   * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + java.lang.String getUnreachable(int index); + + /** + * + * + *
+   * Unordered list. Unreachable resources. Populated when the request sets
+   * `ListOperationsRequest.return_partial_success` and reads across
+   * collections e.g. when attempting to list all resources across all supported
+   * locations.
+   * 
+ * + * repeated string unreachable = 3 [(.google.api.field_behavior) = UNORDERED_LIST]; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + com.google.protobuf.ByteString getUnreachableBytes(int index); } diff --git a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/OperationsProto.java b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/OperationsProto.java index ce8f7d989b..da06945f1a 100644 --- a/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/OperationsProto.java +++ b/java-common-protos/proto-google-common-protos/src/main/java/com/google/longrunning/OperationsProto.java @@ -94,53 +94,61 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { static { java.lang.String[] descriptorData = { - "\n#google/longrunning/operations.proto\022\022g" + "\n" + + "#google/longrunning/operations.proto\022\022g" + "oogle.longrunning\032\034google/api/annotation" - + "s.proto\032\027google/api/client.proto\032\031google" - + "/protobuf/any.proto\032 google/protobuf/des" - + "criptor.proto\032\036google/protobuf/duration." - + "proto\032\033google/protobuf/empty.proto\032\027goog" - + "le/rpc/status.proto\"\250\001\n\tOperation\022\014\n\004nam" - + "e\030\001 \001(\t\022&\n\010metadata\030\002 \001(\0132\024.google.proto" - + "buf.Any\022\014\n\004done\030\003 \001(\010\022#\n\005error\030\004 \001(\0132\022.g" - + "oogle.rpc.StatusH\000\022(\n\010response\030\005 \001(\0132\024.g" - + "oogle.protobuf.AnyH\000B\010\n\006result\"#\n\023GetOpe" - + "rationRequest\022\014\n\004name\030\001 \001(\t\"\\\n\025ListOpera" - + "tionsRequest\022\014\n\004name\030\004 \001(\t\022\016\n\006filter\030\001 \001" - + "(\t\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(" - + "\t\"d\n\026ListOperationsResponse\0221\n\noperation" - + "s\030\001 \003(\0132\035.google.longrunning.Operation\022\027" - + "\n\017next_page_token\030\002 \001(\t\"&\n\026CancelOperati" - + "onRequest\022\014\n\004name\030\001 \001(\t\"&\n\026DeleteOperati" - + "onRequest\022\014\n\004name\030\001 \001(\t\"P\n\024WaitOperation" - + "Request\022\014\n\004name\030\001 \001(\t\022*\n\007timeout\030\002 \001(\0132\031" - + ".google.protobuf.Duration\"=\n\rOperationIn" - + "fo\022\025\n\rresponse_type\030\001 \001(\t\022\025\n\rmetadata_ty" - + "pe\030\002 \001(\t2\252\005\n\nOperations\022\224\001\n\016ListOperatio" - + "ns\022).google.longrunning.ListOperationsRe" - + "quest\032*.google.longrunning.ListOperation" - + "sResponse\"+\332A\013name,filter\202\323\344\223\002\027\022\025/v1/{na" - + "me=operations}\022\177\n\014GetOperation\022\'.google." - + "longrunning.GetOperationRequest\032\035.google" - + ".longrunning.Operation\"\'\332A\004name\202\323\344\223\002\032\022\030/" - + "v1/{name=operations/**}\022~\n\017DeleteOperati" - + "on\022*.google.longrunning.DeleteOperationR" - + "equest\032\026.google.protobuf.Empty\"\'\332A\004name\202" - + "\323\344\223\002\032*\030/v1/{name=operations/**}\022\210\001\n\017Canc" - + "elOperation\022*.google.longrunning.CancelO" - + "perationRequest\032\026.google.protobuf.Empty\"" - + "1\332A\004name\202\323\344\223\002$\"\037/v1/{name=operations/**}" - + ":cancel:\001*\022Z\n\rWaitOperation\022(.google.lon" - + "grunning.WaitOperationRequest\032\035.google.l" - + "ongrunning.Operation\"\000\032\035\312A\032longrunning.g" - + "oogleapis.com:Z\n\016operation_info\022\036.google" - + ".protobuf.MethodOptions\030\231\010 \001(\0132!.google." - + "longrunning.OperationInfoB\245\001\n\026com.google" - + ".longrunningB\017OperationsProtoP\001ZCcloud.g" - + "oogle.com/go/longrunning/autogen/longrun" - + "ningpb;longrunningpb\370\001\001\242\002\005GLRUN\252\002\022Google" - + ".LongRunning\312\002\022Google\\LongRunningb\006proto" - + "3" + + "s.proto\032\027google/api/client.proto\032\037google" + + "/api/field_behavior.proto\032\031google/protobuf/any.proto\032" + + " google/protobuf/descriptor.proto\032\036google/protobuf/duration.proto\032\033" + + "google/protobuf/empty.proto\032\027google/rpc/status.proto\"\250\001\n" + + "\tOperation\022\014\n" + + "\004name\030\001 \001(\t\022&\n" + + "\010metadata\030\002 \001(\0132\024.google.protobuf.Any\022\014\n" + + "\004done\030\003 \001(\010\022#\n" + + "\005error\030\004 \001(\0132\022.google.rpc.StatusH\000\022(\n" + + "\010response\030\005 \001(\0132\024.google.protobuf.AnyH\000B\010\n" + + "\006result\"#\n" + + "\023GetOperationRequest\022\014\n" + + "\004name\030\001 \001(\t\"|\n" + + "\025ListOperationsRequest\022\014\n" + + "\004name\030\004 \001(\t\022\016\n" + + "\006filter\030\001 \001(\t\022\021\n" + + "\tpage_size\030\002 \001(\005\022\022\n\n" + + "page_token\030\003 \001(\t\022\036\n" + + "\026return_partial_success\030\005 \001(\010\"~\n" + + "\026ListOperationsResponse\0221\n\n" + + "operations\030\001 \003(\0132\035.google.longrunning.Operation\022\027\n" + + "\017next_page_token\030\002 \001(\t\022\030\n" + + "\013unreachable\030\003 \003(\tB\003\340A\006\"&\n" + + "\026CancelOperationRequest\022\014\n" + + "\004name\030\001 \001(\t\"&\n" + + "\026DeleteOperationRequest\022\014\n" + + "\004name\030\001 \001(\t\"P\n" + + "\024WaitOperationRequest\022\014\n" + + "\004name\030\001 \001(\t\022*\n" + + "\007timeout\030\002 \001(\0132\031.google.protobuf.Duration\"=\n\r" + + "OperationInfo\022\025\n\r" + + "response_type\030\001 \001(\t\022\025\n\r" + + "metadata_type\030\002 \001(\t2\252\005\n\n" + + "Operations\022\224\001\n" + + "\016ListOperations\022).google.longrunning.ListO" + + "perationsRequest\032*.google.longrunning.Li" + + "stOperationsResponse\"+\332A\013name,filter\202\323\344\223\002\027\022\025/v1/{name=operations}\022\177\n" + + "\014GetOperation\022\'.google.longrunning.GetOperationReque" + + "st\032\035.google.longrunning.Operation\"\'\332A\004name\202\323\344\223\002\032\022\030/v1/{name=operations/**}\022~\n" + + "\017DeleteOperation\022*.google.longrunning.Delet" + + "eOperationRequest\032\026.google.protobuf.Empt" + + "y\"\'\332A\004name\202\323\344\223\002\032*\030/v1/{name=operations/**}\022\210\001\n" + + "\017CancelOperation\022*.google.longrunning.CancelOperationRequest\032\026.google.prot" + + "obuf.Empty\"1\332A\004name\202\323\344\223\002$\"\037/v1/{name=operations/**}:cancel:\001*\022Z\n\r" + + "WaitOperation\022(.google.longrunning.WaitOperationRequest" + + "\032\035.google.longrunning.Operation\"\000\032\035\312A\032longrunning.googleapis.com:Z\n" + + "\016operation_info\022\036.google.protobuf.MethodOptions\030\231\010" + + " \001(\0132!.google.longrunning.OperationInfoB\242\001\n" + + "\026com.google.longrunningB\017OperationsProto" + + "P\001ZCcloud.google.com/go/longrunning/auto" + + "gen/longrunningpb;longrunningpb\242\002\005GLRUN\252" + + "\002\022Google.LongRunning\312\002\022Google\\LongRunningb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -148,6 +156,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.Descriptors.FileDescriptor[] { com.google.api.AnnotationsProto.getDescriptor(), com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), com.google.protobuf.AnyProto.getDescriptor(), com.google.protobuf.DescriptorProtos.getDescriptor(), com.google.protobuf.DurationProto.getDescriptor(), @@ -176,7 +185,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_longrunning_ListOperationsRequest_descriptor, new java.lang.String[] { - "Name", "Filter", "PageSize", "PageToken", + "Name", "Filter", "PageSize", "PageToken", "ReturnPartialSuccess", }); internal_static_google_longrunning_ListOperationsResponse_descriptor = getDescriptor().getMessageTypes().get(3); @@ -184,7 +193,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_longrunning_ListOperationsResponse_descriptor, new java.lang.String[] { - "Operations", "NextPageToken", + "Operations", "NextPageToken", "Unreachable", }); internal_static_google_longrunning_CancelOperationRequest_descriptor = getDescriptor().getMessageTypes().get(4); @@ -222,12 +231,14 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.protobuf.ExtensionRegistry registry = com.google.protobuf.ExtensionRegistry.newInstance(); registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); registry.add(com.google.api.AnnotationsProto.http); registry.add(com.google.api.ClientProto.methodSignature); com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( descriptor, registry); com.google.api.AnnotationsProto.getDescriptor(); com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); com.google.protobuf.AnyProto.getDescriptor(); com.google.protobuf.DescriptorProtos.getDescriptor(); com.google.protobuf.DurationProto.getDescriptor(); diff --git a/java-common-protos/proto-google-common-protos/src/main/proto/google/longrunning/operations.proto b/java-common-protos/proto-google-common-protos/src/main/proto/google/longrunning/operations.proto index e0206a9061..63df207d25 100644 --- a/java-common-protos/proto-google-common-protos/src/main/proto/google/longrunning/operations.proto +++ b/java-common-protos/proto-google-common-protos/src/main/proto/google/longrunning/operations.proto @@ -18,13 +18,13 @@ package google.longrunning; import "google/api/annotations.proto"; import "google/api/client.proto"; +import "google/api/field_behavior.proto"; import "google/protobuf/any.proto"; import "google/protobuf/descriptor.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/empty.proto"; import "google/rpc/status.proto"; -option cc_enable_arenas = true; option csharp_namespace = "Google.LongRunning"; option go_package = "cloud.google.com/go/longrunning/autogen/longrunningpb;longrunningpb"; option java_multiple_files = true; @@ -176,6 +176,18 @@ message ListOperationsRequest { // The standard list page token. string page_token = 3; + + // When set to `true`, operations that are reachable are returned as normal, + // and those that are unreachable are returned in the + // [ListOperationsResponse.unreachable] field. + // + // This can only be `true` when reading across collections e.g. when `parent` + // is set to `"projects/example/locations/-"`. + // + // This field is not by default supported and will result in an + // `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + // service or product specific documentation. + bool return_partial_success = 5; } // The response message for @@ -186,6 +198,13 @@ message ListOperationsResponse { // The standard List next-page token. string next_page_token = 2; + + // Unordered list. Unreachable resources. Populated when the request sets + // `ListOperationsRequest.return_partial_success` and reads across + // collections e.g. when attempting to list all resources across all supported + // locations. + repeated string unreachable = 3 + [(google.api.field_behavior) = UNORDERED_LIST]; } // The request message for diff --git a/java-core/google-cloud-core-bom/pom.xml b/java-core/google-cloud-core-bom/pom.xml index 5cf978d64e..43899f26fd 100644 --- a/java-core/google-cloud-core-bom/pom.xml +++ b/java-core/google-cloud-core-bom/pom.xml @@ -3,13 +3,13 @@ 4.0.0 com.google.cloud google-cloud-core-bom - 2.60.3 + 2.61.0 pom com.google.api gapic-generator-java-pom-parent - 2.62.3 + 2.63.0 ../../gapic-generator-java-pom-parent @@ -23,17 +23,17 @@ com.google.cloud google-cloud-core - 2.60.3 + 2.61.0 com.google.cloud google-cloud-core-grpc - 2.60.3 + 2.61.0 com.google.cloud google-cloud-core-http - 2.60.3 + 2.61.0
diff --git a/java-core/google-cloud-core-grpc/pom.xml b/java-core/google-cloud-core-grpc/pom.xml index ab19ef318e..f2c33fd668 100644 --- a/java-core/google-cloud-core-grpc/pom.xml +++ b/java-core/google-cloud-core-grpc/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-core-grpc - 2.60.3 + 2.61.0 jar Google Cloud Core gRPC @@ -12,7 +12,7 @@ com.google.cloud google-cloud-core-parent - 2.60.3 + 2.61.0 google-cloud-core-grpc diff --git a/java-core/google-cloud-core-http/pom.xml b/java-core/google-cloud-core-http/pom.xml index a7439fc229..42e071e8ff 100644 --- a/java-core/google-cloud-core-http/pom.xml +++ b/java-core/google-cloud-core-http/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-core-http - 2.60.3 + 2.61.0 jar Google Cloud Core HTTP @@ -12,7 +12,7 @@ com.google.cloud google-cloud-core-parent - 2.60.3 + 2.61.0 google-cloud-core-http diff --git a/java-core/google-cloud-core/pom.xml b/java-core/google-cloud-core/pom.xml index bbb01c42e2..812aa3311b 100644 --- a/java-core/google-cloud-core/pom.xml +++ b/java-core/google-cloud-core/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-core - 2.60.3 + 2.61.0 jar Google Cloud Core @@ -12,7 +12,7 @@ com.google.cloud google-cloud-core-parent - 2.60.3 + 2.61.0 google-cloud-core diff --git a/java-core/google-cloud-core/src/test/java/com/google/cloud/ServiceOptionsTest.java b/java-core/google-cloud-core/src/test/java/com/google/cloud/ServiceOptionsTest.java index e4d22d9b5f..eb8eab37b2 100644 --- a/java-core/google-cloud-core/src/test/java/com/google/cloud/ServiceOptionsTest.java +++ b/java-core/google-cloud-core/src/test/java/com/google/cloud/ServiceOptionsTest.java @@ -38,6 +38,7 @@ import com.google.api.core.ApiClock; import com.google.api.core.CurrentMillisClock; import com.google.auth.oauth2.GoogleCredentials; +import com.google.auth.oauth2.ServiceAccountCredentials; import com.google.cloud.spi.ServiceRpcFactory; import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.Multimap; @@ -58,7 +59,7 @@ class ServiceOptionsTest { private static GoogleCredentials credentialsWithQuotaProject; private static GoogleCredentials credentialsNotInGDU; - private static final String JSON_KEY = + private static final String SA_JSON_KEY = "{\n" + " \"private_key_id\": \"somekeyid\",\n" + " \"private_key\": \"-----BEGIN PRIVATE KEY-----\\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggS" @@ -87,7 +88,7 @@ class ServiceOptionsTest { + " \"universe_domain\": \"googleapis.com\"\n" + "}"; - private static final String JSON_KEY_PROJECT_ID = + private static final String SA_JSON_KEY_PROJECT_ID = "{\n" + " \"private_key_id\": \"somekeyid\",\n" + " \"private_key\": \"-----BEGIN PRIVATE KEY-----\\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggS" @@ -117,7 +118,7 @@ class ServiceOptionsTest { + " \"universe_domain\": \"googleapis.com\"\n" + "}"; - private static final String JSON_KEY_QUOTA_PROJECT_ID = + private static final String SA_JSON_KEY_QUOTA_PROJECT_ID = "{\n" + " \"private_key_id\": \"somekeyid\",\n" + " \"private_key\": \"-----BEGIN PRIVATE KEY-----\\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggS" @@ -149,7 +150,7 @@ class ServiceOptionsTest { + "}"; // Key added by copying the keys above and adding in the universe domain field - private static final String JSON_KEY_NON_GDU = + private static final String SA_JSON_KEY_NON_GDU = "{\n" + " \"private_key_id\": \"somekeyid\",\n" + " \"private_key\": \"-----BEGIN PRIVATE KEY-----\\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggS" @@ -179,16 +180,16 @@ class ServiceOptionsTest { + "}"; static { - credentials = loadCredentials(JSON_KEY); - credentialsWithProjectId = loadCredentials(JSON_KEY_PROJECT_ID); - credentialsWithQuotaProject = loadCredentials(JSON_KEY_QUOTA_PROJECT_ID); - credentialsNotInGDU = loadCredentials(JSON_KEY_NON_GDU); + credentials = loadServiceAccountCredentials(SA_JSON_KEY); + credentialsWithProjectId = loadServiceAccountCredentials(SA_JSON_KEY_PROJECT_ID); + credentialsWithQuotaProject = loadServiceAccountCredentials(SA_JSON_KEY_QUOTA_PROJECT_ID); + credentialsNotInGDU = loadServiceAccountCredentials(SA_JSON_KEY_NON_GDU); } - static GoogleCredentials loadCredentials(String credentialFile) { + static GoogleCredentials loadServiceAccountCredentials(String credentialFile) { try { InputStream keyStream = new ByteArrayInputStream(credentialFile.getBytes()); - return GoogleCredentials.fromStream(keyStream); + return ServiceAccountCredentials.fromStream(keyStream); } catch (IOException e) { fail("Couldn't create fake JSON credentials."); } diff --git a/java-core/pom.xml b/java-core/pom.xml index b457528c0a..a5ddadf318 100644 --- a/java-core/pom.xml +++ b/java-core/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-core-parent pom - 2.60.3 + 2.61.0 Google Cloud Core Parent Java idiomatic client for Google Cloud Platform services. @@ -13,7 +13,7 @@ com.google.api gapic-generator-java-pom-parent - 2.62.3 + 2.63.0 ../gapic-generator-java-pom-parent @@ -33,7 +33,7 @@ com.google.cloud google-cloud-shared-dependencies - 3.52.3 + 3.53.0 pom import diff --git a/java-iam/grpc-google-iam-v1/pom.xml b/java-iam/grpc-google-iam-v1/pom.xml index 2572679786..c896e07042 100644 --- a/java-iam/grpc-google-iam-v1/pom.xml +++ b/java-iam/grpc-google-iam-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-iam-v1 - 1.56.3 + 1.57.0 grpc-google-iam-v1 GRPC library for grpc-google-iam-v1 com.google.cloud google-iam-parent - 1.56.3 + 1.57.0 diff --git a/java-iam/grpc-google-iam-v2/pom.xml b/java-iam/grpc-google-iam-v2/pom.xml index 5ec6bdaa5e..3de3213115 100644 --- a/java-iam/grpc-google-iam-v2/pom.xml +++ b/java-iam/grpc-google-iam-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-iam-v2 - 1.56.3 + 1.57.0 grpc-google-iam-v2 GRPC library for proto-google-iam-v2 com.google.cloud google-iam-parent - 1.56.3 + 1.57.0 diff --git a/java-iam/grpc-google-iam-v2beta/pom.xml b/java-iam/grpc-google-iam-v2beta/pom.xml index 3e17446c0a..8fcc7212e2 100644 --- a/java-iam/grpc-google-iam-v2beta/pom.xml +++ b/java-iam/grpc-google-iam-v2beta/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-iam-v2beta - 1.56.3 + 1.57.0 grpc-google-iam-v2beta GRPC library for proto-google-iam-v1 com.google.cloud google-iam-parent - 1.56.3 + 1.57.0 diff --git a/java-iam/grpc-google-iam-v3/pom.xml b/java-iam/grpc-google-iam-v3/pom.xml index 9e3379b65b..d196e3b742 100644 --- a/java-iam/grpc-google-iam-v3/pom.xml +++ b/java-iam/grpc-google-iam-v3/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-iam-v3 - 1.56.3 + 1.57.0 grpc-google-iam-v3 GRPC library for proto-google-iam-v3 com.google.cloud google-iam-parent - 1.56.3 + 1.57.0 diff --git a/java-iam/grpc-google-iam-v3beta/pom.xml b/java-iam/grpc-google-iam-v3beta/pom.xml index ea1d7dc9b1..131a36d087 100644 --- a/java-iam/grpc-google-iam-v3beta/pom.xml +++ b/java-iam/grpc-google-iam-v3beta/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-iam-v3beta - 1.56.3 + 1.57.0 grpc-google-iam-v3beta GRPC library for proto-google-iam-v3beta com.google.cloud google-iam-parent - 1.56.3 + 1.57.0 diff --git a/java-iam/pom.xml b/java-iam/pom.xml index af9beec3a2..9daf64a62e 100644 --- a/java-iam/pom.xml +++ b/java-iam/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-iam-parent pom - 1.56.3 + 1.57.0 Google IAM Parent Java idiomatic client for Google Cloud Platform services. @@ -13,7 +13,7 @@ com.google.api gapic-generator-java-pom-parent - 2.62.3 + 2.63.0 ../gapic-generator-java-pom-parent @@ -50,19 +50,19 @@ com.google.cloud third-party-dependencies - 3.52.3 + 3.53.0 pom import com.google.api.grpc proto-google-iam-v3beta - 1.56.3 + 1.57.0 com.google.api.grpc grpc-google-iam-v3beta - 1.56.3 + 1.57.0 com.google.guava @@ -88,59 +88,59 @@ com.google.api gax-bom - 2.70.3 + 2.71.0 pom import com.google.api api-common - 2.53.3 + 2.54.0 com.google.api.grpc proto-google-iam-v2 - 1.56.3 + 1.57.0 com.google.api.grpc grpc-google-iam-v2 - 1.56.3 + 1.57.0 com.google.api.grpc proto-google-common-protos - 2.61.3 + 2.62.0 com.google.api.grpc proto-google-iam-v2beta - 1.56.3 + 1.57.0 com.google.api.grpc grpc-google-iam-v1 - 1.56.3 + 1.57.0 com.google.api.grpc grpc-google-iam-v2beta - 1.56.3 + 1.57.0 com.google.api.grpc proto-google-iam-v1 - 1.56.3 + 1.57.0 com.google.api.grpc proto-google-iam-v3 - 1.56.3 + 1.57.0 com.google.api.grpc grpc-google-iam-v3 - 1.56.3 + 1.57.0 javax.annotation diff --git a/java-iam/proto-google-iam-v1/pom.xml b/java-iam/proto-google-iam-v1/pom.xml index 9365b93b9f..60fd67a0c3 100644 --- a/java-iam/proto-google-iam-v1/pom.xml +++ b/java-iam/proto-google-iam-v1/pom.xml @@ -3,13 +3,13 @@ 4.0.0 com.google.api.grpc proto-google-iam-v1 - 1.56.3 + 1.57.0 proto-google-iam-v1 PROTO library for proto-google-iam-v1 com.google.cloud google-iam-parent - 1.56.3 + 1.57.0 diff --git a/java-iam/proto-google-iam-v2/pom.xml b/java-iam/proto-google-iam-v2/pom.xml index 416e537150..baae213ea9 100644 --- a/java-iam/proto-google-iam-v2/pom.xml +++ b/java-iam/proto-google-iam-v2/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-iam-v2 - 1.56.3 + 1.57.0 proto-google-iam-v2 Proto library for proto-google-iam-v1 com.google.cloud google-iam-parent - 1.56.3 + 1.57.0 diff --git a/java-iam/proto-google-iam-v2beta/pom.xml b/java-iam/proto-google-iam-v2beta/pom.xml index fad0116b59..976bc605b2 100644 --- a/java-iam/proto-google-iam-v2beta/pom.xml +++ b/java-iam/proto-google-iam-v2beta/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-iam-v2beta - 1.56.3 + 1.57.0 proto-google-iam-v2beta Proto library for proto-google-iam-v1 com.google.cloud google-iam-parent - 1.56.3 + 1.57.0 diff --git a/java-iam/proto-google-iam-v3/pom.xml b/java-iam/proto-google-iam-v3/pom.xml index 9795e6f936..7e0cb7c69c 100644 --- a/java-iam/proto-google-iam-v3/pom.xml +++ b/java-iam/proto-google-iam-v3/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-iam-v3 - 1.56.3 + 1.57.0 proto-google-iam-v3 Proto library for proto-google-iam-v3 com.google.cloud google-iam-parent - 1.56.3 + 1.57.0 diff --git a/java-iam/proto-google-iam-v3beta/pom.xml b/java-iam/proto-google-iam-v3beta/pom.xml index 526a2e77b4..4f73180ca2 100644 --- a/java-iam/proto-google-iam-v3beta/pom.xml +++ b/java-iam/proto-google-iam-v3beta/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-iam-v3beta - 1.56.3 + 1.57.0 proto-google-iam-v3beta Proto library for proto-google-iam-v3beta com.google.cloud google-iam-parent - 1.56.3 + 1.57.0 diff --git a/java-shared-dependencies/README.md b/java-shared-dependencies/README.md index 3c9aa1d3b2..b7d491e611 100644 --- a/java-shared-dependencies/README.md +++ b/java-shared-dependencies/README.md @@ -14,7 +14,7 @@ If you are using Maven, add this to the `dependencyManagement` section. com.google.cloud google-cloud-shared-dependencies - 3.52.3 + 3.53.0 pom import diff --git a/java-shared-dependencies/dependency-convergence-check/pom.xml b/java-shared-dependencies/dependency-convergence-check/pom.xml index fe768ed821..ff3014b556 100644 --- a/java-shared-dependencies/dependency-convergence-check/pom.xml +++ b/java-shared-dependencies/dependency-convergence-check/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud shared-dependencies-dependency-convergence-test - 3.52.3 + 3.53.0 Dependency convergence test for certain artifacts in Google Cloud Shared Dependencies An dependency convergence test case for the shared dependencies BOM. A failure of this test case means diff --git a/java-shared-dependencies/first-party-dependencies/pom.xml b/java-shared-dependencies/first-party-dependencies/pom.xml index ee5b3fc4b7..fe0f5cf8c9 100644 --- a/java-shared-dependencies/first-party-dependencies/pom.xml +++ b/java-shared-dependencies/first-party-dependencies/pom.xml @@ -6,7 +6,7 @@ com.google.cloud first-party-dependencies pom - 3.52.3 + 3.53.0 Google Cloud First-party Shared Dependencies Shared first-party dependencies for Google Cloud Java libraries. @@ -15,7 +15,7 @@ com.google.cloud google-cloud-shared-config - 1.16.1 + 1.17.0 @@ -33,7 +33,7 @@ com.google.api gapic-generator-java-bom - 2.62.3 + 2.63.0 pom import @@ -45,7 +45,7 @@ com.google.cloud google-cloud-core-bom - 2.60.3 + 2.61.0 pom import @@ -69,13 +69,13 @@ com.google.cloud google-cloud-core - 2.60.3 + 2.61.0 test-jar com.google.cloud google-cloud-core - 2.60.3 + 2.61.0 tests diff --git a/java-shared-dependencies/pom.xml b/java-shared-dependencies/pom.xml index d2277abbab..f0a17e2e01 100644 --- a/java-shared-dependencies/pom.xml +++ b/java-shared-dependencies/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-shared-dependencies pom - 3.52.3 + 3.53.0 first-party-dependencies third-party-dependencies @@ -17,7 +17,7 @@ com.google.api gapic-generator-java-pom-parent - 2.62.3 + 2.63.0 ../gapic-generator-java-pom-parent @@ -31,14 +31,14 @@ com.google.cloud first-party-dependencies - 3.52.3 + 3.53.0 pom import com.google.cloud third-party-dependencies - 3.52.3 + 3.53.0 pom import diff --git a/java-shared-dependencies/third-party-dependencies/pom.xml b/java-shared-dependencies/third-party-dependencies/pom.xml index 0428ccbeb3..7d606d99ec 100644 --- a/java-shared-dependencies/third-party-dependencies/pom.xml +++ b/java-shared-dependencies/third-party-dependencies/pom.xml @@ -6,7 +6,7 @@ com.google.cloud third-party-dependencies pom - 3.52.3 + 3.53.0 Google Cloud Third-party Shared Dependencies Shared third-party dependencies for Google Cloud Java libraries. @@ -15,7 +15,7 @@ com.google.api gapic-generator-java-pom-parent - 2.62.3 + 2.63.0 ../../gapic-generator-java-pom-parent @@ -28,7 +28,6 @@ 0.31.1 3.0.2 2.18.2 - 2.38.0 1.18.0 4.4.16 4.5.14 @@ -37,7 +36,6 @@ 3.49.0 0.27.0 - 3.0.0 0.33.0 2.1.0-alpha 1.29.0-alpha diff --git a/java-shared-dependencies/upper-bound-check/pom.xml b/java-shared-dependencies/upper-bound-check/pom.xml index c3db12c20d..e7e64bd29e 100644 --- a/java-shared-dependencies/upper-bound-check/pom.xml +++ b/java-shared-dependencies/upper-bound-check/pom.xml @@ -4,7 +4,7 @@ com.google.cloud shared-dependencies-upper-bound-test pom - 3.52.3 + 3.53.0 Upper bound test for Google Cloud Shared Dependencies An upper bound test case for the shared dependencies BOM. A failure of this test case means @@ -16,7 +16,7 @@ com.google.cloud google-cloud-shared-config - 1.16.1 + 1.17.0 @@ -30,7 +30,7 @@ com.google.cloud google-cloud-shared-dependencies - 3.52.3 + 3.53.0 pom import diff --git a/java-showcase/pom.xml b/java-showcase/pom.xml index 10a416f3c4..b8e9dd85aa 100644 --- a/java-showcase/pom.xml +++ b/java-showcase/pom.xml @@ -13,7 +13,7 @@ com.google.cloud google-cloud-shared-config - 1.16.1 + 1.17.0 @@ -32,7 +32,7 @@ com.google.cloud google-cloud-shared-dependencies - 3.52.3 + 3.53.0 pom import diff --git a/renovate.json b/renovate.json index ee4e763c36..a319663dbd 100644 --- a/renovate.json +++ b/renovate.json @@ -10,6 +10,12 @@ "^library_generation/requirements\\.txt$" ], "customManagers": [ + { + "customType": "regex", + "fileMatch": ["dependencies.txt"], + "matchStrings": ["(?.*),(.*)=(?.*)"], + "datasourceTemplate": "maven" + }, { "customType": "regex", "fileMatch": [ @@ -210,6 +216,16 @@ "matchPackageNames": [ "/^com.google.errorprone/" ] + }, + { + "matchManagers": [ + "regex" + ], + "semanticCommitType": "chore", + "matchFileNames": ["dependencies.txt"], + "matchDatasources": ["maven"], + "groupName": "Upper Bound Dependencies File", + "description": "Group all dependencies from the Upper Bound Dependencies File" } ] } diff --git a/sdk-platform-java-config/pom.xml b/sdk-platform-java-config/pom.xml index 8faa8b1db3..5ecba180d1 100644 --- a/sdk-platform-java-config/pom.xml +++ b/sdk-platform-java-config/pom.xml @@ -4,7 +4,7 @@ com.google.cloud sdk-platform-java-config pom - 3.52.3 + 3.53.0 SDK Platform For Java Configurations Shared build configuration for Google Cloud Java libraries. @@ -13,10 +13,10 @@ com.google.cloud google-cloud-shared-config - 1.16.1 + 1.17.0 - 3.52.3 + 3.53.0 \ No newline at end of file diff --git a/versions.txt b/versions.txt index 2236d5cabe..84ed82eddc 100644 --- a/versions.txt +++ b/versions.txt @@ -1,26 +1,26 @@ # Format: # module:released-version:current-version -gapic-generator-java:2.62.3:2.62.3 -api-common:2.53.3:2.53.3 -gax:2.70.3:2.70.3 -gax-grpc:2.70.3:2.70.3 -gax-httpjson:0.155.3:0.155.3 -proto-google-common-protos:2.61.3:2.61.3 -grpc-google-common-protos:2.61.3:2.61.3 -proto-google-iam-v1:1.56.3:1.56.3 -grpc-google-iam-v1:1.56.3:1.56.3 -proto-google-iam-v2beta:1.56.3:1.56.3 -grpc-google-iam-v2beta:1.56.3:1.56.3 -google-iam-policy:1.56.3:1.56.3 -proto-google-iam-v2:1.56.3:1.56.3 -grpc-google-iam-v2:1.56.3:1.56.3 -google-cloud-core:2.60.3:2.60.3 -google-cloud-shared-dependencies:3.52.3:3.52.3 -gapic-showcase:0.8.3:0.8.3 -proto-gapic-showcase-v1beta1:0.8.3:0.8.3 -grpc-gapic-showcase-v1beta1:0.8.3:0.8.3 -proto-google-iam-v3:1.56.3:1.56.3 -grpc-google-iam-v3:1.56.3:1.56.3 -proto-google-iam-v3beta:1.56.3:1.56.3 -grpc-google-iam-v3beta:1.56.3:1.56.3 +gapic-generator-java:2.63.0:2.63.0 +api-common:2.54.0:2.54.0 +gax:2.71.0:2.71.0 +gax-grpc:2.71.0:2.71.0 +gax-httpjson:0.156.0:0.156.0 +proto-google-common-protos:2.62.0:2.62.0 +grpc-google-common-protos:2.62.0:2.62.0 +proto-google-iam-v1:1.57.0:1.57.0 +grpc-google-iam-v1:1.57.0:1.57.0 +proto-google-iam-v2beta:1.57.0:1.57.0 +grpc-google-iam-v2beta:1.57.0:1.57.0 +google-iam-policy:1.57.0:1.57.0 +proto-google-iam-v2:1.57.0:1.57.0 +grpc-google-iam-v2:1.57.0:1.57.0 +google-cloud-core:2.61.0:2.61.0 +google-cloud-shared-dependencies:3.53.0:3.53.0 +gapic-showcase:0.9.0:0.9.0 +proto-gapic-showcase-v1beta1:0.9.0:0.9.0 +grpc-gapic-showcase-v1beta1:0.9.0:0.9.0 +proto-google-iam-v3:1.57.0:1.57.0 +grpc-google-iam-v3:1.57.0:1.57.0 +proto-google-iam-v3beta:1.57.0:1.57.0 +grpc-google-iam-v3beta:1.57.0:1.57.0