Repository: igniterealtime/Openfire
Pull request #2717: CI: Introduce checks for the database install scripts
Author: login: guusdk
Created: 2025-03-13T10:51:57Z | Merged: 2025-03-13T22:47:44Z

Prior to this commit, Openfire's continuous integration already had some scripts that verify the scripts used to update the database managed by Openfire from some base version to a newer version. These checks do not verify the installation script - only the update scripts, which provide a 'delta'.

In this commit, the mechanism used to test the update scripts is repurposed to also test the install scripts:
- instead of provisioning the database with a known-good (but old) database installation script, the latest version of the script is used (which is the system under test)
- the 'update runner' is not executed at all - instead, it is assumed that a bug in the install script will cause the docker build to fail.


Diff:
diff --git a/.github/workflows/continuous-integration-workflow.yml b/.github/workflows/continuous-integration-workflow.yml
index 983449fe82..7c5ba49769 100644
--- a/.github/workflows/continuous-integration-workflow.yml
+++ b/.github/workflows/continuous-integration-workflow.yml
@@ -265,8 +265,8 @@ jobs:
         if: ${{ always() && steps.startCIServer.conclusion == 'success' }} # TODO figure out if this is correct. The intent is to have the server stopped if it was successfully started, even if the tests fail. Failing tests should still cause the job to fail.
         uses: ./.github/actions/stopserver-action
 
-  should-do-database-upgrade-tests:
-    name: Check if database upgrade tests should be run
+  should-do-database-tests:
+    name: Check if database install/upgrade tests should be run
     runs-on: ubuntu-latest
     permissions:
       pull-requests: read
@@ -286,11 +286,52 @@ jobs:
               - '.github/workflows/continuous-integration-workflow.yml'
               - 'xmppserver/pom.xml'
 
-  sqlserver:
-    name: Test SQL Server Upgrades
-    needs: [build, should-do-database-upgrade-tests, check_branch]
+  sqlserver-install:
+    name: Test MS SQL Server install script
+    needs: [build, should-do-database-tests, check_branch]
     runs-on: ubuntu-latest
-    if: ${{ needs.should-do-database-upgrade-tests.outputs.check == 'true' || needs.check_branch.outputs.is_publishable_branch == 'true'}}
+    if: ${{ needs.should-do-database-tests.outputs.check == 'true' || needs.check_branch.outputs.is_publishable_branch == 'true'}}
+    steps:
+      - name: Checkout Openfire
+        uses: actions/checkout@v4
+      - name: Set up JDK 17 Zulu
+        uses: actions/setup-java@v4
+        with:
+          java-version: 17
+          distribution: zulu
+          cache: maven
+      - name: Restore mvn repo artifacts from build job
+        uses: actions/download-artifact@v4
+        with:
+          name: mvn-repo
+          path: ~/.m2/repository/org/igniterealtime/openfire/
+      - name: Set environment variables
+        run: |
+          echo "CONNECTION_STRING=jdbc:sqlserver://localhost:1433;databaseName=openfire;applicationName=Openfire" >> $GITHUB_ENV
+          echo "CONNECTION_DRIVER=com.microsoft.sqlserver.jdbc.SQLServerDriver" >> $GITHUB_ENV
+          echo "CONNECTION_USERNAME=sa" >> $GITHUB_ENV
+          echo "CONNECTION_PASSWORD=SecurePa55w0rd" >> $GITHUB_ENV
+          OPENFIREVSN=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)
+          echo "OPENFIREVSN=$OPENFIREVSN" >> $GITHUB_ENV
+          echo "JAVA_HOME=$(echo $JAVA_HOME_17_X64)" >> $GITHUB_ENV
+      - name: Copy the Openfire database installation script
+        run: |
+          mkdir olddb
+          cp $GITHUB_WORKSPACE/distribution/src/database/openfire_sqlserver.sql $GITHUB_WORKSPACE/olddb/openfire_sqlserver.sql
+      - name: Start database server and install database
+        run: docker compose -f ./build/ci/compose/mssql.yml up --detach
+      - name: Build & run database tester
+        run: |
+          pushd ./build/ci/updater
+          ./mvnw package
+          java -jar ./target/updaterunner-1.0.0-jar-with-dependencies.jar
+
+
+  sqlserver-upgrade:
+    name: Test MS SQL Server upgrade scripts
+    needs: [build, should-do-database-tests, check_branch]
+    runs-on: ubuntu-latest
+    if: ${{ needs.should-do-database-tests.outputs.check == 'true' || needs.check_branch.outputs.is_publishable_branch == 'true'}}
     steps:
       - name: Checkout Openfire
         uses: actions/checkout@v4
@@ -320,18 +361,59 @@ jobs:
           curl https://raw.githubusercontent.com/igniterealtime/Openfire/v3.9.3/src/database/openfire_sqlserver.sql > $GITHUB_WORKSPACE/olddb/openfire_sqlserver.sql
       - name: Start database server and install database
         run: docker compose -f ./build/ci/compose/mssql.yml up --detach
-      - name: Build & run update tester
+      - name: Build & run database tester
+        run: |
+          pushd ./build/ci/updater
+          ./mvnw package
+          java -jar ./target/updaterunner-1.0.0-jar-with-dependencies.jar
+
+
+  postgres-install:
+    name: Test Postgres install script
+    needs: [build, should-do-database-tests, check_branch]
+    runs-on: ubuntu-latest
+    if: ${{ needs.should-do-database-tests.outputs.check == 'true' || needs.check_branch.outputs.is_publishable_branch == 'true'}}
+    steps:
+      - name: Checkout Openfire
+        uses: actions/checkout@v4
+      - name: Set up JDK 17 Zulu
+        uses: actions/setup-java@v4
+        with:
+          java-version: 17
+          distribution: zulu
+          cache: maven
+      - name: Restore mvn repo artifacts from build job
+        uses: actions/download-artifact@v4
+        with:
+          name: mvn-repo
+          path: ~/.m2/repository/org/igniterealtime/openfire/
+      - name: Set environment variables
+        run: |
+          echo "CONNECTION_STRING=jdbc:postgresql://localhost:5432/openfire" >> $GITHUB_ENV
+          echo "CONNECTION_DRIVER=org.postgresql.Driver" >> $GITHUB_ENV
+          echo "CONNECTION_USERNAME=openfire" >> $GITHUB_ENV
+          echo "CONNECTION_PASSWORD=SecurePa55w0rd" >> $GITHUB_ENV
+          OPENFIREVSN=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)
+          echo "OPENFIREVSN=$OPENFIREVSN" >> $GITHUB_ENV
+          echo "JAVA_HOME=$(echo $JAVA_HOME_17_X64)" >> $GITHUB_ENV
+      - name: Copy the Openfire database installation script
+        run: |
+          mkdir olddb
+          cp $GITHUB_WORKSPACE/distribution/src/database/openfire_postgresql.sql $GITHUB_WORKSPACE/olddb/openfire_postgresql.sql
+      - name: Start database server and install database
+        run: docker compose -f ./build/ci/compose/postgresql.yml up --detach
+      - name: Build & run database tester
         run: |
           pushd ./build/ci/updater
           ./mvnw package
           java -jar ./target/updaterunner-1.0.0-jar-with-dependencies.jar
 
 
