Skip to content

feat: Enhance Dockerfile and specs.yaml with additional packages and …#17

Merged
jhassine merged 2 commits intolatestfrom
dbdeps
Feb 20, 2026
Merged

feat: Enhance Dockerfile and specs.yaml with additional packages and …#17
jhassine merged 2 commits intolatestfrom
dbdeps

Conversation

@jhassine
Copy link
Contributor

…tests

added odbc and mysql dev deps

@jhassine jhassine requested a review from phuongfi91 February 20, 2026 11:42
Copilot AI review requested due to automatic review settings February 20, 2026 11:42
@qodo-code-review
Copy link

Review Summary by Qodo

Add database support and expand test coverage

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Add locale configuration and ODBC/MySQL database support
• Simplify APT preferences by removing stable pin priority
• Add database clients and development packages (PostgreSQL, MariaDB, ODBC, FreeTDS)
• Expand test coverage with new command tests for database and utility tools
Diagram
flowchart LR
  A["Dockerfile"] -->|"Add locales config"| B["UTF-8 Environment"]
  A -->|"Add DB packages"| C["PostgreSQL, MariaDB, ODBC, FreeTDS"]
  A -->|"Simplify APT"| D["Deprioritize testing repo"]
  E["specs.yaml"] -->|"Add DB tests"| F["PostgreSQL, ODBC, FreeTDS"]
  E -->|"Add tool tests"| G["Node.js, wget, curl, jq, java"]
Loading

Grey Divider

File Changes

1. Dockerfile ✨ Enhancement +20/-9

Add database support and locale configuration

• Configure UTF-8 locales with LC_ALL environment variable and locale generation
• Simplify APT preferences to deprioritize testing repo instead of pinning stable
• Remove testing repo file instead of commenting it out
• Add database development packages: libmariadb-dev, unixodbc-dev, freetds-dev, tdsodbc
• Add utility packages: pkg-config, wget
• Remove apt-get upgrade command from build process

Dockerfile


2. tests/specs.yaml 🧪 Tests +41/-0

Add comprehensive database and tool tests

• Add test for PostgreSQL client availability via psql --version
• Add test for Node.js installation with version check for v20+
• Add ODBC support verification using odbcinst -j
• Add FreeTDS driver verification using odbcinst with FreeTDS query
• Add tests for wget, curl, jq, and java command availability

tests/specs.yaml


Grey Divider

Qodo Logo

@gemini-code-assist
Copy link

Summary of Changes

Hello @jhassine, 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!

This pull request significantly enhances the development environment within the Docker image by integrating essential tools and libraries for improved database connectivity (MySQL, ODBC), general build processes, and common utility commands. It also introduces robust testing to ensure these new additions are correctly installed and functional, thereby improving the reliability and completeness of the environment.

Highlights

  • Dockerfile Enhancements: Configured locales and updated the APT pinning strategy in the Dockerfile to deprioritize the 'testing' repository, ensuring more stable package installations.
  • New Development Dependencies: Installed several new development dependencies in the Dockerfile, including pkg-config, wget, libmariadb-dev for MySQL, and unixodbc-dev, freetds-dev, tdsodbc for robust ODBC support.
  • Expanded Test Coverage: Added comprehensive command tests in specs.yaml to verify the presence and functionality of newly added tools (like ODBC, FreeTDS, wget) and existing ones (PostgreSQL, Node.js, curl, jq, Java).

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • Dockerfile
    • Configured LC_ALL environment variable and installed the locales package to improve internationalization support.
    • Modified APT pinning logic to explicitly deprioritize the 'testing' repository, preventing accidental installations from it.
    • Removed an unnecessary apt-get upgrade step from a RUN command to streamline the build process.
    • Installed new development dependencies including pkg-config, wget, libmariadb-dev (for MySQL client development), and unixodbc-dev, freetds-dev, tdsodbc (for ODBC support).
    • Changed the method for disabling the 'testing' repository from sed to rm -f for cleaner removal.
  • tests/specs.yaml
    • Added new command tests to verify the installation and functionality of the PostgreSQL client (psql).
    • Included a test to confirm Node.js (node) is correctly installed and accessible.
    • Introduced tests for ODBC support using odbcinst, checking for general ODBC availability and specific FreeTDS driver presence.
    • Added tests to ensure wget, curl, jq, and java are installed and their commands are executable.
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 by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

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 pull request 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 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. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

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.

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

The pull request successfully enhances the Dockerfile with locale support, additional database development dependencies (MariaDB/MySQL and ODBC), and common build tools. It also adds comprehensive tests for these new components. I have identified a few opportunities for improvement regarding build performance consistency, package compatibility, and test deduplication.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR enhances the base Docker image by adding locale configuration and additional tooling/development dependencies (ODBC, MariaDB/MySQL dev libs, extra CLI tools), and extends the container structure tests to validate the new capabilities.

