Skip to content

[OSDEV-1515] Prevented unintended PostgreSQL major version upgrades.#500

Merged
vladsha-dev merged 3 commits intomainfrom
OSDEV-1515-disable-the-db-major-version-upgrade-and-immediate-apply-for-rds
Feb 12, 2025
Merged

[OSDEV-1515] Prevented unintended PostgreSQL major version upgrades.#500
vladsha-dev merged 3 commits intomainfrom
OSDEV-1515-disable-the-db-major-version-upgrade-and-immediate-apply-for-rds

Conversation

@vladsha-dev
Copy link
Contributor

@vladsha-dev vladsha-dev commented Feb 4, 2025

  • OSDEV-1515 - Removed rds_allow_major_version_upgrade and rds_apply_immediately from the environment tfvars files (e.g., terraform-production.tfvars) to set them to false again, as the default values in /deployment/terraform/variables.tf are false. This is necessary to prevent unintended PostgreSQL major version upgrades since the target PostgreSQL 16.3 version has been reached.
  • Update the name of the step in the post_deploy job of the "DB - Apply Anonymized DB" workflow to make it more informative.

@vladsha-dev vladsha-dev self-assigned this Feb 4, 2025
@vladsha-dev vladsha-dev temporarily deployed to Quality Environment February 4, 2025 10:58 — with GitHub Actions Inactive
@vladsha-dev vladsha-dev temporarily deployed to Quality Environment February 4, 2025 10:58 — with GitHub Actions Inactive
@vladsha-dev vladsha-dev temporarily deployed to Quality Environment February 4, 2025 10:58 — with GitHub Actions Inactive
@vladsha-dev vladsha-dev temporarily deployed to Quality Environment February 4, 2025 10:58 — with GitHub Actions Inactive
@vladsha-dev vladsha-dev temporarily deployed to Quality Environment February 4, 2025 10:58 — with GitHub Actions Inactive
@vladsha-dev vladsha-dev temporarily deployed to Quality Environment February 4, 2025 10:58 — with GitHub Actions Inactive
@vladsha-dev vladsha-dev temporarily deployed to Quality Environment February 4, 2025 10:58 — with GitHub Actions Inactive
@vladsha-dev vladsha-dev temporarily deployed to Quality Environment February 4, 2025 10:58 — with GitHub Actions Inactive
@vladsha-dev vladsha-dev temporarily deployed to Quality Environment February 4, 2025 10:58 — with GitHub Actions Inactive
@vladsha-dev vladsha-dev temporarily deployed to Quality Environment February 4, 2025 10:58 — with GitHub Actions Inactive
@vladsha-dev vladsha-dev temporarily deployed to Quality Environment February 4, 2025 10:58 — with GitHub Actions Inactive
@vladsha-dev vladsha-dev temporarily deployed to Quality Environment February 4, 2025 10:58 — with GitHub Actions Inactive
@vladsha-dev vladsha-dev temporarily deployed to Quality Environment February 4, 2025 10:58 — with GitHub Actions Inactive
@vladsha-dev vladsha-dev temporarily deployed to Quality Environment February 4, 2025 10:58 — with GitHub Actions Inactive
@vladsha-dev vladsha-dev marked this pull request as draft February 4, 2025 10:59
@coderabbitai
Copy link

coderabbitai bot commented Feb 4, 2025

📝 Walkthrough

Walkthrough

This pull request removes two RDS configuration parameters—rds_allow_major_version_upgrade and rds_apply_immediately—from the Terraform variable files used for development, production, staging, and test environments. Additionally, it introduces a new release section for version 2.0.0 in the release notes, detailing updates on database changes, code/API modifications, architecture/environment changes, bug fixes, and revised release instructions.

Changes

File(s) Change Summary
deployment/environments/terraform-{development,production,staging,test}.tfvars Removed RDS configuration parameters: rds_allow_major_version_upgrade and rds_apply_immediately.
doc/release/RELEASE-NOTES.md Added a new release section for version 2.0.0, including details on database changes, code/API updates, architecture/environment modifications, bug fixes, and release instructions.
.github/workflows/db_apply_anonimized.yml Updated step name in post_deploy job from "Run migrations for ${{ vars.ENV_NAME }}" to "Run migrations and other post-deployment tasks for ${{ vars.ENV_NAME }}".

