Skip to content
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

Add migration script for user limits overrides #1755

Merged
merged 4 commits into from
Jan 4, 2025

Conversation

NolanTrem
Copy link
Collaborator

@NolanTrem NolanTrem commented Jan 4, 2025

Important

Add migration script for limits_overrides column in users table, update Docker image, and add CLI warning for older version upgrades.

  • Migration:
    • Adds limits_overrides column to users table in 7eb70560f406_add_limits_overrides_to_users.py.
    • Includes check_if_upgrade_needed() to verify if migration is required.
    • Provides upgrade() and downgrade() functions for migration.
  • CLI:
    • Adds warning message in serve() in system.py for users migrating from version 3.3.18 or earlier.
  • Docker:
    • Changes Docker image to r2r/test in compose.yaml.
  • Versioning:
    • Updates version in package.json to 0.4.8.
    • Updates version in pyproject.toml to 3.3.19.

This description was created by Ellipsis for e831245. It will automatically update as commits are pushed.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Reviewed everything up to 9047443 in 27 seconds

More details
  • Looked at 339 lines of code in 8 files
  • Skipped 0 files when reviewing.
  • Skipped posting 5 drafted comments based on config settings.
1. py/migrations/versions/2fac23e4d91b_migrate_to_document_search.py:188
  • Draft comment:
    The offset is not being updated correctly in the loop. It should be incremented by limit instead of adding limit to offset. This will cause an infinite loop if the number of documents is greater than the limit.
offset += limit
  • Reason this comment was not posted:
    Comment was not on a valid diff hunk.
2. py/migrations/versions/7eb70560f406_add_limits_overrides_to_users.py:33
  • Draft comment:
    Avoid using print statements in migration scripts. Consider using a logging framework instead for better control over output.

This comment also applies to similar print statements in other migration scripts.

  • Reason this comment was not posted:
    Confidence changes required: 50%
    The check_if_upgrade_needed function in py/migrations/versions/7eb70560f406_add_limits_overrides_to_users.py and other migration scripts prints messages to the console. This is not a best practice for migration scripts as it can clutter the output. Consider using logging instead.
3. py/migrations/versions/8077140e1e99_v3_api_database_revision.py:44
  • Draft comment:
    Avoid using print statements in migration scripts. Consider using a logging framework instead for better control over output.

This comment also applies to similar print statements in other migration scripts.

  • Reason this comment was not posted:
    Confidence changes required: 50%
    The check_if_upgrade_needed function in py/migrations/versions/8077140e1e99_v3_api_database_revision.py and other migration scripts prints messages to the console. This is not a best practice for migration scripts as it can clutter the output. Consider using logging instead.
4. py/migrations/versions/c45a9cf6a8a4_add_user_and_document_count_to_.py:41
  • Draft comment:
    Avoid using print statements in migration scripts. Consider using a logging framework instead for better control over output.

This comment also applies to similar print statements in other migration scripts.

  • Reason this comment was not posted:
    Confidence changes required: 50%
    The check_if_upgrade_needed function in py/migrations/versions/c45a9cf6a8a4_add_user_and_document_count_to_.py and other migration scripts prints messages to the console. This is not a best practice for migration scripts as it can clutter the output. Consider using logging instead.
5. py/migrations/versions/d342e632358a_migrate_to_asyncpg.py:47
  • Draft comment:
    Avoid using print statements in migration scripts. Consider using a logging framework instead for better control over output.

This comment also applies to similar print statements in other migration scripts.

  • Reason this comment was not posted:
    Confidence changes required: 50%
    The check_if_upgrade_needed function in py/migrations/versions/d342e632358a_migrate_to_asyncpg.py and other migration scripts prints messages to the console. This is not a best practice for migration scripts as it can clutter the output. Consider using logging instead.

Workflow ID: wflow_k2zxU8wZlLvseBfn


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on be75154 in 11 seconds

More details
  • Looked at 26 lines of code in 2 files
  • Skipped 1 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. js/sdk/package.json:3
  • Draft comment:
    Ensure the version bump follows semantic versioning principles. Since a new feature is added, a minor version bump is appropriate.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The version bump in package.json and pyproject.toml is consistent with the changes described in the PR. However, it's important to ensure that the versioning follows semantic versioning principles. Since the changes involve adding a new feature (migration script), a minor version bump is appropriate.

Workflow ID: wflow_FNoUIQcMSJCPVnw4


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on 3126ed6 in 11 seconds

More details
  • Looked at 14 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. py/compose.yaml:40
  • Draft comment:
    The Docker image for the 'r2r' service was reverted to 'ragtoriches/prod:latest', but the PR description indicates it should be 'r2r/test'. Please ensure the image is updated as intended.
  • Reason this comment was not posted:
    Comment did not seem useful.

Workflow ID: wflow_PnB8MOAXo7pIW2oe


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on e831245 in 9 seconds

More details
  • Looked at 17 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. js/README.md:3
  • Draft comment:
    Ensure the updated link is correct and accessible. Verify that https://r2r-docs.sciphi.ai/api-and-sdks/introduction is the intended URL.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The updated links in the README file should be verified for correctness.
2. js/README.md:7
  • Draft comment:
    Ensure the updated link is correct and accessible. Verify that https://r2r-docs.sciphi.ai/documentation/installation/overview is the intended URL.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The updated links in the README file should be verified for correctness.

Workflow ID: wflow_iBSpc9mIRfuDFK96


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@NolanTrem NolanTrem merged commit 194a801 into main Jan 4, 2025
15 checks passed
@NolanTrem NolanTrem deleted the Nolan/LimitsOverrideMigration branch January 4, 2025 03:12
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.

1 participant