Skip to content

feat: auto-downgrading revision #4678

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 119 commits into
base: main
Choose a base branch
from

Conversation

korolenkowork
Copy link
Contributor

@korolenkowork korolenkowork commented May 1, 2025

Closes #4665

πŸ“‘ Description

This PR introduces automatic database downgrading support when rolling back KeepHQ to a previous version.

βœ… Checks

  • Main logic completed
  • I have updated the documentation as required
  • New logic covered by test
  • E2E is written
  • All the tests have passed

β„Ή Additional Information

  • From this commit onward, all migration files will be copied to the SECRET_MANAGER_DIRECTORY to enable safe database downgrades during rollback scenarios.
  • A new environment variable ALLOW_DB_DOWNGRADE has been added to explicitly allow or prevent database downgrades, reducing the risk of accidental downgrades.

Copy link

vercel bot commented May 1, 2025

@EnotShow is attempting to deploy a commit to the KeepHQ Team on Vercel.

A member of the Team first needs to authorize it.

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. Feature A new feature labels May 1, 2025
@korolenkowork korolenkowork marked this pull request as draft May 1, 2025 21:23
@shahargl
Copy link
Member

shahargl commented May 2, 2025

hey @EnotShow - thanks for this PR!

as this PR introduces some major changes to how Keep works, I thought I would add some e2e tests for it (mainly install Keep, do some migration, then downgrade). wdyt?

Copy link
Member

@shahargl shahargl left a comment

Choose a reason for hiding this comment

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

see comments

Copy link

codecov bot commented May 3, 2025

Codecov Report

Attention: Patch coverage is 8.45070% with 65 lines in your changes missing coverage. Please review.

Project coverage is 46.03%. Comparing base (1ae49bf) to head (f1328ef).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
keep/api/core/db_on_start.py 8.45% 65 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4678      +/-   ##
==========================================
- Coverage   46.19%   46.03%   -0.16%     
==========================================
  Files         165      165              
  Lines       17495    17564      +69     
==========================================
+ Hits         8081     8086       +5     
- Misses       9414     9478      +64     

β˜” View full report in Codecov by Sentry.
πŸ“’ Have feedback on the report? Share it here.

πŸš€ New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • πŸ“¦ JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@shahargl shahargl left a comment

Choose a reason for hiding this comment

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

see comments

Copy link

vercel bot commented May 19, 2025

Deployment failed with the following error:

The provided GitHub repository does not contain the requested branch or commit reference. Please ensure the repository is not empty.

@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. and removed size:XL This PR changes 500-999 lines, ignoring generated files. labels May 19, 2025
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels May 19, 2025
@korolenkowork
Copy link
Contributor Author

Hey @shahargl! Thx for your review! I made all the required changes, so it's ready for re-review :)

@korolenkowork korolenkowork requested a review from shahargl May 19, 2025 13:37
@shahargl
Copy link
Member

@EnotShow let tests pass and if they will I'll review

@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. and removed size:XL This PR changes 500-999 lines, ignoring generated files. labels May 26, 2025
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels May 29, 2025
@korolenkowork
Copy link
Contributor Author

Hey @shahargl, it's resolved!

I also added a separate Docker Compose file for E2E migrations testing, which attaches a dedicated volume. Because it seems that accessing the same volume from different workflows was causing concurrent map writes, like this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Improvements or additions to documentation Feature A new feature size:XL This PR changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[βž• Feature]: Implement "auto downgrades"
2 participants