-  postgres:
-    name: Test Postgres Upgrades
-    needs: [build, should-do-database-upgrade-tests, check_branch]
+  postgres-upgrade:
+    name: Test Postgres upgrade scripts
+    needs: [build, should-do-database-tests, check_branch]
     runs-on: ubuntu-latest
-    if: ${{ needs.should-do-database-upgrade-tests.outputs.check == 'true' || needs.check_branch.outputs.is_publishable_branch == 'true'}}
+    if: ${{ needs.should-do-database-tests.outputs.check == 'true' || needs.check_branch.outputs.is_publishable_branch == 'true'}}
     steps:
       - name: Checkout Openfire
         uses: actions/checkout@v4
@@ -361,18 +443,59 @@ jobs:
           curl https://raw.githubusercontent.com/igniterealtime/Openfire/v3.9.3/src/database/openfire_postgresql.sql > $GITHUB_WORKSPACE/olddb/openfire_postgresql.sql
       - name: Start database server and install database
         run: docker compose -f ./build/ci/compose/postgresql.yml up --detach
-      - name: Build & run update tester
+      - name: Build & run database tester
+        run: |
+          pushd ./build/ci/updater
+          ./mvnw package
+          java -jar ./target/updaterunner-1.0.0-jar-with-dependencies.jar
+
+
+  mysql-install:
+    name: Test MySQL install script
+    needs: [build, should-do-database-tests, check_branch]
+    runs-on: ubuntu-latest
+    if: ${{ needs.should-do-database-tests.outputs.check == 'true' || needs.check_branch.outputs.is_publishable_branch == 'true'}}
+    steps:
+      - name: Checkout Openfire
+        uses: actions/checkout@v4
+      - name: Set up JDK 17 Zulu
+        uses: actions/setup-java@v4
+        with:
+          java-version: 17
+          distribution: zulu
+          cache: maven
+      - name: Restore mvn repo artifacts from build job
+        uses: actions/download-artifact@v4
+        with:
+          name: mvn-repo
+          path: ~/.m2/repository/org/igniterealtime/openfire/
+      - name: Set environment variables
+        run: |
+          echo "CONNECTION_STRING=jdbc:mysql://localhost:3306/openfire?rewriteBatchedStatements=true&characterEncoding=UTF-8&characterSetResults=UTF-8&serverTimezone=UTC" >> $GITHUB_ENV
+          echo "CONNECTION_DRIVER=com.mysql.cj.jdbc.Driver" >> $GITHUB_ENV
+          echo "CONNECTION_USERNAME=root" >> $GITHUB_ENV
+          echo "CONNECTION_PASSWORD=SecurePa55w0rd" >> $GITHUB_ENV
+          OPENFIREVSN=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)
+          echo "OPENFIREVSN=$OPENFIREVSN" >> $GITHUB_ENV
+          echo "JAVA_HOME=$(echo $JAVA_HOME_17_X64)" >> $GITHUB_ENV
+      - name: Copy the Openfire database installation script
+        run: |
+          mkdir olddb
+          cp $GITHUB_WORKSPACE/distribution/src/database/openfire_mysql.sql $GITHUB_WORKSPACE/olddb/openfire_mysql.sql
+      - name: Start database server and install database
+        run: docker compose -f ./build/ci/compose/mysql.yml up --detach
+      - name: Build & run database tester
         run: |
           pushd ./build/ci/updater
           ./mvnw package
           java -jar ./target/updaterunner-1.0.0-jar-with-dependencies.jar
 
 
-  mysql:
-    name: Test MySQL Upgrades
-    needs: [build, should-do-database-upgrade-tests, check_branch]
+  mysql-upgrade:
+    name: Test MySQL upgrade scripts
+    needs: [build, should-do-database-tests, check_branch]
     runs-on: ubuntu-latest
-    if: ${{ needs.should-do-database-upgrade-tests.outputs.check == 'true' || needs.check_branch.outputs.is_publishable_branch == 'true'}}
+    if: ${{ needs.should-do-database-tests.outputs.check == 'true' || needs.check_branch.outputs.is_publishable_branch == 'true'}}
     steps:
       - name: Checkout Openfire
         uses: actions/checkout@v4
@@ -402,7 +525,7 @@ jobs:
           curl https://raw.githubusercontent.com/igniterealtime/Openfire/v3.9.3/src/database/openfire_mysql.sql > $GITHUB_WORKSPACE/olddb/openfire_mysql.sql
       - name: Start database server and install database
         run: docker compose -f ./build/ci/compose/mysql.yml up --detach
-      - name: Build & run update tester
+      - name: Build & run database tester
         run: |
           pushd ./build/ci/updater
           ./mvnw package
@@ -411,7 +534,7 @@ jobs:
   publish-maven:
     name: Publish to Maven
     runs-on: ubuntu-latest
-    needs: [aioxmpp, connectivity, smack, check_branch, sqlserver, postgres, mysql]
+    needs: [aioxmpp, connectivity, smack, check_branch, sqlserver-install, sqlserver-upgrade, postgres-install, postgres-upgrade, mysql-install, mysql-upgrade]
     if: ${{github.repository == 'igniterealtime/Openfire' && github.event_name == 'push' && needs.check_branch.outputs.is_publishable_branch == 'true'}}
 
     steps:
@@ -438,7 +561,7 @@ jobs:
   build-and-push-docker:
     name: Publish to GitHub's Docker registry
     runs-on: ubuntu-latest
