Skip to content

Conversation

@bjohansebas
Copy link
Contributor

@bjohansebas bjohansebas commented May 3, 2025

Postgres is being updated to the latest version. I believe this isn't in production yet, so there's nothing to do for now, besides that.

Summary by CodeRabbit

  • Chores
    • Updated PostgreSQL image version to 17.4 in Docker Compose and CI workflows for improved stability and security.
    • Enhanced database integrity by adding cascading updates and deletes to key foreign key constraints.

Signed-off-by: Sebastian Beltran <[email protected]>
@coderabbitai
Copy link

coderabbitai bot commented May 3, 2025

## Walkthrough

The Docker Compose configuration and GitHub Actions workflows were updated to use PostgreSQL image version 17.4 instead of 17.2. Additionally, the database schema dump was modified to add cascading update and delete behavior to two foreign key constraints in the `resources_for_compliance_checks` table.

## Changes

| File(s)                                       | Change Summary                                                                                             |
|-----------------------------------------------|-----------------------------------------------------------------------------------------------------------|
| docker-compose.yml                            | Updated PostgreSQL image version from 17.2 to 17.4 for `db` and `schema-dump` services.                    |
| .github/workflows/ci.yml, .github/workflows/e2e-tests.yml | Updated PostgreSQL image version from 17.2 to 17.4 in CI and end-to-end test workflows.                     |
| src/database/schema/schema.sql                | Modified two foreign key constraints on `resources_for_compliance_checks` to add `ON UPDATE CASCADE ON DELETE CASCADE`. |

## Poem

> 🐇  
> A hop and a skip, to version seventeen-four,  
> Our Compose file’s fresher than ever before!  
> The database hums with a patch so new,  
> Cascading keys now keep data true.  
> With every small upgrade, our stack’s in its prime—  
> Hooray for the future, one hop at a time!  
>

Note

⚡️ AI Code Reviews for VS Code, Cursor, Windsurf

CodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback.
Learn more here.


Note

⚡️ Faster reviews with caching

CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.
Enjoy the performance boost—your workflow just got faster.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 1313abe and 02b77e5.

📒 Files selected for processing (3)
  • .github/workflows/ci.yml (1 hunks)
  • .github/workflows/e2e-tests.yml (1 hunks)
  • src/database/schema/schema.sql (2 hunks)
✅ Files skipped from review due to trivial changes (2)
  • .github/workflows/ci.yml
  • .github/workflows/e2e-tests.yml
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Playwright Tests
🔇 Additional comments (3)
src/database/schema/schema.sql (3)

5-6: Update schema dump metadata to PostgreSQL 17.4
The dump metadata has been updated to reflect PostgreSQL 17.4, aligning with the Docker Compose and CI workflow version bumps.


1304-1305: Add ON UPDATE/DELETE CASCADE to compliance_check_id FK
Introducing ON UPDATE CASCADE ON DELETE CASCADE ensures that changes or removals of a compliance check propagate correctly to resources_for_compliance_checks. Please confirm that your migration files and application logic expect this behavior.


1312-1313: Add ON UPDATE/DELETE CASCADE to compliance_check_resource_id FK
Applying the same cascading actions to the resource ID foreign key maintains referential integrity when compliance check resources change. Verify that downstream code handles automatic deletions/updates appropriately.


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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Member

@UlisesGascon UlisesGascon left a comment

Choose a reason for hiding this comment

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

We will need to update also the pipelines:

image: postgres:17.2

image: postgres:17.2

And probably run npm run db:generate-schema to refresh the version references (context)

@UlisesGascon UlisesGascon added this to the v1.0.0 milestone May 4, 2025
@UlisesGascon UlisesGascon moved this to In progress in v1.0.0 Backlog May 4, 2025
@UlisesGascon UlisesGascon moved this from In progress to In review in v1.0.0 Backlog May 4, 2025
Signed-off-by: Sebastian Beltran <[email protected]>

ALTER TABLE ONLY public.resources_for_compliance_checks
ADD CONSTRAINT resources_for_compliance_checks_compliance_check_id_foreign FOREIGN KEY (compliance_check_id) REFERENCES public.compliance_checks(id);
ADD CONSTRAINT resources_for_compliance_checks_compliance_check_id_foreign FOREIGN KEY (compliance_check_id) REFERENCES public.compliance_checks(id) ON UPDATE CASCADE ON DELETE CASCADE;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I haven't altered the tables manually, and the database is a new instance since I recently formatted my computer. I assume it's due to the new version. I've also done a rollback and re-applied the migrations to be sure.

Copy link
Member

Choose a reason for hiding this comment

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

I believe that this update actually was missing from previous PRs, so makes sense to include it 👍

@bjohansebas bjohansebas requested a review from UlisesGascon May 17, 2025 18:29
Copy link
Member

@UlisesGascon UlisesGascon left a comment

Choose a reason for hiding this comment

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

LGTM!


ALTER TABLE ONLY public.resources_for_compliance_checks
ADD CONSTRAINT resources_for_compliance_checks_compliance_check_id_foreign FOREIGN KEY (compliance_check_id) REFERENCES public.compliance_checks(id);
ADD CONSTRAINT resources_for_compliance_checks_compliance_check_id_foreign FOREIGN KEY (compliance_check_id) REFERENCES public.compliance_checks(id) ON UPDATE CASCADE ON DELETE CASCADE;
Copy link
Member

Choose a reason for hiding this comment

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

I believe that this update actually was missing from previous PRs, so makes sense to include it 👍

@UlisesGascon UlisesGascon merged commit 8068255 into OpenPathfinder:main May 18, 2025
7 checks passed
@github-project-automation github-project-automation bot moved this from In review to Done in v1.0.0 Backlog May 18, 2025
UlisesGascon added a commit to OpenPathfinder/openpathfinder.com that referenced this pull request May 18, 2025
UlisesGascon added a commit to OpenPathfinder/openpathfinder.com that referenced this pull request May 18, 2025
@bjohansebas bjohansebas deleted the upgrade-postgres branch May 18, 2025 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants