From 57dfb426de4e9a0ef9cafec96818cceebb19eefc Mon Sep 17 00:00:00 2001 From: Burke Davison <40617934+burkedavison@users.noreply.github.com> Date: Mon, 29 Jul 2024 16:17:21 -0400 Subject: [PATCH] fix: use 'latest' version in generated package overview links (#273) * fix: use 'latest' version in generated package overview links * fix: use equals for string comparisons * ci: update goldens * ci: update goldens * chore: format --- .../microsoft/build/PackageOverviewFile.java | 19 ++++----------- .../com.microsoft.samples.agreements.md | 10 ++++---- ...om.microsoft.samples.commentinheritance.md | 20 ++++++++-------- .../com.microsoft.samples.google.md | 22 ++++++++--------- .../com.microsoft.samples.google.v1.md | 2 +- .../com.microsoft.samples.google.v1.stub.md | 14 +++++------ .../com.microsoft.samples.google.v1beta.md | 4 ++-- .../com.microsoft.samples.google.v1p1alpha.md | 4 ++-- .../com.microsoft.samples.md | 24 +++++++++---------- .../com.microsoft.samples.offers.md | 4 ++-- .../com.microsoft.samples.subpackage.md | 14 +++++------ 11 files changed, 63 insertions(+), 74 deletions(-) diff --git a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/build/PackageOverviewFile.java b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/build/PackageOverviewFile.java index 862f5cb3..647c4a88 100644 --- a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/build/PackageOverviewFile.java +++ b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/build/PackageOverviewFile.java @@ -96,11 +96,7 @@ public PackageOverviewFile( this.PACKAGE_HEADER = "# Package " + packageURIPath + " (" + artifactVersion + ")\n"; String cloudRADChildElementLinkPrefix = - "https://cloud.google.com/java/docs/reference/" - + repoMetadata.getArtifactId() - + "/" - + artifactVersion - + "/"; + "https://cloud.google.com/java/docs/reference/" + repoMetadata.getArtifactId() + "/latest/"; String packageURIPathGithub = packageURIPath.replace('.', '/'); String githubSourcePackageLink = @@ -110,14 +106,7 @@ public PackageOverviewFile( + "/src/main/java/" + packageURIPathGithub; - String cgcRootUri = "https://cloud.google.com/java/docs/reference/"; - this.recommendedPackageLink = - cgcRootUri - + repoMetadata.getArtifactId() - + "/" - + artifactVersion - + "/" - + this.recommendedPackage; + this.recommendedPackageLink = cloudRADChildElementLinkPrefix + this.recommendedPackage; // If the package status is not a GA version, then add a disclaimer around prerelease // implications if (status != null) { @@ -366,7 +355,7 @@ private String getUid() { private static String createHtmlTable( String type, String linkPrefix, List listOfPackageChildrenSummaries) { String tableHeader = type; - if (type == "Client/Settings") { + if (type.equals("Client/Settings")) { tableHeader = "Clients or Settings Class"; } StringBuilder tableBuilder = new StringBuilder(); @@ -381,7 +370,7 @@ private static String createHtmlTable( .append("\n"); for (PackageChildSummary packageChildSummary : listOfPackageChildrenSummaries) { - if (packageChildSummary.type == type) { + if (packageChildSummary.type.equals(type)) { tableBuilder .append("\n") .append(" @@ -19,7 +19,7 @@ Class Description -com.microsoft.samples.agreements.AgreementDetailsCollectionOperations +com.microsoft.samples.agreements.AgreementDetailsCollectionOperations Deprecated. Use AgreementMetaData instead. @@ -27,13 +27,13 @@ Description Agreement details collection operations implementation class. -com.microsoft.samples.agreements.AgreementMetaData +com.microsoft.samples.agreements.AgreementMetaData The AgreementMetaData provides metadata about the agreement type that partner can provide confirmation of customer acceptance. -com.microsoft.samples.agreements.ResourceCollection +com.microsoft.samples.agreements.ResourceCollection Contains a collection of resources with JSON properties to represent the output Type of objects in collection @@ -48,7 +48,7 @@ Interface Description -com.microsoft.samples.agreements.IAgreementDetailsCollection +com.microsoft.samples.agreements.IAgreementDetailsCollection Deprecated. This one is deprecated :( diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.commentinheritance.md b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.commentinheritance.md index f07675a6..4e65c14c 100644 --- a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.commentinheritance.md +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.commentinheritance.md @@ -9,7 +9,7 @@ ## This package is not the recommended entry point to using this client library! - For this library, we recommend using [com.microsoft.samples.google.v1](https://cloud.google.com/java/docs/reference/google-cloud-apikeys/0.18.0/com.microsoft.samples.google.v1) for new applications. + For this library, we recommend using [com.microsoft.samples.google.v1](https://cloud.google.com/java/docs/reference/google-cloud-apikeys/latest/com.microsoft.samples.google.v1) for new applications. ## Classes @@ -19,22 +19,22 @@ Class - + - + - + - + @@ -48,27 +48,27 @@ Interface - + - + - + - + - + diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.md b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.md index 1d26ee71..940fb336 100644 --- a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.md +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.md @@ -9,7 +9,7 @@ ## This package is not the recommended entry point to using this client library! - For this library, we recommend using [com.microsoft.samples.google.v1](https://cloud.google.com/java/docs/reference/google-cloud-apikeys/0.18.0/com.microsoft.samples.google.v1) for new applications. + For this library, we recommend using [com.microsoft.samples.google.v1](https://cloud.google.com/java/docs/reference/google-cloud-apikeys/latest/com.microsoft.samples.google.v1) for new applications. ## Client Classes Client classes are the main entry point to using a package. @@ -21,7 +21,7 @@ Client - + - + - + - + - + returns google.rpc.Code.INVALID_ARGUMENT. See - + @@ -91,7 +91,7 @@ Interface - + - + @@ -113,7 +113,7 @@ Enum - + @@ -127,7 +127,7 @@ Exception - + - +
Description
com.microsoft.samples.commentinheritance.Animalcom.microsoft.samples.commentinheritance.Animal Animal.
com.microsoft.samples.commentinheritance.Dogcom.microsoft.samples.commentinheritance.Dog Canine and man's best friend.
com.microsoft.samples.commentinheritance.Herbivorous.Plantcom.microsoft.samples.commentinheritance.Herbivorous.Plant
com.microsoft.samples.commentinheritance.Mammalcom.microsoft.samples.commentinheritance.Mammal Mammal.
Description
com.microsoft.samples.commentinheritance.Carnivorouscom.microsoft.samples.commentinheritance.Carnivorous Marks an Animal that eats other animals.
com.microsoft.samples.commentinheritance.Herbivorouscom.microsoft.samples.commentinheritance.Herbivorous Marks animals that eat plants.
com.microsoft.samples.commentinheritance.Omnivorouscom.microsoft.samples.commentinheritance.Omnivorous Eats plants and animals.
com.microsoft.samples.commentinheritance.Organismcom.microsoft.samples.commentinheritance.Organism
com.microsoft.samples.commentinheritance.Viviparouscom.microsoft.samples.commentinheritance.Viviparous Mammals that give birth to young that develop within the mother's body.
Description
com.microsoft.samples.google.SpeechClientcom.microsoft.samples.google.SpeechClient Service Description: Service that implements Google Cloud Speech API. @@ -39,7 +39,7 @@ Settings Description
com.microsoft.samples.google.ProductSearchSettingscom.microsoft.samples.google.ProductSearchSettings Settings class to configure an instance of ProductSearchClient. @@ -47,7 +47,7 @@ Settings class to configure an instance of
com.microsoft.samples.google.SpeechSettingscom.microsoft.samples.google.SpeechSettings Settings class to configure an instance of SpeechClient. @@ -64,12 +64,12 @@ Class Description
com.microsoft.samples.google.ProductSearchSettings.Buildercom.microsoft.samples.google.ProductSearchSettings.Builder Builder for ProductSearchSettings.
com.microsoft.samples.google.RecognitionAudiocom.microsoft.samples.google.RecognitionAudio Contains audio data in the encoding specified in the RecognitionConfig. @@ -77,7 +77,7 @@ Builder for ProductSearchSettings.
com.microsoft.samples.google.SpeechSettings.Buildercom.microsoft.samples.google.SpeechSettings.Builder Builder for SpeechSettings.
Description
com.microsoft.samples.google.BetaApicom.microsoft.samples.google.BetaApi Indicates a public API that can change at any time, and has no guarantee of API stability and backward-compatibility. @@ -99,7 +99,7 @@ Indicates a public API that can change at any time, and has no guarantee of API

Usage guidelines:

com.microsoft.samples.google.ValidationException.Suppliercom.microsoft.samples.google.ValidationException.Supplier
Description
com.microsoft.samples.google.RecognitionAudio.AudioSourceCasecom.microsoft.samples.google.RecognitionAudio.AudioSourceCase
Description
com.microsoft.samples.google.ValidationExceptioncom.microsoft.samples.google.ValidationException Exception thrown if there is a validation problem with a path template, http config, or related framework methods. Comes as an illegal argument exception subclass. Allows to globally set a diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1.md b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1.md index cb50fddf..7ad4133c 100644 --- a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1.md +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1.md @@ -17,7 +17,7 @@ Client Description
com.microsoft.samples.google.v1.SpeechClientcom.microsoft.samples.google.v1.SpeechClient Service Description: Service that implements Google Cloud Speech API. diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1.stub.md b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1.stub.md index f6f5094c..4bac0192 100644 --- a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1.stub.md +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1.stub.md @@ -9,12 +9,12 @@ ## This package is not the recommended entry point to using this client library! - For this library, we recommend using [com.microsoft.samples.google.v1](https://cloud.google.com/java/docs/reference/google-cloud-apikeys/0.18.0/com.microsoft.samples.google.v1) for new applications. + For this library, we recommend using [com.microsoft.samples.google.v1](https://cloud.google.com/java/docs/reference/google-cloud-apikeys/latest/com.microsoft.samples.google.v1) for new applications. ## Stub Package Implications This package is a a base stub class. It is for advanced usage and reflects the underlying API directly. -We generally recommend using the non-stub, latest GA package, such as [com.microsoft.samples.google.v1](https://cloud.google.com/java/docs/reference/google-cloud-apikeys/0.18.0/com.microsoft.samples.google.v1). Use with caution. +We generally recommend using the non-stub, latest GA package, such as [com.microsoft.samples.google.v1](https://cloud.google.com/java/docs/reference/google-cloud-apikeys/latest/com.microsoft.samples.google.v1). Use with caution. ## Stub Classes @@ -23,21 +23,21 @@ Stub - + - + - + - + - + diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1beta.md b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1beta.md index 96676b5a..364177af 100644 --- a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1beta.md +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1beta.md @@ -9,7 +9,7 @@ ## This package is not the recommended entry point to using this client library! - For this library, we recommend using [com.microsoft.samples.google.v1](https://cloud.google.com/java/docs/reference/google-cloud-apikeys/0.18.0/com.microsoft.samples.google.v1) for new applications. + For this library, we recommend using [com.microsoft.samples.google.v1](https://cloud.google.com/java/docs/reference/google-cloud-apikeys/latest/com.microsoft.samples.google.v1) for new applications. ## Prerelease Implications @@ -28,7 +28,7 @@ Client - + - +
Description
com.microsoft.samples.google.v1.stub.GrpcSpeechStubcom.microsoft.samples.google.v1.stub.GrpcSpeechStub gRPC stub implementation for the Speech service API.

This class is for advanced usage and reflects the underlying API directly.

com.microsoft.samples.google.v1.stub.HttpJsonSpeechStubcom.microsoft.samples.google.v1.stub.HttpJsonSpeechStub REST stub implementation for the Speech service API.

This class is for advanced usage and reflects the underlying API directly.

com.microsoft.samples.google.v1.stub.SpeechStubcom.microsoft.samples.google.v1.stub.SpeechStub Base stub class for the Speech service API. @@ -54,7 +54,7 @@ Settings Description
com.microsoft.samples.google.v1.stub.SpeechStubSettingscom.microsoft.samples.google.v1.stub.SpeechStubSettings Settings class to configure an instance of com.google.cloud.speech.v1p1beta1.stub.SpeechStub. @@ -71,7 +71,7 @@ Class Description
com.microsoft.samples.google.v1.stub.SpeechStubSettings.Buildercom.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder Builder for SpeechStubSettings.
Description
com.microsoft.samples.google.v1beta.SpeechClientcom.microsoft.samples.google.v1beta.SpeechClient Service Description: Service that implements Google Cloud Speech API. diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1p1alpha.md b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1p1alpha.md index 0001294b..29535775 100644 --- a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1p1alpha.md +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1p1alpha.md @@ -9,7 +9,7 @@ ## This package is not the recommended entry point to using this client library! - For this library, we recommend using [com.microsoft.samples.google.v1](https://cloud.google.com/java/docs/reference/google-cloud-apikeys/0.18.0/com.microsoft.samples.google.v1) for new applications. + For this library, we recommend using [com.microsoft.samples.google.v1](https://cloud.google.com/java/docs/reference/google-cloud-apikeys/latest/com.microsoft.samples.google.v1) for new applications. ## Prerelease Implications @@ -28,7 +28,7 @@ Client Description
com.microsoft.samples.google.v1p1alpha.SpeechClientcom.microsoft.samples.google.v1p1alpha.SpeechClient Service Description: Service that implements Google Cloud Speech API. diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.md b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.md index 0b3bab6e..a67a89e0 100644 --- a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.md +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.md @@ -9,7 +9,7 @@ ## This package is not the recommended entry point to using this client library! - For this library, we recommend using [com.microsoft.samples.google.v1](https://cloud.google.com/java/docs/reference/google-cloud-apikeys/0.18.0/com.microsoft.samples.google.v1) for new applications. + For this library, we recommend using [com.microsoft.samples.google.v1](https://cloud.google.com/java/docs/reference/google-cloud-apikeys/latest/com.microsoft.samples.google.v1) for new applications. ## Classes @@ -19,43 +19,43 @@ Class - + - + - + - + - + - + - + - + @@ -69,12 +69,12 @@ Interface - + - + - + diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.offers.md b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.offers.md index 8280fce5..31676c97 100644 --- a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.offers.md +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.offers.md @@ -9,7 +9,7 @@ ## This package is not the recommended entry point to using this client library! - For this library, we recommend using [com.microsoft.samples.google.v1](https://cloud.google.com/java/docs/reference/google-cloud-apikeys/0.18.0/com.microsoft.samples.google.v1) for new applications. + For this library, we recommend using [com.microsoft.samples.google.v1](https://cloud.google.com/java/docs/reference/google-cloud-apikeys/latest/com.microsoft.samples.google.v1) for new applications. ## Classes
Description
com.microsoft.samples.BasePartnerComponentcom.microsoft.samples.BasePartnerComponent Holds common partner component properties and behavior. All components should inherit from this class. The context object type.
com.microsoft.samples.BasePartnerComponentStringcom.microsoft.samples.BasePartnerComponentString Holds common partner component properties and behavior. The context is string type by default.
com.microsoft.samples.ExceptionHandlercom.microsoft.samples.ExceptionHandler Exception retry algorithm implementation used by RetryHelper.
com.microsoft.samples.ExceptionHandler.Buildercom.microsoft.samples.ExceptionHandler.Builder ExceptionHandler builder.
com.microsoft.samples.KeyValuePaircom.microsoft.samples.KeyValuePair
com.microsoft.samples.Linkcom.microsoft.samples.Link
com.microsoft.samples.Subpackagecom.microsoft.samples.Subpackage
com.microsoft.samples.SuperHerocom.microsoft.samples.SuperHero Hero is the main entity we will be using to something
Description
com.microsoft.samples.ExceptionHandler.Interceptorcom.microsoft.samples.ExceptionHandler.Interceptor
com.microsoft.samples.IPartnercom.microsoft.samples.IPartner The main entry point into using the partner SDK functionality. Represents a partner and encapsulates all the behavior attached to partners. Use this interface to get to the partner's @@ -90,7 +90,7 @@ Enum Description
com.microsoft.samples.ExceptionHandler.Interceptor.RetryResultcom.microsoft.samples.ExceptionHandler.Interceptor.RetryResult
@@ -19,7 +19,7 @@ Class - + diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.subpackage.md b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.subpackage.md index fb830aee..443caf83 100644 --- a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.subpackage.md +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.subpackage.md @@ -9,7 +9,7 @@ ## This package is not the recommended entry point to using this client library! - For this library, we recommend using [com.microsoft.samples.google.v1](https://cloud.google.com/java/docs/reference/google-cloud-apikeys/0.18.0/com.microsoft.samples.google.v1) for new applications. + For this library, we recommend using [com.microsoft.samples.google.v1](https://cloud.google.com/java/docs/reference/google-cloud-apikeys/latest/com.microsoft.samples.google.v1) for new applications. ## Classes
Description
com.microsoft.samples.offers.Offercom.microsoft.samples.offers.Offer Represents a form of product availability to customer
@@ -19,7 +19,7 @@ Class - + - + - + @@ -46,7 +46,7 @@ Interface - + - + @@ -76,7 +76,7 @@ Exception - +
Description
com.microsoft.samples.subpackage.Personcom.microsoft.samples.subpackage.Person Class that describes some person @@ -27,12 +27,12 @@ Class that describes some person
com.microsoft.samples.subpackage.Person.IdentificationInfocom.microsoft.samples.subpackage.Person.IdentificationInfo Class that describes person's identification
com.microsoft.samples.subpackage.Tuplecom.microsoft.samples.subpackage.Tuple
Description
com.microsoft.samples.subpackage.Displaycom.microsoft.samples.subpackage.Display Do you see some First code block? @@ -62,7 +62,7 @@ Enum Description
com.microsoft.samples.subpackage.Person.IdentificationInfo.Gendercom.microsoft.samples.subpackage.Person.IdentificationInfo.Gender Enum describes person's gender
Description
com.microsoft.samples.subpackage.CustomExceptioncom.microsoft.samples.subpackage.CustomException