Possibly related PRs

  • [OSDEV-1171] Decrease RDS instance type for staging and test #399 – The changes in the main PR, which involve the removal of RDS configuration parameters, are related to the retrieved PR that modifies the RDS instance type in the same files, indicating a focus on RDS management.
  • Updated RDS instance for prod, preprod and test #422 – The changes in the main PR, which involve the removal of RDS configuration parameters, are related to the retrieved PR that updates the RDS instance types, as both PRs focus on modifying RDS settings within Terraform configuration files.
  • Right-sized ECS and RDS resources #459 – The changes in the main PR, which involve the removal of RDS configuration parameters, are directly related to the modifications in the retrieved PR that also adjust RDS settings, specifically the instance type. Both PRs focus on managing RDS configurations.

Suggested reviewers

  • Innavin369
  • roman-stolar
  • VadimKovalenkoSNF
  • mazursasha1990
  • killev

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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. (Beta)
  • @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

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (7)
doc/release/RELEASE-NOTES.md (7)

12-14: Database Changes Placeholder:
A new “### Database changes” section is included with a placeholder message (Describe high-level database changes.).
It might be beneficial to update this section with actual migration or schema change details before finalizing the release notes.


15-17: Migrations Section Placeholder:
The “#### Migrations:” heading is present with a placeholder text (Describe migrations here.).
Consider replacing the placeholder with a brief summary of any database migrations applied or, if none are necessary, remove the section to avoid confusion for readers.

🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

15-15: Trailing punctuation in heading
Punctuation: ':'

(MD026, no-trailing-punctuation)


18-20: Schema Changes Section Placeholder:
Under “#### Schema changes”, the placeholder is again present.
If no schema changes occurred for this release, you might either note “No schema changes” or provide a brief description of any pertinent adjustments.


21-23: Code/API Changes Section Placeholder:
The “### Code/API changes” section is included with a generic placeholder text.
Make sure to detail any significant code or API updates (or confirm that none exist) before the release is published.


27-29: Bugfix Section Placeholder:
A “### Bugfix” section is included with placeholder text.
If there are any bugfixes pertinent to this release (or even confirmation that none are needed), updating this section will improve clarity.


30-32: What's New Section Placeholder:
The “### What's new” section is added but still contains placeholder text.
If there are user-impacting changes, consider listing them concisely; otherwise, indicate “No user-visible changes” as appropriate.


33-37: Release Instructions and Formatting Concerns:
The “### Release instructions:” section lists the required post-deployment commands.
While the inclusion of migrate and reindex_database is appropriate, note the following formatting suggestions based on static analysis:

  • Trailing Punctuation: The heading “Release instructions:” ends with a colon. Markdown style guidelines (MD026) recommend removing trailing punctuation in headings. Consider changing it to “### Release instructions”.

  • Indentation of Unordered Lists: The bullet points for the sub-items (lines 35 and 36) are indented by four spaces. Static analysis suggests an indentation level of 2 spaces for unordered lists.
    For example, you might adjust to:

    -    * `migrate`
    -    * `reindex_database`
    +  * `migrate`
    +  * `reindex_database`

Adjusting these formatting details will improve the document’s consistency and adherence to markdown style guidelines.

🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

33-33: Trailing punctuation in heading
Punctuation: ':'

(MD026, no-trailing-punctuation)


35-35: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


36-36: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5b7066d and eb36ecc.

📒 Files selected for processing (5)
  • deployment/environments/terraform-development.tfvars (0 hunks)
  • deployment/environments/terraform-production.tfvars (0 hunks)
  • deployment/environments/terraform-staging.tfvars (0 hunks)
  • deployment/environments/terraform-test.tfvars (0 hunks)
  • doc/release/RELEASE-NOTES.md (2 hunks)
💤 Files with no reviewable changes (4)
  • deployment/environments/terraform-staging.tfvars
  • deployment/environments/terraform-test.tfvars
  • deployment/environments/terraform-development.tfvars
  • deployment/environments/terraform-production.tfvars
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
doc/release/RELEASE-NOTES.md

15-15: Trailing punctuation in heading
Punctuation: ':'

(MD026, no-trailing-punctuation)


33-33: Trailing punctuation in heading
Punctuation: ':'

(MD026, no-trailing-punctuation)


35-35: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


36-36: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