Changes:

  • Configure en_US.UTF-8 locales and set LC_ALL in the Docker image.
  • Add additional apt packages (e.g., pkg-config, wget, PostgreSQL client, MariaDB dev libs, unixODBC/FreeTDS).
  • Expand tests/specs.yaml command tests to assert availability of the newly added tools/features.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
Dockerfile Adds locale setup and installs additional build tools, DB/ODBC dependencies, and CLI utilities.
tests/specs.yaml Adds command-based assertions for PostgreSQL, Node.js, ODBC/FreeTDS, wget/curl/jq, and Java.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- name: "nodejs is installed in path"
command: "node"
args: ["--version"]
expectedOutput: ["v2"] # Node 20+ outputs "v2x.x.x"
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

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

The Node.js version assertion expectedOutput: ["v2"] effectively requires Node 20+ (v20/v22/...). The Dockerfile installs nodejs without pinning a major version, so this test may fail if the base image repo provides Node 18 (v18...). Either relax the assertion (e.g., just check that node --version prints a v) or explicitly pin/install Node 20+ in the Dockerfile to match this test.

Suggested change
expectedOutput: ["v2"] # Node 20+ outputs "v2x.x.x"
expectedOutput: ["v"] # Node outputs "vX.Y.Z"; just confirm a version string is printed

Copilot uses AI. Check for mistakes.
Dockerfile Outdated
libmariadb-dev \
# For ODBC support:
unixodbc-dev \
freetds-dev tdsodbc \
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

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

Package list formatting: freetds-dev tdsodbc puts two packages on one line while the rest are one-per-line. Splitting them improves readability and reduces diff churn when adding/removing packages later.

Suggested change
freetds-dev tdsodbc \
freetds-dev \
tdsodbc \

Copilot uses AI. Check for mistakes.
@qodo-code-review
Copy link

qodo-code-review bot commented Feb 20, 2026

Code Review by Qodo

🐞 Bugs (3) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider


Action required

1. Node version not guaranteed 🐞 Bug ✓ Correctness
Description
The structure test requires Node’s version string to start with "v2" (Node 20+), but the Dockerfile
installs the distro "nodejs" package without pinning/enforcing a 20+ major. This can break CI if the
base repo provides Node 18/19 while still correctly installing Node.
Code

tests/specs.yaml[R118-121]

+  - name: "nodejs is installed in path"
+    command: "node"
+    args: ["--version"]
+    expectedOutput: ["v2"] # Node 20+ outputs "v2x.x.x"
Evidence
The Docker image installs nodejs with no version constraint (and not from -t testing), while the
new test asserts a Node 20+ prefix (v2). Nothing in the Dockerfile ensures that constraint, so the
test can fail depending on what version the distro repo serves for the chosen base image.

Dockerfile[78-86]
tests/specs.yaml[118-121]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`tests/specs.yaml` asserts `node --version` starts with `v2` (Node 20+), but the Dockerfile installs `nodejs` without any version constraint. This makes the test brittle across base-image/repo changes.
### Issue Context
The image installs `nodejs` from the default apt repos in the main install layer. The test comment explicitly encodes a Node 20+ assumption.
### Fix Focus Areas
- tests/specs.yaml[118-121]
- Dockerfile[78-86]
### Suggested fixes
Choose one:
1) **Enforce Node 20+** in the Docker build (e.g., install `nodejs` from the same temporary `testing` enablement step with `-t testing`, or pin the package version explicitly).
2) **Relax the structure test** to something like `expectedOutput: [&amp;amp;quot;v&amp;amp;quot;]` or a regex matching any semver (depending on container-structure-test semantics), so the test validates presence rather than a specific major.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. FreeTDS test is brittle 🐞 Bug ⛯ Reliability
Description
The new test assumes an ODBC driver entry exists with the exact name "FreeTDS", but the Dockerfile
doesn’t explicitly register/configure that driver name anywhere. This can cause CI failures if the
package registers a different name or doesn’t populate /etc/odbcinst.ini in this environment.
Code

tests/specs.yaml[R128-131]

+  - name: "freetds support is available"
+    command: "odbcinst"
+    args: ["-q", "-d", "-n", "FreeTDS"]
+    expectedOutput: ["FreeTDS"]
Evidence
The Dockerfile installs freetds-dev and tdsodbc but contains no explicit
configuration/registration step for an ODBC driver named FreeTDS. The structure test uses a strict
lookup by name (-n FreeTDS), which will fail if the name differs or the entry is absent.

Dockerfile[96-101]
tests/specs.yaml[128-131]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The structure test hard-codes an ODBC driver lookup by name (`FreeTDS`). The Dockerfile installs packages but does not explicitly ensure an `odbcinst` driver entry with that exact name exists.
### Issue Context
Package post-install scripts may or may not register the driver under the expected name; relying on this implicitly makes CI flaky across distro/package variations.
### Fix Focus Areas
- tests/specs.yaml[128-131]
- Dockerfile[96-101]
### Suggested fixes
Pick one:
1) **Explicitly register/configure** the FreeTDS driver during build (e.g., write a deterministic `/etc/odbcinst.ini` entry or invoke `odbcinst` install commands).
2) **Relax the test** to verify FreeTDS support in a less name-coupled way, e.g. `odbcinst -q -d` and assert the output contains `FreeTDS` (or check the presence of the `tdsodbc` shared object) rather than `-n FreeTDS`.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

✅ 3. Locale apt step uncached 🐞 Bug ➹ Performance
Description
Locale generation adds an apt-get update && apt-get install step without the cache mounts used
elsewhere, forcing redundant downloads and slowing builds. This is a build-time performance
regression, especially in CI.
Code

Dockerfile[R47-53]

+# Install and configure locales
+RUN apt-get update \
+    && apt-get install -y --no-install-recommends locales \
+    && sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen \
+    && locale-gen en_US.UTF-8 \
+    && update-locale LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 \
+    && rm -rf /var/lib/apt/lists/*
Evidence
The new locales installation runs plain apt-get update without cache mounts, while later apt
operations use BuildKit cache mounts for /var/cache/apt and /var/lib/apt. This defeats the
Dockerfile’s existing caching strategy for that step.

Dockerfile[47-53]
Dockerfile[67-82]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The locales installation RUN step does not use the apt cache mounts used elsewhere, reducing build performance.
### Issue Context
The Dockerfile already uses `--mount=type=cache` for apt operations in subsequent layers.
### Fix Focus Areas
- Dockerfile[47-53]
- Dockerfile[67-82]
### Suggested fixes
- Add `--mount=type=cache,target=/var/cache/apt,sharing=locked` and `--mount=type=cache,target=/var/lib/apt,sharing=locked` to the locales RUN.
- Alternatively, install `locales` in the main cached apt-get install block and keep only locale generation/config in a follow-up step.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

Comment on lines +118 to +121
- name: "nodejs is installed in path"
command: "node"
args: ["--version"]
expectedOutput: ["v2"] # Node 20+ outputs "v2x.x.x"

Choose a reason for hiding this comment

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

Action required

1. Node version not guaranteed 🐞 Bug ✓ Correctness

The structure test requires Node’s version string to start with "v2" (Node 20+), but the Dockerfile
installs the distro "nodejs" package without pinning/enforcing a 20+ major. This can break CI if the
base repo provides Node 18/19 while still correctly installing Node.
Agent Prompt
### Issue description
`tests/specs.yaml` asserts `node --version` starts with `v2` (Node 20+), but the Dockerfile installs `nodejs` without any version constraint. This makes the test brittle across base-image/repo changes.

### Issue Context
The image installs `nodejs` from the default apt repos in the main install layer. The test comment explicitly encodes a Node 20+ assumption.

### Fix Focus Areas
- tests/specs.yaml[118-121]
- Dockerfile[78-86]

### Suggested fixes
Choose one:
1) **Enforce Node 20+** in the Docker build (e.g., install `nodejs` from the same temporary `testing` enablement step with `-t testing`, or pin the package version explicitly).
2) **Relax the structure test** to something like `expectedOutput: ["v"]` or a regex matching any semver (depending on container-structure-test semantics), so the test validates presence rather than a specific major.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +128 to +131
- name: "freetds support is available"
command: "odbcinst"
args: ["-q", "-d", "-n", "FreeTDS"]
expectedOutput: ["FreeTDS"]

Choose a reason for hiding this comment

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

Action required

2. Freetds test is brittle 🐞 Bug ⛯ Reliability

The new test assumes an ODBC driver entry exists with the exact name "FreeTDS", but the Dockerfile
doesn’t explicitly register/configure that driver name anywhere. This can cause CI failures if the
package registers a different name or doesn’t populate /etc/odbcinst.ini in this environment.
Agent Prompt
### Issue description
The structure test hard-codes an ODBC driver lookup by name (`FreeTDS`). The Dockerfile installs packages but does not explicitly ensure an `odbcinst` driver entry with that exact name exists.

### Issue Context
Package post-install scripts may or may not register the driver under the expected name; relying on this implicitly makes CI flaky across distro/package variations.

### Fix Focus Areas
- tests/specs.yaml[128-131]
- Dockerfile[96-101]

### Suggested fixes
Pick one:
1) **Explicitly register/configure** the FreeTDS driver during build (e.g., write a deterministic `/etc/odbcinst.ini` entry or invoke `odbcinst` install commands).
2) **Relax the test** to verify FreeTDS support in a less name-coupled way, e.g. `odbcinst -q -d` and assert the output contains `FreeTDS` (or check the presence of the `tdsodbc` shared object) rather than `-n FreeTDS`.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Copy link
Contributor

@phuongfi91 phuongfi91 left a comment

Choose a reason for hiding this comment

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

One small comment otherwise looking good 😎 👍🏿

@jhassine jhassine merged commit 3cb614c into latest Feb 20, 2026
6 checks passed
@jhassine jhassine deleted the dbdeps branch February 20, 2026 12:45
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.

3 participants