Repository: GoogleCloudPlatform/pgadapter
Pull request #1272 (2023-12-15 16:02:22)

build(deps): bump reflect-metadata from 0.1.14 to 0.2.1 in /src/test/nodejs/node-postgres
Bumps [reflect-metadata](https://github.com/rbuckton/reflect-metadata) from 0.1.14 to 0.2.1.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/rbuckton/reflect-metadata/releases">reflect-metadata's releases</a>.</em></p>
<blockquote>
<h2>v0.2.1</h2>
<h2>What's Changed</h2>
<ul>
<li>Fix stack overflow crash in isProviderFor by <a href="https://github.com/rbuckton"><code>@​rbuckton</code></a> in <a href="https://redirect.github.com/rbuckton/reflect-metadata/pull/155">rbuckton/reflect-metadata#155</a></li>
<li>Update main to v0.2.1 by <a href="https://github.com/rbuckton"><code>@​rbuckton</code></a> in <a href="https://redirect.github.com/rbuckton/reflect-metadata/pull/156">rbuckton/reflect-metadata#156</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a href="https://github.com/rbuckton/reflect-metadata/compare/v0.2.0...v0.2.1">https://github.com/rbuckton/reflect-metadata/compare/v0.2.0...v0.2.1</a></p>
<h2>reflect-metadata 0.2.0</h2>
<h2>What's Changed</h2>
<ul>
<li>Add /lite and /no-conflict exports by <a href="https://github.com/rbuckton"><code>@​rbuckton</code></a> in <a href="https://redirect.github.com/rbuckton/reflect-metadata/pull/144">rbuckton/reflect-metadata#144</a></li>
<li>No dynamic evaluation in <code>/lite</code> mode by <a href="https://github.com/rbuckton"><code>@​rbuckton</code></a> in <a href="https://redirect.github.com/rbuckton/reflect-metadata/pull/149">rbuckton/reflect-metadata#149</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a href="https://github.com/rbuckton/reflect-metadata/compare/v0.1.14...v0.2.0">https://github.com/rbuckton/reflect-metadata/compare/v0.1.14...v0.2.0</a></p>
<h2>reflect-metadata 0.2.0-pre.0</h2>
<h2>What's Changed</h2>
<ul>
<li>Add /lite and /no-conflict exports by <a href="https://github.com/rbuckton"><code>@​rbuckton</code></a> in <a href="https://redirect.github.com/rbuckton/reflect-metadata/pull/144">rbuckton/reflect-metadata#144</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a href="https://github.com/rbuckton/reflect-metadata/compare/v0.1.14...v0.2.0-pre.0">https://github.com/rbuckton/reflect-metadata/compare/v0.1.14...v0.2.0-pre.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/rbuckton/reflect-metadata/commit/5c2589f4a99b5e52873f7868172bf72a5c017b37"><code>5c2589f</code></a> 0.2.1</li>
<li><a href="https://github.com/rbuckton/reflect-metadata/commit/1e66739f7d983ac8683da58e7a685593cc9efbee"><code>1e66739</code></a> Fix stack overflow crash in isProviderFor</li>
<li><a href="https://github.com/rbuckton/reflect-metadata/commit/68fd0199d3ddf0a23b530a841f1ab334cb83be0c"><code>68fd019</code></a> Merge pull request <a href="https://redirect.github.com/rbuckton/reflect-metadata/issues/149">#149</a> from rbuckton/lite-mode-no-dynamic-eval</li>
<li><a href="https://github.com/rbuckton/reflect-metadata/commit/85d168f9f05976e2102bfaea062a66b412610ef8"><code>85d168f</code></a> Remove dynamic execution from lite-mode</li>
<li><a href="https://github.com/rbuckton/reflect-metadata/commit/893db5d4e352f3aee2e7988e8a56d0fa19d3dd89"><code>893db5d</code></a> Drop prerelease from version</li>
<li><a href="https://github.com/rbuckton/reflect-metadata/commit/6ef3aedf9c019f1e9ff8c1439c807b658a6f7f8f"><code>6ef3aed</code></a> Merge pull request <a href="https://redirect.github.com/rbuckton/reflect-metadata/issues/144">#144</a> from rbuckton/lite-mode</li>
<li><a href="https://github.com/rbuckton/reflect-metadata/commit/7391602a08e708c068a0c5a10ff015b4add77fdf"><code>7391602</code></a> Merge branch 'main' into lite-mode</li>
<li><a href="https://github.com/rbuckton/reflect-metadata/commit/f16259f895dbf1b78d3f0017866c8a887b7b402e"><code>f16259f</code></a> Update ci.yml</li>
<li><a href="https://github.com/rbuckton/reflect-metadata/commit/4e604aa2d5b899317f45ecc532c51a34122a6773"><code>4e604aa</code></a> Create ci.yml</li>
<li><a href="https://github.com/rbuckton/reflect-metadata/commit/ad6f84bd3e793a601f4652a98665bff23e064515"><code>ad6f84b</code></a> Mark as prerelease for testing purposes</li>
<li>Additional commits viewable in <a href="https://github.com/rbuckton/reflect-metadata/compare/v0.1.14...v0.2.1">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=reflect-metadata&package-manager=npm_and_yarn&previous-version=0.1.14&new-version=0.2.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>


Patch:
diff --git a/.github/workflows/cloud-storage-build-and-push-assembly.yaml b/.github/workflows/cloud-storage-build-and-push-assembly.yaml
index 82cc98ea..25317072 100644
--- a/.github/workflows/cloud-storage-build-and-push-assembly.yaml
+++ b/.github/workflows/cloud-storage-build-and-push-assembly.yaml
@@ -43,13 +43,13 @@ jobs:
 
       # Upload the assembly to Google Cloud Storage
       - id: 'upload-versioned-file'
-        uses: 'google-github-actions/upload-cloud-storage@v1'
+        uses: 'google-github-actions/upload-cloud-storage@v2'
         with:
           path: ${{ env.assembly }}
           destination: 'pgadapter-jar-releases'
           parent: false
       - id: 'overwrite-current-file'
-        uses: 'google-github-actions/upload-cloud-storage@v1'
+        uses: 'google-github-actions/upload-cloud-storage@v2'
         with:
           path: ${{ env.assembly_current }}
           destination: 'pgadapter-jar-releases'
diff --git a/.github/workflows/cloud-storage-build-and-push.yaml b/.github/workflows/cloud-storage-build-and-push.yaml
index aa78721e..5cda49d0 100644
--- a/.github/workflows/cloud-storage-build-and-push.yaml
+++ b/.github/workflows/cloud-storage-build-and-push.yaml
@@ -40,13 +40,13 @@ jobs:
 
       # Upload the jar to Google Cloud Storage
       - id: 'upload-versioned-file'
-        uses: 'google-github-actions/upload-cloud-storage@v1'
+        uses: 'google-github-actions/upload-cloud-storage@v2'
         with:
           path: ${{ env.uber_jar }}
           destination: 'pgadapter-jar-releases'
           parent: false
       - id: 'overwrite-current-file'
-        uses: 'google-github-actions/upload-cloud-storage@v1'
+        uses: 'google-github-actions/upload-cloud-storage@v2'
         with:
           path: ${{ env.uber_jar_current }}
           destination: 'pgadapter-jar-releases'
diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml
index 681b6196..4e223c7a 100644
--- a/.github/workflows/integration.yaml
+++ b/.github/workflows/integration.yaml
@@ -123,7 +123,7 @@ jobs:
         uses: codecov/codecov-action@v3
         with:
           directory: ./target/site/jacoco-merged-test-coverage-report
-          fail_ci_if_error: true
+          fail_ci_if_error: false
           flags: all_tests
           name: codecov-umbrella
           path_to_write_report: ./coverage/codecov_report.txt
diff --git a/README.md b/README.md
index 3da9c19c..116430ba 100644
--- a/README.md
+++ b/README.md
@@ -157,19 +157,16 @@ This option is only available for Java/JVM-based applications.
 
 ```java
 class PGProxyRunner {
-    public static void main() {
-      String[] arguments =
-              new String[] {
-                      "-p",
-                      "my-project",
-                      "-i",
-                      "my-instance",
-                      "-d",
-                      "my-database",
-                      "-c",
-                      "/path/to/credentials.json"
-              };
-      ProxyServer server = new ProxyServer(new OptionsMetadata(arguments));
+  public static void main(String[] args) {
+      OptionsMetadata.Builder builder =
+          OptionsMetadata.newBuilder()
+              .setProject("my-project")
+              .setInstance("my-instance")
+              .setDatabase("my-database")
+              .setCredentialsFile("/path/to/credentials.json")
+              // Start PGAdapter on any available port.
+              .setPort(0);
+      ProxyServer server = new ProxyServer(builder.build());
       server.startServer();
       server.awaitRunning();
     }
diff --git a/benchmarks/ycsb/Dockerfile b/benchmarks/ycsb/Dockerfile
index 6833f3de..43bcf5f5 100644
--- a/benchmarks/ycsb/Dockerfile
+++ b/benchmarks/ycsb/Dockerfile
@@ -18,7 +18,9 @@ RUN mvn package -Passembly -DskipTests
 
 
 # Docker image for the YCSB runner.
-FROM gcr.io/google.com/cloudsdktool/google-cloud-cli:slim
+# We pin the version to 455.0.0, because YCSB requires Python 2.x, and this is the last
+# version of the gcloud-cli Docker image that supports Python 2.x.
+FROM gcr.io/google.com/cloudsdktool/google-cloud-cli:455.0.0-slim
 
 RUN apt update && apt -y install postgresql-client
 RUN apt -y install default-jre
diff --git a/src/main/java/com/google/cloud/spanner/pgadapter/statements/DdlExecutor.java b/src/main/java/com/google/cloud/spanner/pgadapter/statements/DdlExecutor.java
index 6f87e64f..fc64aeab 100644
--- a/src/main/java/com/google/cloud/spanner/pgadapter/statements/DdlExecutor.java
+++ b/src/main/java/com/google/cloud/spanner/pgadapter/statements/DdlExecutor.java
@@ -383,7 +383,7 @@ class DdlExecutor {
     }
   }
 
-  private static final class Table implements Comparable<Table> {
+  static final class Table implements Comparable<Table> {
     private final String schema;
     private final String name;
     private final String parent;


Test patch:
diff --git a/src/test/java/com/google/cloud/spanner/pgadapter/statements/DdlExecutorTest.java b/src/test/java/com/google/cloud/spanner/pgadapter/statements/DdlExecutorTest.java
index 75399ceb..3fb05b16 100644
--- a/src/test/java/com/google/cloud/spanner/pgadapter/statements/DdlExecutorTest.java
+++ b/src/test/java/com/google/cloud/spanner/pgadapter/statements/DdlExecutorTest.java
@@ -26,6 +26,7 @@ import com.google.cloud.spanner.Statement;
 import com.google.cloud.spanner.connection.AbstractStatementParser;
 import com.google.cloud.spanner.connection.AbstractStatementParser.ParsedStatement;
 import com.google.cloud.spanner.pgadapter.session.SessionState;
+import com.google.cloud.spanner.pgadapter.statements.DdlExecutor.Table;
 import com.google.cloud.spanner.pgadapter.statements.SimpleParser.TableOrIndexName;
 import com.google.cloud.spanner.pgadapter.utils.RegexQueryPartReplacer;
 import com.google.common.base.Suppliers;
@@ -256,6 +257,12 @@ public class DdlExecutorTest {
             "create table databasechangelog_replaced (id bigint primary key)"));
   }
 
+  @Test
+  public void testTableComparison() {
+    assertEquals(1, new Table("public", "foo", "bar").compareTo(new Table("public", "baz", "foo")));
+    assertEquals(-1, new Table("public", "foo", "bar").compareTo(new Table("public", "bar", null)));
+  }
+
   private String applyReplacers(DdlExecutor ddlExecutor, String sql) {
     Statement statement = Statement.of(sql);
     ParsedStatement parsedStatement = PARSER.parse(Statement.of(sql));
diff --git a/src/test/nodejs/node-postgres/package.json b/src/test/nodejs/node-postgres/package.json
index a276f78f..db4e3792 100644
--- a/src/test/nodejs/node-postgres/package.json
+++ b/src/test/nodejs/node-postgres/package.json
@@ -11,7 +11,7 @@
   "dependencies": {
     "pg": "^8.9.0",
     "pg-copy-streams": "^6.0.4",
-    "reflect-metadata": "^0.1.13",
+    "reflect-metadata": "^0.2.1",
     "yargs": "^17.5.1"
   },
   "scripts": {
diff --git a/src/test/nodejs/typeorm/data-test/package.json b/src/test/nodejs/typeorm/data-test/package.json
index 6941ccd0..e1b144ec 100644
--- a/src/test/nodejs/typeorm/data-test/package.json
+++ b/src/test/nodejs/typeorm/data-test/package.json
@@ -10,7 +10,7 @@
    },
    "dependencies": {
       "typeorm": "0.3.17",
-      "reflect-metadata": "^0.1.13",
+      "reflect-metadata": "^0.2.1",
       "pg": "^8.9.0",
       "yargs": "^17.5.1"
    },