Skip to content

Conversation

oindrila-b
Copy link
Contributor

@oindrila-b oindrila-b commented Oct 17, 2025

Description

docker-compose's xyne-db container doesn't work with it's current config, so modified the config to match that os the docker-compose in portable files (which work).

Testing

Tested locally

Additional Notes

NA

Summary by CodeRabbit

  • Chores
    • Updated database service to PostgreSQL 15 Alpine image across all deployment environments
    • Added automatic health monitoring to verify database availability
    • Implemented structured logging configuration for better operational visibility
    • Configured database initialization parameters for consistency
    • Modified container restart behavior for improved stability

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @oindrila-b, 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 resolves an issue where the xyne-db PostgreSQL container failed to operate correctly within various docker-compose environments. The changes standardize the database image, refine its initialization parameters, and implement robust health monitoring and logging. These updates aim to enhance the reliability and stability of the PostgreSQL service across development, metrics, production, and self-hosted deployments, ensuring the database starts and functions as expected.

Highlights

  • PostgreSQL Image Update: The PostgreSQL image for the xyne-db service has been updated from a generic postgres tag to postgres:15-alpine across all docker-compose files, ensuring a specific and lightweight base image.
  • Database Initialization Arguments: New POSTGRES_INITDB_ARGS have been added to the xyne-db service configuration, specifying --encoding=UTF-8 --lc-collate=C --lc-ctype=C for consistent database initialization.
  • Restart Policy Adjustment: The restart policy for the xyne-db service has been changed from always to unless-stopped, providing more controlled container restarts.
  • Enhanced Health Checks: A comprehensive healthcheck configuration has been introduced for the xyne-db service, using pg_isready -U xyne -d xyne to verify database readiness, with specified intervals, timeouts, retries, and a start period.
  • Logging Configuration: Logging options have been added to the xyne-db service, setting the driver to json-file with a max-size of '50m' and max-file of '6'.
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.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 17, 2025

Walkthrough

Docker Compose configurations updated across five environments to standardize PostgreSQL 15 Alpine images, add initialization arguments for encoding and locales, implement health checks, configure logging, and change restart policies from always to unless-stopped.

Changes

Cohort / File(s) Summary
Docker Compose Configuration Updates
deployment/docker-compose.dev.yml, deployment/docker-compose.metrics.yml, deployment/docker-compose.prod.yml, deployment/docker-compose.selfhost.yml, deployment/docker-compose.yml
Updated xyne-db service across all environments: image changed to postgres:15-alpine, POSTGRES_INITDB_ARGS added with encoding/locale settings, restart policy changed from always to unless-stopped, healthcheck added with pg_isready validation, and JSON file logging configured. Minor variations in healthcheck intervals (5s/10s) and logging max-file values (4/6/50m).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

The changes follow a consistent repetitive pattern across all files with minimal variation. Updates are configuration-only with no code logic modifications. Review involves verifying consistency of PostgreSQL image versions, initialization arguments, and health check parameters across environments.

Suggested reviewers

  • zereraz
  • devesh-juspay
  • junaid-shirur
  • kalpadhwaryu

Poem

🐇 Five Compose files hopped in line,
PostgreSQL 15 Alpine, so fine!
Health checks and logs now take their place,
Better restarts—a stable base!
Hop hop! The configs all align!

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "fix: XYNE-213 Modified docker-compose files to fix PG not working" is directly related to the changeset. The PR modifies five docker-compose files (dev, metrics, prod, selfhost, and main) to update the PostgreSQL configuration with a specific image version, environment variables, healthchecks, and logging—all aimed at resolving the issue where the xyne-db container was not working. The title accurately captures the main objective without requiring detailed technical enumeration, which aligns with the expectation that titles don't need to cover every implementation detail.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/deployment-pg

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1669437 and a1a2dc8.

📒 Files selected for processing (5)
  • deployment/docker-compose.dev.yml (1 hunks)
  • deployment/docker-compose.metrics.yml (1 hunks)
  • deployment/docker-compose.prod.yml (1 hunks)
  • deployment/docker-compose.selfhost.yml (1 hunks)
  • deployment/docker-compose.yml (1 hunks)
🔇 Additional comments (5)
deployment/docker-compose.dev.yml (1)

90-114: Standardization of xyne-db service looks good; verify restart policy across environments.

The updates to use postgres:15-alpine with explicit initialization arguments, healthcheck, and logging are solid improvements that align with the PR objective. However, verify that the restart policy change from always to unless-stopped is intentional across all environments, particularly for production (see deployment/docker-compose.prod.yml line 123).

Confirm that unless-stopped is the correct restart policy for all deployment contexts, or if production should use restart: always to ensure auto-recovery on system reboots.

deployment/docker-compose.metrics.yml (1)

80-104: Consistent with dev environment.

The xyne-db service changes mirror those in deployment/docker-compose.dev.yml. The configuration is sound for the metrics environment.

deployment/docker-compose.selfhost.yml (1)

108-132: Consistent with other environments.

The xyne-db service changes are aligned with the dev and metrics configurations.

deployment/docker-compose.yml (1)

112-136: Consistent with other environments.

The xyne-db service changes align with the pattern across all docker-compose variants.

deployment/docker-compose.prod.yml (1)

109-134: Restart policy inconsistency in production warrants verification.

The xyne-db service is updated to restart: unless-stopped (line 123), while other critical services in the same production environment—such as prometheus (line 34) and vespa (line 100)—use restart: always. This policy difference means xyne-db won't automatically restart following a system reboot unless explicitly managed by external orchestration.

Confirm whether the unless-stopped policy is intentional (e.g., managed by a container orchestration platform) or if it should be always to match the resilience model of other critical services in production.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@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 addresses an issue with the PostgreSQL container configuration by applying a series of improvements across all relevant docker-compose files. The changes, including pinning the image version, adding initialization arguments, implementing health checks, and configuring log rotation, are excellent practices that enhance the robustness and reliability of the database service. My main feedback is a medium-severity suggestion regarding the code duplication of the xyne-db service definition across multiple files. Centralizing this configuration would improve long-term maintainability. Overall, this is a good fix.

@shivamashtikar shivamashtikar merged commit 82450af into main Oct 17, 2025
4 checks passed
@shivamashtikar shivamashtikar deleted the fix/deployment-pg branch October 17, 2025 09:31
Sithaarth24 pushed a commit that referenced this pull request Oct 17, 2025
## [3.18.7](v3.18.6...v3.18.7) (2025-10-17)

### Bug Fixes

* XYNE-213 Modified docker-compose files to fix PG not working ([#1123](#1123)) ([82450af](82450af))
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.

5 participants