Skip to content

Conversation

guusdk
Copy link
Member

@guusdk guusdk commented Mar 12, 2025

Based on a Docker image that's documented in https://www.ibm.com/docs/en/db2/12.1?topic=system-linux

This is unlikely to be functional, as I don't think it is properly loading the 'old' database scripts. Creating a PR in the hope that someone smarter than me can fix this.

I suspect that this won't even run, as Openfire might not ship with a DB2 JDBC driver (see https://www.ibm.com/docs/en/db2-big-sql/6.0?topic=drivers-jdbc-driver )

@guusdk guusdk requested a review from Fishbowler March 12, 2025 21:05
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @guusdk, I'm Gemini Code Assist1! 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 introduces DB2 support to the database update test in the continuous integration workflow. It adds a new job to the CI workflow that uses a Docker image to run DB2. The job sets up environment variables for the DB2 connection, downloads an old Openfire database script, starts the DB2 server, and runs the update tester. The PR also modifies the 'publish-maven' and 'build-and-push-docker' jobs to include the new DB2 job as a dependency. The author suspects that the PR might not be fully functional due to potential issues with loading the old database scripts and the absence of a DB2 JDBC driver in Openfire.

Highlights

  • DB2 Integration: Adds a new DB2 job to the CI workflow to test database upgrades.
  • Docker Compose: Introduces a new Docker Compose file (db2.yml) to manage the DB2 database server.
  • Workflow Modification: Modifies existing CI jobs ('publish-maven', 'build-and-push-docker') to depend on the new DB2 job.

Changelog

  • .github/workflows/continuous-integration-workflow.yml
    • Added a new 'db2' job to test DB2 upgrades (lines 330-369).
    • Modified 'publish-maven' job to include 'db2' in the 'needs' array (line 455).
    • Modified 'build-and-push-docker' job to include 'db2' in the 'needs' array (line 482).
  • build/ci/compose/db2.yml
    • Created a new Docker Compose file to define the DB2 database service (lines 1-25).
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

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.

Customization

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.

Limitations & Feedback

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 👍 and 👎 on @gemini-code-assist comments to provide feedback.

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.


Trivia time!

What company initially developed DB2?

Click here for the answer
IBM initially developed DB2.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces DB2 support to the database update test, which is a valuable addition to the continuous integration workflow. The author has acknowledged that the implementation might not be fully functional and seeks assistance in resolving potential issues. The changes include adding a new DB2 job to the CI workflow, configuring environment variables, downloading the old database script, starting the database server, and building and running the update tester. Overall, this is a good start, but there are some areas that need improvement.

Summary of Findings

  • Database Driver Availability: The pull request description mentions that Openfire might not ship with a DB2 JDBC driver. This needs to be verified and addressed to ensure the DB2 integration works correctly. If the driver is not included, it should be added as a dependency or a mechanism to download it during the CI process should be implemented. I did not comment on this since it was mentioned in the pull request description, but it's important to address.
  • Hardcoded Credentials: The database credentials (username and password) are hardcoded in the workflow file. This is a security risk and should be addressed by using secrets or environment variables to store sensitive information. I have added a review comment for this.
  • Database Initialization: The pull request description mentions that the 'old' database scripts might not be loading properly. This needs to be investigated to ensure the database is correctly initialized before running the update tester. I did not comment on this since it was mentioned in the pull request description, but it's important to address.

Merge Readiness

The pull request is not ready to be merged due to the hardcoded credentials, which pose a security risk. Additionally, the database initialization issue needs to be resolved to ensure the DB2 integration works correctly. I am unable to directly approve this pull request, and recommend that it not be merged until the mentioned issues are addressed. It is also recommended that others review and approve this code before merging.

@guusdk guusdk force-pushed the CI_db2-updater branch 5 times, most recently from e0b56da to fc87a50 Compare March 14, 2025 11:46
@guusdk guusdk force-pushed the CI_db2-updater branch 2 times, most recently from 6b93eb0 to b3c77a6 Compare March 23, 2025 15:29
@guusdk
Copy link
Member Author

guusdk commented Mar 24, 2025

I suspect that at least two problems still exist:

  • The DB2 docker image takes many minutes to become available, yet this test fails in approximately 90 seconds. This may suggest that the docker health check isn't working as intended
  • I suspect that the provisioning of the DB2 database (with the isready table and/or the older Openfire database structure) isn't happening.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants