Skip to content

Commit 8b3b9ab

Browse files
authored
dataconnect: fix various kdoc documentation issues (#7399)
1 parent e6d6e25 commit 8b3b9ab

File tree

27 files changed

+143
-137
lines changed

27 files changed

+143
-137
lines changed

firebase-dataconnect/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ To build Firebase Data Connect, from the source root run:
1313
./gradlew :firebase-dataconnect:assembleRelease
1414
```
1515

16-
## Unit Testing
16+
## Unit testing
1717

1818
To run unit tests for Firebase Data Connect, from the source root run:
1919

2020
```bash
2121
./gradlew :firebase-dataconnect:check
2222
```
2323

24-
## Integration Testing
24+
## Integration testing
2525

2626
Running integration tests requires a Firebase project because they connect to the Firebase Data
2727
Connect backend.
@@ -34,10 +34,10 @@ Make sure you have created a Firebase Data Connect instance for your project, be
3434

3535
By default, integration tests run against the Firebase Data Connect emulator.
3636

37-
### Setting up the Firebase Data Connect Emulator
37+
### Setting up the Firebase Data Connect emulator
3838

3939
The integration tests require that the Firebase Data Connect emulator is running on port 9399, which
40-
is default when running it via the Data Connect Toolkit.
40+
is default when running it via the Firebase CLI.
4141

4242
- [Install the Firebase CLI](https://firebase.google.com/docs/cli/).
4343
```
@@ -57,7 +57,7 @@ is default when running it via the Data Connect Toolkit.
5757
To run the integration tests against prod, select `DataConnectProdIntegrationTest` run
5858
configuration.
5959

60-
### Run on Local Android Emulator
60+
### Run on local Android emulator
6161

6262
Then run:
6363

@@ -79,7 +79,7 @@ Run:
7979
./gradlew :firebase-dataconnect:deviceCheck
8080
```
8181

82-
## Code Formatting
82+
## Code formatting
8383

8484
Run below to format Kotlin and Java code:
8585

@@ -90,7 +90,7 @@ Run below to format Kotlin and Java code:
9090
See [here](../README.md#code-formatting) if you want to be able to format code from within Android
9191
Studio.
9292

93-
## Build Local Jar of Firebase Data Connect SDK
93+
## Build local jar of Firebase Data Connect SDK
9494

9595
```bash
9696
./gradlew -PprojectsToPublish="firebase-dataconnect" publishReleasingLibrariesToMavenLocal

firebase-dataconnect/androidTestutil/src/main/kotlin/com/google/firebase/dataconnect/testutil/DataConnectBackend.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,11 @@ import java.net.URL
8181
* - https://screenshot.googleplex.com/AmNdgDkWmR4gQXr
8282
* - https://screenshot.googleplex.com/8Aq5YKUXCLUAjKr
8383
*
84-
* When using "autopush" or "staging", the `firebase-tools` cli must be told about the URL of the
85-
* Data Connect server to which to deploy using the `FIREBASE_DATACONNECT_URL` environment variable.
86-
* This only matters if running a command line `firebase deploy --only dataconnect` or other
87-
* `firebase` commands that talk to a Data Connect backend. See the documentation of [Staging] and
88-
* [Autopush] for details.
84+
* When using "autopush" or "staging", the Firebase CLI must be told about the URL of the Data
85+
* Connect server to which to deploy using the `FIREBASE_DATACONNECT_URL` environment variable. This
86+
* only matters if running a command line `firebase deploy --only dataconnect` or other `firebase`
87+
* commands that talk to a Data Connect backend. See the documentation of [Staging] and [Autopush]
88+
* for details.
8989
*/
9090
sealed interface DataConnectBackend {
9191

firebase-dataconnect/demo/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ dokka {
6767

6868
// The remaining code in this file can be omitted from customer facing
6969
// documentation. It's here just to make things compile and/or configure
70-
// optional components of the build (e.g. spotless code formatting).
70+
// optional components of the build (for example, spotless code formatting).
7171

7272
android {
7373
namespace = "com.google.firebase.dataconnect.minimaldemo"

firebase-dataconnect/emulator/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Here is a summary of the detailed steps from below:
1717
5. Start the Postgresql container: `./start_postgres_pod.sh`
1818
6. Start the emulator: `./cli -alsologtostderr=1 -stderrthreshold=0 dev`
1919

20-
## Step 1: Compile Firebase Data Connect Emulator
20+
## Step 1: Compile Firebase Data Connect emulator
2121

2222
Compile the Firebase Data Connect Emulator in google3 using `blaze`. The build must be done in a
2323
gLinux workstation or go/cloudtop instance; namely, building on a macOS host is not supported, even
@@ -65,7 +65,7 @@ If successful, the emulator binary will be located at
6565
blaze-bin/third_party/firebase/dataconnect/emulator/cli/cli_macos
6666
```
6767

68-
#### Copy Emulator Binary to Target Machine
68+
#### Copy emulator binary to target machine
6969

7070
If the machine used to build the emulator binary is the same as the target machine, then you are
7171
done. Otherwise, you need to copy the binary to the target machine. There are two easy ways to do
@@ -105,7 +105,7 @@ or
105105
chmod a+x cli_macos
106106
```
107107

108-
#### Precompiled Emulator Binaries
108+
#### Precompiled emulator binaries
109109

110110
dconeybe maintains a directory with precompiled emulator binaries:
111111

@@ -114,7 +114,7 @@ http://x20/teams/firestore-clients/DataConnectEmulator
114114
At the time of writing, these builds incorporate the patch to remove vector support, as mentioned in
115115
the "Troubleshooting" section below.
116116

117-
## Step 2: Start Postgresql Server
117+
## Step 2: Start Postgresql server
118118

119119
The Firebase Data Connect emulator requires a real Postgresql server to talk to. Installing and
120120
configuring a Postgresql server on a given platform is a tedious and non-standard process. Moreover,
@@ -151,7 +151,7 @@ To install Podman, run these commands:
151151

152152
The "machine" commands create and start the Linux virtual machine, respectively.
153153

154-
#### Launch the Postgresql Containers
154+
#### Launch the Postgresql containers
155155

156156
A handy helper script is all that is needed to start the Postgresql server:
157157

@@ -168,7 +168,7 @@ the Postgresql server and delete the Postgresql server's database.
168168
There is also a Web UI called "pgadmin4" that can be used to visually interact with the database.
169169
The URL and login credentials are included in the final lines of output from the script.
170170

171-
#### Launch the Data Connect Emulator
171+
#### Launch the Data Connect emulator
172172

173173
With the Postgresql containers running, launch the Data Connect emulator with this command:
174174

firebase-dataconnect/emulator/start_postgres_pod.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ cat <<EOF
6666
PostegreSQL server running on port 5432
6767
The pgAdmin web UI can be viewed at http://localhost:8888
6868
The pgAdmin login credentails are: username "${PGADMIN_EMAIL}" and password "${PGADMIN_PASSWORD}"
69-
If prompted later on for a Postgresql database password, any value should be accepted (e.g. "password").
69+
If prompted later on for a Postgresql database password, any value should be accepted (for example, "password").
7070
7171
To shut everything down, run
7272
podman pod stop dataconnect_postgres

firebase-dataconnect/gradleplugin/plugin/src/main/kotlin/com/google/firebase/dataconnect/gradle/plugin/DataConnectDslExtension.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ abstract class DataConnectDslExtension @Inject constructor(objectFactory: Object
6464
fun emulator(block: DataConnectEmulatorDslExtension.() -> Unit): Unit = block(emulator)
6565

6666
/**
67-
* Values to use when running ktfmt to format the code generated by the Data Connect toolkit,
68-
* which override the values from those defined in the outer scope.
67+
* Values to use when running ktfmt to format the code generated by the Firebase CLI, which
68+
* overrides the values defined in the outer scope.
6969
*/
7070
val ktfmt: DataConnectKtfmtDslExtension =
7171
objectFactory.newInstance<DataConnectKtfmtDslExtension>()

firebase-dataconnect/src/main/kotlin/com/google/firebase/dataconnect/AnyValue.kt

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ import kotlinx.serialization.serializer
3434
/**
3535
* Represents a variable or field of the Data Connect custom scalar type `Any`.
3636
*
37-
* ### Valid Values for `AnyValue`
37+
* ### Valid values for `AnyValue`
3838
*
3939
* `AnyValue` can encapsulate [String], [Boolean], [Double], a [List] of one of these types, or a
40-
* [Map] whose values are one of these types. The values can be arbitrarily nested (e.g. a list that
41-
* contains a map that contains other maps, and so on. The lists and maps can contain heterogeneous
42-
* values; for example, a single [List] can contain a [String] value, some [Boolean] values, and
43-
* some [List] values. The values of a [List] or a [Map] may be `null`. The only exception is that a
44-
* variable or field declared as `[Any]` in GraphQL may _not_ have `null` values in the top-level
45-
* list; however, nested lists or maps _may_ contain null values.
40+
* [Map] whose values are one of these types. The values can be arbitrarily nested (for example, a
41+
* list that contains a map that contains other maps, and so on). The lists and maps can contain
42+
* heterogeneous values; for example, a single [List] can contain a [String] value, some [Boolean]
43+
* values, and some [List] values. The values of a [List] or a [Map] may be `null`. The only
44+
* exception is that a variable or field declared as `[Any]` in GraphQL may _not_ have `null` values
45+
* in the top-level list; however, nested lists or maps _may_ contain null values.
4646
*
4747
* ### Storing `Int` in an `AnyValue`
4848
*
@@ -51,15 +51,15 @@ import kotlinx.serialization.serializer
5151
* ### Storing `Long` in an `AnyValue`
5252
*
5353
* To store a [Long] value, converting it to a [Double] can be lossy if the value is sufficiently
54-
* large (or small) to not be exactly represented by [Double]. The _largest_ [Long] value that can
54+
* large (or small) to not be exactly representable by [Double]. The _largest_ [Long] value that can
5555
* be stored in a [Double] with its exact value is `2^53 – 1` (`9007199254740991`). The _smallest_
5656
* [Long] value that can be stored in a [Double] with its exact value is `-(2^53 – 1)`
5757
* (`-9007199254740991`). This limitation is exactly the same in JavaScript, which does not have a
5858
* native "int" or "long" type, but rather stores all numeric values in a 64-bit floating point
5959
* value. See
60-
* [MAX_SAFE_INTEGER](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER])
60+
* [MAX_SAFE_INTEGER](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)
6161
* and
62-
* [MIN_SAFE_INTEGER](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MIN_SAFE_INTEGER])
62+
* [MIN_SAFE_INTEGER](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MIN_SAFE_INTEGER)
6363
* for more details.
6464
*
6565
* ### Integration with `kotlinx.serialization`
@@ -72,6 +72,7 @@ import kotlinx.serialization.serializer
7272
*
7373
* ```
7474
* type Foo @table { value: Any }
75+
*
7576
* mutation FooInsert($value: Any) {
7677
* key: foo_insert(data: { value: $value })
7778
* }
@@ -102,10 +103,11 @@ public class AnyValue internal constructor(internal val protoValue: Value) {
102103
*
103104
* An exception is thrown if any of the values of the map, or its sub-values, are invalid for
104105
* being stored in [AnyValue]; see the [AnyValue] class documentation for a detailed description
105-
* of value values.
106+
* of valid values.
106107
*
107-
* This class makes a _copy_ of the given map; therefore, any modifications to the map after this
108-
* object is created will have no effect on this [AnyValue] object.
108+
* This class makes a _deep copy_ of the given map; therefore, any modifications to the map or its
109+
* constituent lists or maps after this object is created will have no effect on this [AnyValue]
110+
* object.
109111
*/
110112
public constructor(value: Map<String, Any?>) : this(value.toValueProto())
111113

@@ -114,10 +116,11 @@ public class AnyValue internal constructor(internal val protoValue: Value) {
114116
*
115117
* An exception is thrown if any of the values of the list, or its sub-values, are invalid for
116118
* being stored in [AnyValue]; see the [AnyValue] class documentation for a detailed description
117-
* of value values.
119+
* of valid values.
118120
*
119-
* This class makes a _copy_ of the given list; therefore, any modifications to the list after
120-
* this object is created will have no effect on this [AnyValue] object.
121+
* This class makes a _deep copy_ of the given list; therefore, any modifications to the list or
122+
* its constituent lists or maps after this object is created will have no effect on this
123+
* [AnyValue] object.
121124
*/
122125
public constructor(value: List<Any?>) : this(value.toValueProto())
123126

@@ -133,7 +136,7 @@ public class AnyValue internal constructor(internal val protoValue: Value) {
133136
/**
134137
* The native Kotlin type of the value encapsulated in this object.
135138
*
136-
* Although this type is `Any` it will be one of `String, `Boolean`, `Double`, `List<Any?>` or
139+
* Although this type is `Any` it will be one of `String`, `Boolean`, `Double`, `List<Any?>` or
137140
* `Map<String, Any?>`. See the [AnyValue] class documentation for a detailed description of the
138141
* types of values that are supported.
139142
*/

firebase-dataconnect/src/main/kotlin/com/google/firebase/dataconnect/ConnectorConfig.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ import java.util.Objects
2222
* Information about a Firebase Data Connect "connector" that is used by [FirebaseDataConnect] to
2323
* connect to the correct Google Cloud resources.
2424
*
25-
* ### Safe for Concurrent Use
25+
* ### Safe for concurrent use
2626
*
2727
* All methods and properties of [ConnectorConfig] are thread-safe and may be safely called and/or
2828
* accessed concurrently from multiple threads and/or coroutines.
2929
*
3030
* @property connector The ID of the Firebase Data Connect "connector".
31-
* @property location The location where the connector is located (e.g. `"us-central1"`).
31+
* @property location The location where the connector is located (for example, `"us-central1"`).
3232
* @property serviceId The ID of the Firebase Data Connect service.
3333
*/
3434
public class ConnectorConfig(

firebase-dataconnect/src/main/kotlin/com/google/firebase/dataconnect/DataConnectOperationFailureResponse.kt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,16 @@ public interface DataConnectOperationFailureResponse<Data> {
3333
* * [Double]
3434
* * [List] containing any of the types in this list of types
3535
* * [Map] with [String] keys and values of the types in this list of types
36-
*
37-
* Consider using [toJson] to get a higher-level object.
3836
*/
37+
// TODO(b/446167496) Add a link to [toJson] in the kdoc comments above when the toJson extension
38+
// function is implemented.
3939
public val rawData: Map<String, Any?>?
4040

4141
/**
4242
* The list of errors provided by the backend in the response message; may be empty.
4343
*
44-
* See https://spec.graphql.org/draft/#sec-Errors for details.
44+
* See [https://spec.graphql.org/draft/#sec-Errors](https://spec.graphql.org/draft/#sec-Errors)
45+
* for details.
4546
*/
4647
public val errors: List<ErrorInfo>
4748

@@ -69,7 +70,8 @@ public interface DataConnectOperationFailureResponse<Data> {
6970
/**
7071
* Information about the error, as provided in the response payload from the backend.
7172
*
72-
* See https://spec.graphql.org/draft/#sec-Errors for details.
73+
* See [https://spec.graphql.org/draft/#sec-Errors](https://spec.graphql.org/draft/#sec-Errors)
74+
* for details.
7375
*/
7476
public interface ErrorInfo {
7577
/** The error's message. */

firebase-dataconnect/src/main/kotlin/com/google/firebase/dataconnect/DataConnectSettings.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ import java.util.Objects
2121
/**
2222
* Settings that control the behavior of [FirebaseDataConnect] instances.
2323
*
24-
* ### Safe for Concurrent Use
24+
* ### Safe for concurrent use
2525
*
2626
* All methods and properties of [DataConnectSettings] are thread-safe and may be safely called
2727
* and/or accessed concurrently from multiple threads and/or coroutines.
2828
*
29-
* @property host The host of the Firebase Data Connect service to which to connect (e.g.
29+
* @property host The host of the Firebase Data Connect service to which to connect (for example,
3030
* `"myproxy.foo.com"`, `"myproxy.foo.com:9987"`).
3131
* @property sslEnabled Whether to use SSL for the connection; if `true`, then the connection will
3232
* be encrypted using SSL and, if false, the connection will _not_ be encrypted and all network

0 commit comments

Comments
 (0)