-    needs: [aioxmpp, connectivity, smack, check_branch, sqlserver, postgres, mysql]
+    needs: [aioxmpp, connectivity, smack, check_branch, sqlserver-install, sqlserver-upgrade, postgres-install, postgres-upgrade, mysql-install, mysql-upgrade]
     if: |
       github.event_name == 'push' && 
       (contains(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main')
diff --git a/build/ci/updater/src/main/java/com/igniterealtime/openfire/updaterunner/Main.java b/build/ci/updater/src/main/java/com/igniterealtime/openfire/updaterunner/Main.java
index 4688990bb9..bea3b529c4 100644
--- a/build/ci/updater/src/main/java/com/igniterealtime/openfire/updaterunner/Main.java
+++ b/build/ci/updater/src/main/java/com/igniterealtime/openfire/updaterunner/Main.java
@@ -65,7 +65,7 @@ public static void main(String[] args) {
             SchemaManager sm = new SchemaManager();
             boolean fixed = sm.checkOpenfireSchema(conn);
             if(!fixed){
-                throw new Exception("Failed to upgrade database");
+                throw new Exception("Failed to install or upgrade the database! It is likely that the installation or upgrade SQL scripts contain a bug.");
             }
         } catch (Exception e) {
             System.out.println(e.getClass() + "\n" + e.getMessage());
diff --git a/distribution/src/database/openfire_db2.sql b/distribution/src/database/openfire_db2.sql
index e5a102dc06..b07c1c5efd 100644
--- a/distribution/src/database/openfire_db2.sql
+++ b/distribution/src/database/openfire_db2.sql
@@ -395,11 +395,12 @@ INSERT INTO ofID (idType, id) VALUES (23, 1);
 INSERT INTO ofID (idType, id) VALUES (26, 2);
 INSERT INTO ofID (idType, id) VALUES (27, 1);
 
-INSERT INTO ofVersion (name, version) VALUES ('openfire', 37);
-
 -- Entry for admin user
 INSERT INTO ofUser (username, plainPassword, name, email, creationDate, modificationDate)
     VALUES ('admin', 'admin', 'Administrator', 'admin@example.com', '0', '0');
 
 -- Entry for default conference service
 INSERT INTO ofMucService (serviceID, subdomain, isHidden) VALUES (1, 'conference', 0);
+
+-- Do this last, as it is used by a continuous integration check to verify that the entire script was executed successfully.
+INSERT INTO ofVersion (name, version) VALUES ('openfire', 37);
diff --git a/distribution/src/database/openfire_hsqldb.sql b/distribution/src/database/openfire_hsqldb.sql
index fd2d7c1461..9ba2706403 100644
--- a/distribution/src/database/openfire_hsqldb.sql
+++ b/distribution/src/database/openfire_hsqldb.sql
@@ -383,8 +383,6 @@ INSERT INTO ofID (idType, id) VALUES (23, 1);
 INSERT INTO ofID (idType, id) VALUES (26, 2);
 INSERT INTO ofID (idType, id) VALUES (27, 1);
 
-INSERT INTO ofVersion (name, version) VALUES ('openfire', 37);
-
 // Entry for admin user
 INSERT INTO ofUser (username, plainPassword, name, email, creationDate, modificationDate)
     VALUES ('admin', 'admin', 'Administrator', 'admin@example.com', '0', '0');
@@ -392,6 +390,9 @@ INSERT INTO ofUser (username, plainPassword, name, email, creationDate, modifica
 // Entry for default conference service
 INSERT INTO ofMucService (serviceID, subdomain, isHidden) VALUES (1, 'conference', 0);
 
+// Do this last, as it is used by a continuous integration check to verify that the entire script was executed successfully.
+INSERT INTO ofVersion (name, version) VALUES ('openfire', 37);
+
 // The value is the size in megabytes that the .log file can reach before an automatic
 // checkpoint occurs. A checkpoint rewrites the .script file and clears the .log file
 // see http://www.hsqldb.org/doc/guide/ch04.html#hsqldb.log_size
diff --git a/distribution/src/database/openfire_mysql.sql b/distribution/src/database/openfire_mysql.sql
index 7698fc7755..f49fc41bcf 100644
--- a/distribution/src/database/openfire_mysql.sql
+++ b/distribution/src/database/openfire_mysql.sql
@@ -373,11 +373,12 @@ INSERT INTO ofID (idType, id) VALUES (23, 1);
 INSERT INTO ofID (idType, id) VALUES (26, 2);
 INSERT INTO ofID (idType, id) VALUES (27, 1);
 
-INSERT INTO ofVersion (name, version) VALUES ('openfire', 37);
-
 # Entry for admin user
 INSERT INTO ofUser (username, plainPassword, name, email, creationDate, modificationDate)
     VALUES ('admin', 'admin', 'Administrator', 'admin@example.com', '0', '0');
 
 # Entry for default conference service
 INSERT INTO ofMucService (serviceID, subdomain, isHidden) VALUES (1, 'conference', 0);
+
+# Do this last, as it is used by a continuous integration check to verify that the entire script was executed successfully.
+INSERT INTO ofVersion (name, version) VALUES ('openfire', 37);
diff --git a/distribution/src/database/openfire_oracle.sql b/distribution/src/database/openfire_oracle.sql
index 633e83b516..1bd489bb41 100644
--- a/distribution/src/database/openfire_oracle.sql
+++ b/distribution/src/database/openfire_oracle.sql
@@ -381,8 +381,6 @@ INSERT INTO ofID (idType, id) VALUES (23, 1);
 INSERT INTO ofID (idType, id) VALUES (26, 2);
 INSERT INTO ofID (idType, id) VALUES (27, 1);
 
-INSERT INTO ofVersion (name, version) VALUES ('openfire', 37);
-
 -- Entry for admin user
 INSERT INTO ofUser (username, plainPassword, name, email, creationDate, modificationDate)
     VALUES ('admin', 'admin', 'Administrator', 'admin@example.com', '0', '0');
@@ -390,4 +388,7 @@ INSERT INTO ofUser (username, plainPassword, name, email, creationDate, modifica
 -- Entry for default conference service
 INSERT INTO ofMucService (serviceID, subdomain, isHidden) VALUES (1, 'conference', 0);
 
+-- Do this last, as it is used by a continuous integration check to verify that the entire script was executed successfully.
+INSERT INTO ofVersion (name, version) VALUES ('openfire', 37);
+
 commit;
diff --git a/distribution/src/database/openfire_postgresql.sql b/distribution/src/database/openfire_postgresql.sql
index cd553bd662..3acfcdadf9 100644
--- a/distribution/src/database/openfire_postgresql.sql
+++ b/distribution/src/database/openfire_postgresql.sql
@@ -389,11 +389,12 @@ INSERT INTO ofID (idType, id) VALUES (23, 1);
 INSERT INTO ofID (idType, id) VALUES (26, 2);
 INSERT INTO ofID (idType, id) VALUES (27, 1);
 
-INSERT INTO ofVersion (name, version) VALUES ('openfire', 37);
-
 -- Entry for admin user
 INSERT INTO ofUser (username, plainPassword, name, email, creationDate, modificationDate)
     VALUES ('admin', 'admin', 'Administrator', 'admin@example.com', '0', '0');
 
 -- Entry for default conference service
 INSERT INTO ofMucService (serviceID, subdomain, isHidden) VALUES (1, 'conference', 0);
+
+-- Do this last, as it is used by a continuous integration check to verify that the entire script was executed successfully.
+INSERT INTO ofVersion (name, version) VALUES ('openfire', 37);
diff --git a/distribution/src/database/openfire_sqlserver.sql b/distribution/src/database/openfire_sqlserver.sql
index a669a00445..aa77da034e 100644
--- a/distribution/src/database/openfire_sqlserver.sql
+++ b/distribution/src/database/openfire_sqlserver.sql
@@ -386,11 +386,12 @@ INSERT INTO ofID (idType, id) VALUES (23, 1);
 INSERT INTO ofID (idType, id) VALUES (26, 2);
 INSERT INTO ofID (idType, id) VALUES (27, 1);
 
-INSERT INTO ofVersion (name, version) VALUES ('openfire', 37);
-
 /* Entry for admin user */
 INSERT INTO ofUser (username, plainPassword, name, email, creationDate, modificationDate)
     VALUES ('admin', 'admin', 'Administrator', 'admin@example.com', '0', '0');
 
 /* Entry for default conference service */
 INSERT INTO ofMucService (serviceID, subdomain, isHidden) VALUES (1, 'conference', 0);
+
+/* Do this last, as it is used by a continuous integration check to verify that the entire script was executed successfully. */
+INSERT INTO ofVersion (name, version) VALUES ('openfire', 37);
diff --git a/distribution/src/database/openfire_sybase.sql b/distribution/src/database/openfire_sybase.sql
index ff486e76f5..466c0654a9 100644
--- a/distribution/src/database/openfire_sybase.sql
+++ b/distribution/src/database/openfire_sybase.sql
@@ -386,11 +386,12 @@ INSERT INTO ofID (idType, id) VALUES (23, 1)
 INSERT INTO ofID (idType, id) VALUES (26, 2)
 INSERT INTO ofID (idType, id) VALUES (27, 1)
 
-INSERT INTO ofVersion (name, version) VALUES ('openfire', 37)
-
 /* Entry for admin user */
 INSERT INTO ofUser (username, plainPassword, name, email, creationDate, modificationDate)
     VALUES ('admin', 'admin', 'Administrator', 'admin@example.com', '0', '0')
 
 /* Entry for default conference service */
 INSERT INTO ofMucService (serviceID, subdomain, isHidden) VALUES (1, 'conference', 0)
+
+/* Do this last, as it is used by a continuous integration check to verify that the entire script was executed successfully. */
+INSERT INTO ofVersion (name, version) VALUES ('openfire', 37)


Reviews:
user: login: gemini-code-assist[bot]
body: Hello @guusdk, I'm Gemini Code Assist[^1]! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

## Summary of Changes
This pull request enhances the continuous integration workflow by introducing checks for the database installation scripts, in addition to the existing checks for database update scripts. The existing mechanism for testing update scripts is repurposed to also test the install scripts. Instead of provisioning the database with a known-good (but old) database installation script, the latest version of the script is used. The 'update runner' is not executed; instead, it is assumed that a bug in the install script will cause the docker build to fail.

### Highlights
* **CI Workflow Enhancement**: The CI workflow is updated to include checks for database installation scripts, ensuring that new installations are also validated.
* **Database Testing**: The database testing jobs are split into install and upgrade jobs for SQL Server, Postgres, and MySQL.
* **Dependency Update**: The 'publish-maven' and 'build-and-push-docker' jobs are updated to depend on the new database install and upgrade jobs.

### Changelog
* **.github/workflows/continuous-integration-workflow.yml**
  * Renamed 'should-do-database-upgrade-tests' job to 'should-do-database-tests'.
  * Introduced new jobs for testing database installation scripts for SQL Server ('sqlserver-install'), Postgres ('postgres-install'), and MySQL ('mysql-install').
  * Renamed existing database upgrade test jobs to 'sqlserver-upgrade', 'postgres-upgrade', and 'mysql-upgrade'.
  * Added steps to the new install jobs to set up the environment, copy the database installation script, and start the database server.
  * Updated the 'publish-maven' job to depend on the new database install and upgrade jobs.
  * Updated the 'build-and-push-docker' job to depend on the new database install and upgrade jobs.


<details>

<summary><b>Using Gemini Code Assist</b></summary>
<br>

The full guide for Gemini Code Assist can be found on our [documentation page](https://developers.google.com/gemini-code-assist/docs/review-github-code), here are some quick tips.

<b>Invoking Gemini</b>

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either `/gemini <command>` or `@gemini-code-assist <command>`. Below is a summary of the supported commands.

Feature | Command | Description
--- | --- | ---
Code Review | `/gemini review` | Performs a code review for the current pull request in its current state.
Pull Request Summary | `/gemini summary` | Provides a summary of the current pull request in its current state.
Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments.
Help | `/gemini help` | Displays a list of available commands.

<b>Customization</b>

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a `.gemini/` folder in the base of the repository. Detailed instructions can be found [here](https://developers.google.com/gemini-code-assist/docs/review-github-code).

<b>Limitations & Feedback</b>

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with :thumbsup: and :thumbsdown: on @gemini-code-assist comments to provide feedback.

</details>

<b>You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the [Gemini Code Assist IDE Extension](https://cloud.google.com/products/gemini/code-assist).</b>


[^1]: Review the [Privacy Notices](https://policies.google.com/privacy), [Generative AI Prohibited Use Policy](https://policies.google.com/terms/generative-ai/use-policy), [Terms of Service](https://policies.google.com/terms), and learn how to configure Gemini Code Assist in GitHub [here](https://developers.google.com/gemini-code-assist/docs/review-github-code). Gemini can make mistakes, so double check it and [use code with caution](https://support.google.com/legal/answer/13505487).

---

**Did you know?**

PostgreSQL is known for its strict adherence to SQL standards and its extensibility, allowing users to define custom data types, functions, and operators.

state: COMMENTED
author_association: NONE
submitted_at: 2025-03-13T10:52:11Z
user: login: gemini-code-assist[bot]
body: ## Code Review
This pull request introduces CI checks for database install scripts, which is a valuable addition to the project. The changes involve repurposing the existing mechanism used to test update scripts to also test install scripts. This is achieved by using the latest version of the install script and assuming that any bugs in the script will cause the docker build to fail. The approach seems reasonable, but there are a few areas that could be improved.

### Summary of Findings
* **Job Naming Consistency**: The naming convention for the jobs is inconsistent. Some jobs are named with 'upgrade' while others are named with 'install'. It would be better to have a consistent naming convention for all jobs.
* **Duplicated Steps in Jobs**: The steps in the `sqlserver-install`, `postgres-install`, and `mysql-install` jobs are almost identical. Consider creating a reusable action or template to avoid duplication and improve maintainability.
* **Missing Error Handling**: The scripts do not explicitly check for errors after executing commands like `cp` or `docker compose up`. Adding error handling would make the CI more robust.

### Merge Readiness
The pull request introduces important CI improvements. However, the duplicated steps and lack of explicit error handling should be addressed before merging. I am unable to directly approve this pull request, and recommend that others review and approve this code before merging. I recommend that the pull request not be merged until the identified issues are addressed.
state: CHANGES_REQUESTED
author_association: NONE
submitted_at: 2025-03-13T10:52:27Z
user: login: Fishbowler
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-13T20:36:03Z
user: login: Fishbowler
body: This is awesome.
state: APPROVED
author_association: MEMBER
submitted_at: 2025-03-13T20:51:21Z

Review comments:
diff_hunk: @@ -286,11 +286,47 @@ jobs:
               - '.github/workflows/continuous-integration-workflow.yml'
               - 'xmppserver/pom.xml'
 
-  sqlserver:
-    name: Test SQL Server Upgrades
-    needs: [build, should-do-database-upgrade-tests, check_branch]
+  sqlserver-install:
+    name: Test MS SQL Server install script
+    needs: [build, should-do-database-tests, check_branch]
     runs-on: ubuntu-latest
-    if: ${{ needs.should-do-database-upgrade-tests.outputs.check == 'true' || needs.check_branch.outputs.is_publishable_branch == 'true'}}
+    if: ${{ needs.should-do-database-tests.outputs.check == 'true' || needs.check_branch.outputs.is_publishable_branch == 'true'}}
+    steps:
+      - name: Checkout Openfire
+        uses: actions/checkout@v4
+      - name: Set up JDK 17 Zulu
+        uses: actions/setup-java@v4
+        with:
+          java-version: 17
+          distribution: zulu
+          cache: maven
+      - name: Restore mvn repo artifacts from build job
+        uses: actions/download-artifact@v4
+        with:
+          name: mvn-repo
+          path: ~/.m2/repository/org/igniterealtime/openfire/
+      - name: Set environment variables
+        run: |
+          echo "CONNECTION_STRING=jdbc:sqlserver://localhost:1433;databaseName=openfire;applicationName=Openfire" >> $GITHUB_ENV
+          echo "CONNECTION_DRIVER=com.microsoft.sqlserver.jdbc.SQLServerDriver" >> $GITHUB_ENV
+          echo "CONNECTION_USERNAME=sa" >> $GITHUB_ENV
+          echo "CONNECTION_PASSWORD=SecurePa55w0rd" >> $GITHUB_ENV
+          OPENFIREVSN=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)
+          echo "OPENFIREVSN=$OPENFIREVSN" >> $GITHUB_ENV
+          echo "JAVA_HOME=$(echo $JAVA_HOME_17_X64)" >> $GITHUB_ENV
+      - name: Copy the Openfire database installation script
+        run: |
+          mkdir olddb
+          cp $GITHUB_WORKSPACE/distribution/src/database/openfire_sqlserver.sql > $GITHUB_WORKSPACE/olddb/openfire_sqlserver.sql
path: .github/workflows/continuous-integration-workflow.yml
user: login: gemini-code-assist[bot]
body: ![high](https://img.shields.io/badge/priority-high-orange)

It's good to create the directory first, but it would be better to add error handling to ensure the directory was created successfully.  Consider adding `|| exit 1` to the end of the command.

```
          mkdir olddb || exit 1
          cp $GITHUB_WORKSPACE/distribution/src/database/openfire_sqlserver.sql $GITHUB_WORKSPACE/olddb/openfire_sqlserver.sql
```
created_at: 2025-03-13T10:52:26Z
author_association: NONE
diff_hunk: @@ -286,11 +286,47 @@ jobs:
               - '.github/workflows/continuous-integration-workflow.yml'
               - 'xmppserver/pom.xml'
 
-  sqlserver:
-    name: Test SQL Server Upgrades
-    needs: [build, should-do-database-upgrade-tests, check_branch]
+  sqlserver-install:
+    name: Test MS SQL Server install script
+    needs: [build, should-do-database-tests, check_branch]
     runs-on: ubuntu-latest
-    if: ${{ needs.should-do-database-upgrade-tests.outputs.check == 'true' || needs.check_branch.outputs.is_publishable_branch == 'true'}}
+    if: ${{ needs.should-do-database-tests.outputs.check == 'true' || needs.check_branch.outputs.is_publishable_branch == 'true'}}
+    steps:
+      - name: Checkout Openfire
+        uses: actions/checkout@v4
+      - name: Set up JDK 17 Zulu
+        uses: actions/setup-java@v4
+        with:
+          java-version: 17
+          distribution: zulu
+          cache: maven
+      - name: Restore mvn repo artifacts from build job
+        uses: actions/download-artifact@v4
+        with:
+          name: mvn-repo
+          path: ~/.m2/repository/org/igniterealtime/openfire/
+      - name: Set environment variables
+        run: |
+          echo "CONNECTION_STRING=jdbc:sqlserver://localhost:1433;databaseName=openfire;applicationName=Openfire" >> $GITHUB_ENV
+          echo "CONNECTION_DRIVER=com.microsoft.sqlserver.jdbc.SQLServerDriver" >> $GITHUB_ENV
+          echo "CONNECTION_USERNAME=sa" >> $GITHUB_ENV
+          echo "CONNECTION_PASSWORD=SecurePa55w0rd" >> $GITHUB_ENV
+          OPENFIREVSN=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)
+          echo "OPENFIREVSN=$OPENFIREVSN" >> $GITHUB_ENV
+          echo "JAVA_HOME=$(echo $JAVA_HOME_17_X64)" >> $GITHUB_ENV
+      - name: Copy the Openfire database installation script
+        run: |
+          mkdir olddb
+          cp $GITHUB_WORKSPACE/distribution/src/database/openfire_sqlserver.sql > $GITHUB_WORKSPACE/olddb/openfire_sqlserver.sql
+      - name: Start database server and install database
+        run: docker compose -f ./build/ci/compose/mssql.yml up --detach
path: .github/workflows/continuous-integration-workflow.yml
user: login: gemini-code-assist[bot]
body: ![high](https://img.shields.io/badge/priority-high-orange)

Consider adding error handling to ensure the docker compose command was executed successfully.  Consider adding `|| exit 1` to the end of the command.

```
        run: docker compose -f ./build/ci/compose/mssql.yml up --detach || exit 1
```
created_at: 2025-03-13T10:52:26Z
author_association: NONE
diff_hunk: @@ -327,11 +363,47 @@ jobs:
           java -jar ./target/updaterunner-1.0.0-jar-with-dependencies.jar
 
 
-  postgres:
-    name: Test Postgres Upgrades
-    needs: [build, should-do-database-upgrade-tests, check_branch]
+  postgres-install:
+    name: Test Postgres install script
+    needs: [build, should-do-database-tests, check_branch]
+    runs-on: ubuntu-latest
+    if: ${{ needs.should-do-database-tests.outputs.check == 'true' || needs.check_branch.outputs.is_publishable_branch == 'true'}}
+    steps:
+      - name: Checkout Openfire
+        uses: actions/checkout@v4
+      - name: Set up JDK 17 Zulu
+        uses: actions/setup-java@v4
+        with:
+          java-version: 17
+          distribution: zulu
+          cache: maven
+      - name: Restore mvn repo artifacts from build job
+        uses: actions/download-artifact@v4
+        with:
+          name: mvn-repo
+          path: ~/.m2/repository/org/igniterealtime/openfire/
+      - name: Set environment variables
+        run: |
+          echo "CONNECTION_STRING=jdbc:postgresql://localhost:5432/openfire" >> $GITHUB_ENV
+          echo "CONNECTION_DRIVER=org.postgresql.Driver" >> $GITHUB_ENV
+          echo "CONNECTION_USERNAME=openfire" >> $GITHUB_ENV
+          echo "CONNECTION_PASSWORD=SecurePa55w0rd" >> $GITHUB_ENV
+          OPENFIREVSN=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)
+          echo "OPENFIREVSN=$OPENFIREVSN" >> $GITHUB_ENV
+          echo "JAVA_HOME=$(echo $JAVA_HOME_17_X64)" >> $GITHUB_ENV
+      - name: Copy the Openfire database installation script
+        run: |
+          mkdir olddb
+          cp $GITHUB_WORKSPACE/distribution/src/database/openfire_postgresql.sql > $GITHUB_WORKSPACE/olddb/openfire_postgresql.sql
path: .github/workflows/continuous-integration-workflow.yml
user: login: gemini-code-assist[bot]
body: ![high](https://img.shields.io/badge/priority-high-orange)

It's good to create the directory first, but it would be better to add error handling to ensure the directory was created successfully.  Consider adding `|| exit 1` to the end of the command.

```
          mkdir olddb || exit 1
          cp $GITHUB_WORKSPACE/distribution/src/database/openfire_postgresql.sql $GITHUB_WORKSPACE/olddb/openfire_postgresql.sql
```
created_at: 2025-03-13T10:52:27Z
author_association: NONE
diff_hunk: @@ -327,11 +363,47 @@ jobs:
           java -jar ./target/updaterunner-1.0.0-jar-with-dependencies.jar
 
 
-  postgres:
-    name: Test Postgres Upgrades
-    needs: [build, should-do-database-upgrade-tests, check_branch]
+  postgres-install:
+    name: Test Postgres install script
+    needs: [build, should-do-database-tests, check_branch]
+    runs-on: ubuntu-latest
+    if: ${{ needs.should-do-database-tests.outputs.check == 'true' || needs.check_branch.outputs.is_publishable_branch == 'true'}}
+    steps:
+      - name: Checkout Openfire
+        uses: actions/checkout@v4
+      - name: Set up JDK 17 Zulu
+        uses: actions/setup-java@v4
+        with:
+          java-version: 17
+          distribution: zulu
+          cache: maven
+      - name: Restore mvn repo artifacts from build job
+        uses: actions/download-artifact@v4
+        with:
+          name: mvn-repo
+          path: ~/.m2/repository/org/igniterealtime/openfire/
+      - name: Set environment variables
+        run: |
+          echo "CONNECTION_STRING=jdbc:postgresql://localhost:5432/openfire" >> $GITHUB_ENV
+          echo "CONNECTION_DRIVER=org.postgresql.Driver" >> $GITHUB_ENV
+          echo "CONNECTION_USERNAME=openfire" >> $GITHUB_ENV
+          echo "CONNECTION_PASSWORD=SecurePa55w0rd" >> $GITHUB_ENV
+          OPENFIREVSN=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)
+          echo "OPENFIREVSN=$OPENFIREVSN" >> $GITHUB_ENV
+          echo "JAVA_HOME=$(echo $JAVA_HOME_17_X64)" >> $GITHUB_ENV
+      - name: Copy the Openfire database installation script
+        run: |
+          mkdir olddb
+          cp $GITHUB_WORKSPACE/distribution/src/database/openfire_postgresql.sql > $GITHUB_WORKSPACE/olddb/openfire_postgresql.sql
+      - name: Start database server and install database
+        run: docker compose -f ./build/ci/compose/postgresql.yml up --detach
path: .github/workflows/continuous-integration-workflow.yml
user: login: gemini-code-assist[bot]
body: ![high](https://img.shields.io/badge/priority-high-orange)

Consider adding error handling to ensure the docker compose command was executed successfully.  Consider adding `|| exit 1` to the end of the command.

```
        run: docker compose -f ./build/ci/compose/postgresql.yml up --detach || exit 1
```
created_at: 2025-03-13T10:52:27Z
author_association: NONE
diff_hunk: @@ -368,11 +440,47 @@ jobs:
           java -jar ./target/updaterunner-1.0.0-jar-with-dependencies.jar
 
 
-  mysql:
-    name: Test MySQL Upgrades
-    needs: [build, should-do-database-upgrade-tests, check_branch]
+  mysql-install:
+    name: Test MySQL install script
+    needs: [build, should-do-database-tests, check_branch]
+    runs-on: ubuntu-latest
+    if: ${{ needs.should-do-database-tests.outputs.check == 'true' || needs.check_branch.outputs.is_publishable_branch == 'true'}}
+    steps:
+      - name: Checkout Openfire
+        uses: actions/checkout@v4
+      - name: Set up JDK 17 Zulu
+        uses: actions/setup-java@v4
+        with:
+          java-version: 17
+          distribution: zulu
+          cache: maven
+      - name: Restore mvn repo artifacts from build job
+        uses: actions/download-artifact@v4
+        with:
+          name: mvn-repo
+          path: ~/.m2/repository/org/igniterealtime/openfire/
+      - name: Set environment variables
+        run: |
+          echo "CONNECTION_STRING=jdbc:mysql://localhost:3306/openfire?rewriteBatchedStatements=true&characterEncoding=UTF-8&characterSetResults=UTF-8&serverTimezone=UTC" >> $GITHUB_ENV
+          echo "CONNECTION_DRIVER=com.mysql.cj.jdbc.Driver" >> $GITHUB_ENV
+          echo "CONNECTION_USERNAME=root" >> $GITHUB_ENV
+          echo "CONNECTION_PASSWORD=SecurePa55w0rd" >> $GITHUB_ENV
+          OPENFIREVSN=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)
+          echo "OPENFIREVSN=$OPENFIREVSN" >> $GITHUB_ENV
+          echo "JAVA_HOME=$(echo $JAVA_HOME_17_X64)" >> $GITHUB_ENV
+      - name: Copy the Openfire database installation script
+        run: |
+          mkdir olddb
+          cp $GITHUB_WORKSPACE/distribution/src/database/openfire_mysql.sql > $GITHUB_WORKSPACE/olddb/openfire_mysql.sql
path: .github/workflows/continuous-integration-workflow.yml
user: login: gemini-code-assist[bot]
body: ![high](https://img.shields.io/badge/priority-high-orange)

It's good to create the directory first, but it would be better to add error handling to ensure the directory was created successfully.  Consider adding `|| exit 1` to the end of the command.

```
          mkdir olddb || exit 1
          cp $GITHUB_WORKSPACE/distribution/src/database/openfire_mysql.sql $GITHUB_WORKSPACE/olddb/openfire_mysql.sql
```
created_at: 2025-03-13T10:52:27Z
author_association: NONE
diff_hunk: @@ -368,11 +440,47 @@ jobs:
           java -jar ./target/updaterunner-1.0.0-jar-with-dependencies.jar
 
 
-  mysql:
-    name: Test MySQL Upgrades
-    needs: [build, should-do-database-upgrade-tests, check_branch]
+  mysql-install:
+    name: Test MySQL install script
+    needs: [build, should-do-database-tests, check_branch]
+    runs-on: ubuntu-latest
+    if: ${{ needs.should-do-database-tests.outputs.check == 'true' || needs.check_branch.outputs.is_publishable_branch == 'true'}}
+    steps:
+      - name: Checkout Openfire
+        uses: actions/checkout@v4
+      - name: Set up JDK 17 Zulu
+        uses: actions/setup-java@v4
+        with:
+          java-version: 17
+          distribution: zulu
+          cache: maven
+      - name: Restore mvn repo artifacts from build job
+        uses: actions/download-artifact@v4
+        with:
+          name: mvn-repo
+          path: ~/.m2/repository/org/igniterealtime/openfire/
+      - name: Set environment variables
+        run: |
+          echo "CONNECTION_STRING=jdbc:mysql://localhost:3306/openfire?rewriteBatchedStatements=true&characterEncoding=UTF-8&characterSetResults=UTF-8&serverTimezone=UTC" >> $GITHUB_ENV
+          echo "CONNECTION_DRIVER=com.mysql.cj.jdbc.Driver" >> $GITHUB_ENV
+          echo "CONNECTION_USERNAME=root" >> $GITHUB_ENV
+          echo "CONNECTION_PASSWORD=SecurePa55w0rd" >> $GITHUB_ENV
+          OPENFIREVSN=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)
+          echo "OPENFIREVSN=$OPENFIREVSN" >> $GITHUB_ENV
+          echo "JAVA_HOME=$(echo $JAVA_HOME_17_X64)" >> $GITHUB_ENV
+      - name: Copy the Openfire database installation script
+        run: |
+          mkdir olddb
+          cp $GITHUB_WORKSPACE/distribution/src/database/openfire_mysql.sql > $GITHUB_WORKSPACE/olddb/openfire_mysql.sql
+      - name: Start database server and install database
+        run: docker compose -f ./build/ci/compose/mysql.yml up --detach
path: .github/workflows/continuous-integration-workflow.yml
user: login: gemini-code-assist[bot]
body: ![high](https://img.shields.io/badge/priority-high-orange)

Consider adding error handling to ensure the docker compose command was executed successfully.  Consider adding `|| exit 1` to the end of the command.

```
        run: docker compose -f ./build/ci/compose/mysql.yml up --detach || exit 1
```
created_at: 2025-03-13T10:52:27Z
author_association: NONE
diff_hunk: @@ -286,11 +286,47 @@ jobs:
               - '.github/workflows/continuous-integration-workflow.yml'
               - 'xmppserver/pom.xml'
 
-  sqlserver:
-    name: Test SQL Server Upgrades
-    needs: [build, should-do-database-upgrade-tests, check_branch]
+  sqlserver-install:
+    name: Test MS SQL Server install script
+    needs: [build, should-do-database-tests, check_branch]
     runs-on: ubuntu-latest
-    if: ${{ needs.should-do-database-upgrade-tests.outputs.check == 'true' || needs.check_branch.outputs.is_publishable_branch == 'true'}}
+    if: ${{ needs.should-do-database-tests.outputs.check == 'true' || needs.check_branch.outputs.is_publishable_branch == 'true'}}
+    steps:
+      - name: Checkout Openfire
+        uses: actions/checkout@v4
+      - name: Set up JDK 17 Zulu
+        uses: actions/setup-java@v4
+        with:
+          java-version: 17
+          distribution: zulu
+          cache: maven
+      - name: Restore mvn repo artifacts from build job
+        uses: actions/download-artifact@v4
+        with:
+          name: mvn-repo
+          path: ~/.m2/repository/org/igniterealtime/openfire/
+      - name: Set environment variables
+        run: |
+          echo "CONNECTION_STRING=jdbc:sqlserver://localhost:1433;databaseName=openfire;applicationName=Openfire" >> $GITHUB_ENV
+          echo "CONNECTION_DRIVER=com.microsoft.sqlserver.jdbc.SQLServerDriver" >> $GITHUB_ENV
+          echo "CONNECTION_USERNAME=sa" >> $GITHUB_ENV
+          echo "CONNECTION_PASSWORD=SecurePa55w0rd" >> $GITHUB_ENV
+          OPENFIREVSN=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)
+          echo "OPENFIREVSN=$OPENFIREVSN" >> $GITHUB_ENV
+          echo "JAVA_HOME=$(echo $JAVA_HOME_17_X64)" >> $GITHUB_ENV
+      - name: Copy the Openfire database installation script
+        run: |
+          mkdir olddb
+          cp $GITHUB_WORKSPACE/distribution/src/database/openfire_sqlserver.sql > $GITHUB_WORKSPACE/olddb/openfire_sqlserver.sql
+      - name: Start database server and install database
+        run: docker compose -f ./build/ci/compose/mssql.yml up --detach
path: .github/workflows/continuous-integration-workflow.yml
user: login: gemini-code-assist[bot]
body: ![medium](https://img.shields.io/badge/priority-medium-yellow)

These steps are duplicated in `postgres-install` and `mysql-install`. Consider creating a reusable action or template to avoid duplication and improve maintainability.
created_at: 2025-03-13T10:52:27Z
author_association: NONE
diff_hunk: @@ -411,7 +519,7 @@ jobs:
   publish-maven:
     name: Publish to Maven
     runs-on: ubuntu-latest
-    needs: [aioxmpp, connectivity, smack, check_branch, sqlserver, postgres, mysql]
+    needs: [aioxmpp, connectivity, smack, check_branch, sqlserver-install, sqlserver-upgrade, postgres-install, postgres-upgrade, mysql-install, mysql-upgrade]
path: .github/workflows/continuous-integration-workflow.yml
user: login: gemini-code-assist[bot]
body: ![medium](https://img.shields.io/badge/priority-medium-yellow)

The `needs` array has been updated to include the new jobs. This is good, but ensure that all dependencies are correctly specified and that the jobs are executed in the correct order.
created_at: 2025-03-13T10:52:27Z
author_association: NONE
diff_hunk: @@ -286,11 +286,47 @@ jobs:
               - '.github/workflows/continuous-integration-workflow.yml'
               - 'xmppserver/pom.xml'
 
-  sqlserver:
-    name: Test SQL Server Upgrades
-    needs: [build, should-do-database-upgrade-tests, check_branch]
+  sqlserver-install:
+    name: Test MS SQL Server install script
+    needs: [build, should-do-database-tests, check_branch]
     runs-on: ubuntu-latest
-    if: ${{ needs.should-do-database-upgrade-tests.outputs.check == 'true' || needs.check_branch.outputs.is_publishable_branch == 'true'}}
+    if: ${{ needs.should-do-database-tests.outputs.check == 'true' || needs.check_branch.outputs.is_publishable_branch == 'true'}}
+    steps:
+      - name: Checkout Openfire
+        uses: actions/checkout@v4
+      - name: Set up JDK 17 Zulu
+        uses: actions/setup-java@v4
+        with:
+          java-version: 17
+          distribution: zulu
+          cache: maven
+      - name: Restore mvn repo artifacts from build job
+        uses: actions/download-artifact@v4
+        with:
+          name: mvn-repo
+          path: ~/.m2/repository/org/igniterealtime/openfire/
+      - name: Set environment variables
+        run: |
+          echo "CONNECTION_STRING=jdbc:sqlserver://localhost:1433;databaseName=openfire;applicationName=Openfire" >> $GITHUB_ENV
+          echo "CONNECTION_DRIVER=com.microsoft.sqlserver.jdbc.SQLServerDriver" >> $GITHUB_ENV
+          echo "CONNECTION_USERNAME=sa" >> $GITHUB_ENV
+          echo "CONNECTION_PASSWORD=SecurePa55w0rd" >> $GITHUB_ENV
+          OPENFIREVSN=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)
+          echo "OPENFIREVSN=$OPENFIREVSN" >> $GITHUB_ENV
+          echo "JAVA_HOME=$(echo $JAVA_HOME_17_X64)" >> $GITHUB_ENV
+      - name: Copy the Openfire database installation script
+        run: |
+          mkdir olddb
+          cp $GITHUB_WORKSPACE/distribution/src/database/openfire_sqlserver.sql > $GITHUB_WORKSPACE/olddb/openfire_sqlserver.sql
path: .github/workflows/continuous-integration-workflow.yml
user: login: Fishbowler
body: It's a GitHub action. If mkdir has a non-zero exit code, won't it error out anyway?
created_at: 2025-03-13T20:36:03Z
author_association: MEMBER

PR comments:
user: login: guusdk
created_at: 2025-03-13T10:53:01Z
body: I'm not sure if my second assumptions (that the Docker build will fail when the install script isn't correct) actually holds true. This needs to be tested. If it doesn't, then it may be necessary to add an explicit verification step.
author_association: MEMBER
user: login: guusdk
created_at: 2025-03-13T12:03:44Z
body: The CI scripts have successfully executed, and were green. I have now added a commit to this PR that breaks the installation scripts. Obviously, this commit must not be merged. It is added to this PR to find out if the new CI scripts correctly detect the problem.

author_association: MEMBER
user: login: guusdk
created_at: 2025-03-13T12:09:19Z
body: Sadly, the broken SQL was not detected by any of the install-script checks.
author_association: MEMBER
user: login: guusdk
created_at: 2025-03-13T12:29:47Z
body: After adding an explicit check, the install scripts now fail as expected. Hopefully they'll go green again after the invalid SQL statements are removed again from the installation scripts.
author_association: MEMBER
user: login: guusdk
created_at: 2025-03-13T12:48:44Z
body: After removing the invalid SQL, the checks go green again, as intended.

Perhaps improvements can be applied, but as-is, things are working as expected.
author_association: MEMBER