⏰ Context from checks skipped due to timeout of 90000ms (13)
  • GitHub Check: run-flake8-linter
  • GitHub Check: run-integration-test-code-quality
  • GitHub Check: run-django-code-quality
  • GitHub Check: run-fe-code-quality
  • GitHub Check: run-eslint-linter-and-prettier-formatter
  • GitHub Check: run-dd-code-quality
  • GitHub Check: get-base-branch-fe-cov
  • GitHub Check: run-countries-code-quality
  • GitHub Check: run-contricleaner-code-quality
  • GitHub Check: get-base-branch-contricleaner-cov
  • GitHub Check: get-base-branch-countries-cov
  • GitHub Check: get-base-branch-dd-cov
  • GitHub Check: get-base-branch-django-cov
🔇 Additional comments (3)
doc/release/RELEASE-NOTES.md (3)

6-7: New Release Section Header:
The new release header for version 1.30.0 is clearly introduced. This section is well‐positioned and immediately signals to readers that a new release note has been added.


8-11: Introduction Section for 1.30.0:
The introduction correctly restates the product name (“Open Supply Hub”) and an updated release date. This provides clarity for the release timeline.


24-25: Architecture/Environment Changes – Critical Update:
This section clearly documents the primary change described in [OSDEV-1515].
It explains that the parameters rds_allow_major_version_upgrade and rds_apply_immediately were removed from the environment tfvars files to revert their values to false (in line with the default settings in /deployment/terraform/variables.tf), thereby preventing unintended PostgreSQL major version upgrades.
This is the key operational fix for preventing automatic upgrades as PostgreSQL 16.3 has been reached.

@vladsha-dev vladsha-dev temporarily deployed to Quality Environment February 4, 2025 11:00 — with GitHub Actions Inactive
@barecheck
Copy link

barecheck bot commented Feb 4, 2025

React App | Jest test suite - Code coverage report

Total: 28.88%

Your code coverage diff: 0.00% ▴

✅ All code changes are covered

@vladsha-dev vladsha-dev temporarily deployed to Quality Environment February 4, 2025 11:05 — with GitHub Actions Inactive
Copy link
Contributor

@roninzp roninzp left a comment

Choose a reason for hiding this comment

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

LGTM

@sonarqubecloud
Copy link

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
doc/release/RELEASE-NOTES.md (2)

68-72: Release instructions should include database reindexing.

The release instructions should include running the reindex_database command after migrations to ensure the database indexes are properly updated, especially given the significant changes to RDS configuration.

* Ensure that the following commands are included in the `post_deployment` command:
    * `migrate`
    * `reindex_database`
+   * `index_facilities_new`
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

68-68: Trailing punctuation in heading
Punctuation: ':'

(MD026, no-trailing-punctuation)


70-70: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


71-71: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


69-71: Fix list indentation for better readability.

The indentation of list items under the post-deployment commands is inconsistent. Standardize the indentation to 2 spaces for better markdown rendering.

* Ensure that the following commands are included in the `post_deployment` command:
-    * `migrate`
-    * `reindex_database`
+  * `migrate`
+  * `reindex_database`
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

70-70: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


71-71: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 86a45a6 and 08465b4.

📒 Files selected for processing (1)
  • doc/release/RELEASE-NOTES.md (3 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
doc/release/RELEASE-NOTES.md

70-70: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


71-71: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

⏰ Context from checks skipped due to timeout of 90000ms (13)
  • GitHub Check: run-integration-test-code-quality
  • GitHub Check: run-flake8-linter
  • GitHub Check: run-fe-code-quality
  • GitHub Check: run-eslint-linter-and-prettier-formatter
  • GitHub Check: run-django-code-quality
  • GitHub Check: run-dd-code-quality
  • GitHub Check: run-countries-code-quality
  • GitHub Check: run-contricleaner-code-quality
  • GitHub Check: get-base-branch-fe-cov
  • GitHub Check: get-base-branch-dd-cov
  • GitHub Check: get-base-branch-contricleaner-cov
  • GitHub Check: get-base-branch-countries-cov
  • GitHub Check: get-base-branch-django-cov
🔇 Additional comments (2)
doc/release/RELEASE-NOTES.md (2)

32-33: Well-documented architectural changes.

The changes to RDS parameters are clearly explained, including the rationale for removing rds_allow_major_version_upgrade and rds_apply_immediately. The documentation also effectively communicates the split of the Django container into frontend and backend components.


21-30: Comprehensive API documentation.

The geo-bounding box query support is well-documented with clear validation rules and parameter constraints. This will help users understand how to properly use the new functionality.

🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

25-25: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


26-26: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


27-27: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


28-28: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


29-29: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


30-30: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

Copy link
Contributor

@VadimKovalenkoSNF VadimKovalenkoSNF left a comment

Choose a reason for hiding this comment

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

Approved.

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