Skip to content

Commit

Permalink
feat: Regenerate latest version of the client with field presence sup…
Browse files Browse the repository at this point in the history
…port (#401)

Also add 7012 and 6003 backward compatibility check errors to ignorelist

This is totally expected, since it is an alpha client and both of those errors (`6003` - public constant value change, and `7012` - addition of a method to an interface) are expected given the underlying change. Specifially the `optional` keyword was added to `compute.proto`, which caused addition of `has<FieldName>()` methods to proto stubs and respective builders (error 7012). The field numbers change (error `6003`) was caused by the rollback of the previous hack (googleapis/googleapis-discovery#31) which, in its turn, was caused by a bug in protobuf.
  • Loading branch information
vam-google committed May 10, 2021
1 parent 7fd3107 commit 6e46502
Show file tree
Hide file tree
Showing 1,981 changed files with 237,076 additions and 84,534 deletions.
3 changes: 2 additions & 1 deletion .github/release-please.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
bumpMinorPreMajor: true
handleGHRelease: true
releaseType: java-yoshi
bumpMinorPreMajor: true
2 changes: 1 addition & 1 deletion .github/workflows/auto-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: auto-release
jobs:
approve:
runs-on: ubuntu-latest
if: contains(github.head_ref, 'release-v')
if: contains(github.head_ref, 'release-please')
steps:
- uses: actions/github-script@v3
with:
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ jobs:
with:
java-version: 8
- run: java -version
- run: .kokoro/linkage-monitor.sh
- name: Install artifacts to local Maven repository
run: .kokoro/build.sh
shell: bash
- name: Validate any conflicts with regard to com.google.cloud:libraries-bom (latest release)
uses: GoogleCloudPlatform/cloud-opensource-java/linkage-monitor@v1-linkagemonitor
lint:
runs-on: ubuntu-latest
steps:
Expand Down
15 changes: 11 additions & 4 deletions .kokoro/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ echo ${JOB_TYPE}

# attempt to install 3 times with exponential backoff (starting with 10 seconds)
retry_with_backoff 3 10 \
mvn install -B -V \
mvn install -B -V -ntp \
-DskipTests=true \
-Dclirr.skip=true \
-Denforcer.skip=true \
-Dmaven.javadoc.skip=true \
-Dgcloud.download.skip=true \
-T 1C

# if GOOGLE_APPLICATION_CREDIENTIALS is specified as a relative path prepend Kokoro root directory onto it
# if GOOGLE_APPLICATION_CREDENTIALS is specified as a relative path, prepend Kokoro root directory onto it
if [[ ! -z "${GOOGLE_APPLICATION_CREDENTIALS}" && "${GOOGLE_APPLICATION_CREDENTIALS}" != /* ]]; then
export GOOGLE_APPLICATION_CREDENTIALS=$(realpath ${KOKORO_GFILE_DIR}/${GOOGLE_APPLICATION_CREDENTIALS})
fi
Expand All @@ -60,6 +60,7 @@ javadoc)
;;
integration)
mvn -B ${INTEGRATION_TEST_ARGS} \
-ntp \
-Penable-integration-tests \
-DtrimStackTrace=false \
-Dclirr.skip=true \
Expand All @@ -78,9 +79,15 @@ samples)

if [[ -f ${SAMPLES_DIR}/pom.xml ]]
then
for FILE in ${KOKORO_GFILE_DIR}/secret_manager/*-samples-secrets; do
[[ -f "$FILE" ]] || continue
source "$FILE"
done

pushd ${SAMPLES_DIR}
mvn -B \
-Penable-samples \
-ntp \
-DtrimStackTrace=false \
-Dclirr.skip=true \
-Denforcer.skip=true \
Expand Down Expand Up @@ -110,8 +117,8 @@ bash .kokoro/coerce_logs.sh

if [[ "${ENABLE_BUILD_COP}" == "true" ]]
then
chmod +x ${KOKORO_GFILE_DIR}/linux_amd64/buildcop
${KOKORO_GFILE_DIR}/linux_amd64/buildcop -repo=googleapis/java-compute
chmod +x ${KOKORO_GFILE_DIR}/linux_amd64/flakybot
${KOKORO_GFILE_DIR}/linux_amd64/flakybot -repo=googleapis/java-compute
fi

echo "exiting with ${RETURN_CODE}"
Expand Down
5 changes: 3 additions & 2 deletions .kokoro/dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=128m"

# this should run maven enforcer
retry_with_backoff 3 10 \
mvn install -B -V \
mvn install -B -V -ntp \
-DskipTests=true \
-Dmaven.javadoc.skip=true \
-Dclirr.skip=true

mvn -B dependency:analyze -DfailOnWarning=true
Expand Down Expand Up @@ -86,4 +87,4 @@ then
else
msg "Errors found. See log statements above."
exit 1
fi
fi
6 changes: 0 additions & 6 deletions .kokoro/release/publish_javadoc.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@ env_vars: {
value: "docs-staging"
}

env_vars: {
key: "STAGING_BUCKET_V2"
value: "docs-staging-v2"
# Production will be at: docs-staging-v2
}

env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/java-compute/.kokoro/release/publish_javadoc.sh"
Expand Down
24 changes: 0 additions & 24 deletions .kokoro/release/publish_javadoc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ if [[ -z "${STAGING_BUCKET}" ]]; then
exit 1
fi

if [[ -z "${STAGING_BUCKET_V2}" ]]; then
echo "Need to set STAGING_BUCKET_V2 environment variable"
exit 1
fi

# work from the git root directory
pushd $(dirname "$0")/../../

Expand Down Expand Up @@ -56,22 +51,3 @@ python3 -m docuploader create-metadata \
python3 -m docuploader upload . \
--credentials ${CREDENTIALS} \
--staging-bucket ${STAGING_BUCKET}

popd

# V2 due to problems w/ the released javadoc plugin doclava, Java 8 is required. Beware of accidental updates.

mvn clean site -B -q -Ddevsite.template="${KOKORO_GFILE_DIR}/java/"

pushd target/devsite/reference

# create metadata
python3 -m docuploader create-metadata \
--name ${NAME} \
--version ${VERSION} \
--language java

# upload docs
python3 -m docuploader upload . \
--credentials ${CREDENTIALS} \
--staging-bucket ${STAGING_BUCKET_V2}
2 changes: 1 addition & 1 deletion .kokoro/release/snapshot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ grep SNAPSHOT versions.txt
setup_environment_secrets
create_settings_xml_file "settings.xml"

mvn clean install deploy -B \
mvn clean deploy -B \
--settings ${MAVEN_SETTINGS_FILE} \
-DperformRelease=true \
-Dgpg.executable=gpg \
Expand Down
2 changes: 1 addition & 1 deletion .kokoro/release/stage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ create_settings_xml_file "settings.xml"

# attempt to stage 3 times with exponential backoff (starting with 10 seconds)
retry_with_backoff 3 10 \
mvn clean install deploy -B \
mvn clean deploy -B \
--settings ${MAVEN_SETTINGS_FILE} \
-DskipTests=true \
-DperformRelease=true \
Expand Down
1 change: 0 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
Expand Down
21 changes: 21 additions & 0 deletions clirr-ignored-differences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,25 @@
<differenceType>8001</differenceType>
<className>com/google/cloud/compute/**</className>
</difference>
<!-- TODO: remove once 1.x.y-alpha version is stabilized -->
<!-- Originally caused by https://github.com/googleapis/googleapis-discovery/pull/31 -->
<difference>
<differenceType>6003</differenceType>
<className>com/google/cloud/compute/**</className>
<field>*FIELD_NUMBER</field>
</difference>
<!-- TODO: remove once 1.x.y-alpha version is stabilized -->
<!-- Originally caused by https://github.com/googleapis/googleapis-discovery/pull/31 -->
<difference>
<differenceType>6003</differenceType>
<className>com/google/cloud/compute/**</className>
<field>*_VALUE</field>
</difference>
<!-- TODO: remove once 1.x.y-alpha version is stabilized -->
<!-- Originally caused by https://github.com/googleapis/googleapis-discovery/pull/30-->
<difference>
<differenceType>7012</differenceType>
<className>com/google/cloud/compute/**</className>
<method>boolean has*(*)</method>
</difference>
</differences>
21 changes: 21 additions & 0 deletions google-cloud-compute-bom/clirr-ignored-differences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,25 @@
<differenceType>8001</differenceType>
<className>com/google/cloud/compute/**</className>
</difference>
<!-- TODO: remove once 1.x.y-alpha version is stabilized -->
<!-- Originally caused by https://github.com/googleapis/googleapis-discovery/pull/31 -->
<difference>
<differenceType>6003</differenceType>
<className>com/google/cloud/compute/**</className>
<field>*FIELD_NUMBER</field>
</difference>
<!-- TODO: remove once 1.x.y-alpha version is stabilized -->
<!-- Originally caused by https://github.com/googleapis/googleapis-discovery/pull/31 -->
<difference>
<differenceType>6003</differenceType>
<className>com/google/cloud/compute/**</className>
<field>*_VALUE</field>
</difference>
<!-- TODO: remove once 1.x.y-alpha version is stabilized -->
<!-- Originally caused by https://github.com/googleapis/googleapis-discovery/pull/30-->
<difference>
<differenceType>7012</differenceType>
<className>com/google/cloud/compute/**</className>
<method>boolean has*(*)</method>
</difference>
</differences>
2 changes: 1 addition & 1 deletion google-cloud-compute-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-shared-config</artifactId>
<version>0.9.4</version>
<version>0.11.2</version>
</parent>

<name>Google Compute Engine BOM</name>
Expand Down
21 changes: 21 additions & 0 deletions google-cloud-compute/clirr-ignored-differences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,25 @@
<differenceType>8001</differenceType>
<className>com/google/cloud/compute/**</className>
</difference>
<!-- TODO: remove once 1.x.y-alpha version is stabilized -->
<!-- Originally caused by https://github.com/googleapis/googleapis-discovery/pull/31 -->
<difference>
<differenceType>6003</differenceType>
<className>com/google/cloud/compute/**</className>
<field>*FIELD_NUMBER</field>
</difference>
<!-- TODO: remove once 1.x.y-alpha version is stabilized -->
<!-- Originally caused by https://github.com/googleapis/googleapis-discovery/pull/31 -->
<difference>
<differenceType>6003</differenceType>
<className>com/google/cloud/compute/**</className>
<field>*_VALUE</field>
</difference>
<!-- TODO: remove once 1.x.y-alpha version is stabilized -->
<!-- Originally caused by https://github.com/googleapis/googleapis-discovery/pull/30-->
<difference>
<differenceType>7012</differenceType>
<className>com/google/cloud/compute/**</className>
<method>boolean has*(*)</method>
</difference>
</differences>
4 changes: 4 additions & 0 deletions google-cloud-compute/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,12 @@
<dependency>
<groupId>com.google.api</groupId>
<artifactId>gax</artifactId>
<version>1.63.3</version>
</dependency>
<dependency>
<groupId>com.google.api</groupId>
<artifactId>gax-httpjson</artifactId>
<version>0.80.3</version>
</dependency>
<dependency>
<groupId>org.threeten</groupId>
Expand Down Expand Up @@ -70,12 +72,14 @@
<dependency>
<groupId>com.google.api</groupId>
<artifactId>gax-httpjson</artifactId>
<version>0.80.3</version>
<classifier>testlib</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.api</groupId>
<artifactId>gax</artifactId>
<version>1.63.3</version>
<classifier>testlib</classifier>
<scope>test</scope>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,17 +88,30 @@ public Map<String, List<String>> extract(
Map<String, List<String>> fields = new HashMap<>();
ProtoRestSerializer<AggregatedListAcceleratorTypesRequest>
serializer = ProtoRestSerializer.create();
serializer.putQueryParam(fields, "filter", request.getFilter());
serializer.putQueryParam(
fields, "includeAllScopes", request.getIncludeAllScopes());
serializer.putQueryParam(
fields, "maxResults", request.getMaxResults());
serializer.putQueryParam(fields, "orderBy", request.getOrderBy());
serializer.putQueryParam(fields, "pageToken", request.getPageToken());
serializer.putQueryParam(
fields,
"returnPartialSuccess",
request.getReturnPartialSuccess());
if (request.hasFilter()) {
serializer.putQueryParam(fields, "filter", request.getFilter());
}
if (request.hasIncludeAllScopes()) {
serializer.putQueryParam(
fields, "includeAllScopes", request.getIncludeAllScopes());
}
if (request.hasMaxResults()) {
serializer.putQueryParam(
fields, "maxResults", request.getMaxResults());
}
if (request.hasOrderBy()) {
serializer.putQueryParam(fields, "orderBy", request.getOrderBy());
}
if (request.hasPageToken()) {
serializer.putQueryParam(
fields, "pageToken", request.getPageToken());
}
if (request.hasReturnPartialSuccess()) {
serializer.putQueryParam(
fields,
"returnPartialSuccess",
request.getReturnPartialSuccess());
}
return fields;
}
})
Expand Down Expand Up @@ -197,15 +210,26 @@ public Map<String, List<String>> extract(
Map<String, List<String>> fields = new HashMap<>();
ProtoRestSerializer<ListAcceleratorTypesRequest> serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "filter", request.getFilter());
serializer.putQueryParam(
fields, "maxResults", request.getMaxResults());
serializer.putQueryParam(fields, "orderBy", request.getOrderBy());
serializer.putQueryParam(fields, "pageToken", request.getPageToken());
serializer.putQueryParam(
fields,
"returnPartialSuccess",
request.getReturnPartialSuccess());
if (request.hasFilter()) {
serializer.putQueryParam(fields, "filter", request.getFilter());
}
if (request.hasMaxResults()) {
serializer.putQueryParam(
fields, "maxResults", request.getMaxResults());
}
if (request.hasOrderBy()) {
serializer.putQueryParam(fields, "orderBy", request.getOrderBy());
}
if (request.hasPageToken()) {
serializer.putQueryParam(
fields, "pageToken", request.getPageToken());
}
if (request.hasReturnPartialSuccess()) {
serializer.putQueryParam(
fields,
"returnPartialSuccess",
request.getReturnPartialSuccess());
}
return fields;
}
})
Expand Down

0 comments on commit 6e46502

Please sign in to comment.