Skip to content

[OSDEV-1388] Own waiter instead waiter from boto3#390

Merged
roninzp merged 4 commits intomainfrom
OSDEV-1388/own-snapshot-waiter
Nov 26, 2024
Merged

[OSDEV-1388] Own waiter instead waiter from boto3#390
roninzp merged 4 commits intomainfrom
OSDEV-1388/own-snapshot-waiter

Conversation

@roninzp
Copy link
Contributor

@roninzp roninzp commented Oct 24, 2024

The waiter from boto3 cannot wait more than half an hour so we replaced it with our own.

@roninzp roninzp temporarily deployed to Quality Environment October 24, 2024 12:11 — with GitHub Actions Inactive
@roninzp roninzp temporarily deployed to Quality Environment October 24, 2024 12:11 — with GitHub Actions Inactive
@roninzp roninzp temporarily deployed to Quality Environment October 24, 2024 12:11 — with GitHub Actions Inactive
@roninzp roninzp temporarily deployed to Quality Environment October 24, 2024 12:11 — with GitHub Actions Inactive
@roninzp roninzp temporarily deployed to Quality Environment October 24, 2024 12:11 — with GitHub Actions Inactive
@roninzp roninzp temporarily deployed to Quality Environment October 24, 2024 12:11 — with GitHub Actions Inactive
@roninzp roninzp temporarily deployed to Quality Environment October 24, 2024 12:11 — with GitHub Actions Inactive
@roninzp roninzp temporarily deployed to Quality Environment October 24, 2024 12:11 — with GitHub Actions Inactive
@roninzp roninzp temporarily deployed to Quality Environment October 24, 2024 12:11 — with GitHub Actions Inactive
@roninzp roninzp temporarily deployed to Quality Environment October 24, 2024 12:11 — with GitHub Actions Inactive
@roninzp roninzp temporarily deployed to Quality Environment October 24, 2024 12:11 — with GitHub Actions Inactive
@roninzp roninzp temporarily deployed to Quality Environment October 24, 2024 12:11 — with GitHub Actions Inactive
@roninzp roninzp temporarily deployed to Quality Environment October 24, 2024 12:11 — with GitHub Actions Inactive
@roninzp roninzp temporarily deployed to Quality Environment October 24, 2024 12:11 — with GitHub Actions Inactive
@roninzp roninzp self-assigned this Oct 24, 2024
@roninzp roninzp temporarily deployed to Quality Environment October 24, 2024 12:13 — with GitHub Actions Inactive
@barecheck
Copy link

barecheck bot commented Oct 24, 2024

React App | Jest test suite - Code coverage report

Total: 27.8%

Your code coverage diff: 0.00% ▴

✅ All code changes are covered

@coderabbitai
Copy link

coderabbitai bot commented Oct 24, 2024

📝 Walkthrough
📝 Walkthrough

Walkthrough

The changes in this pull request involve modifications to the database_anonymizer.py script, enhancing the logic for monitoring a shared database snapshot's status. The previous waiter implementation has been replaced with a polling mechanism, allowing for more precise control over status checks. Additionally, the RELEASE-NOTES.md file has been updated to document changes for version 1.26.0, including placeholders for future updates and a bug fix related to the boto3 waiter.

Changes

File Path Change Summary
deployment/terraform/database_anonymizer_sheduled_task/docker/database_anonymizer.py Enhanced snapshot status monitoring logic with a polling mechanism; added time module import.
doc/release/RELEASE-NOTES.md Added release notes for version 1.26.0, including placeholders for future updates and a bug fix for boto3 waiter.

Possibly related PRs

  • Updated RELEASE-NOTES.md file for 1.24 version #396: The update to the RELEASE-NOTES.md includes a bug fix related to the boto3 waiter, which is relevant to the changes made in the main PR that replaces the boto3 waiter with a custom implementation for monitoring database snapshot status.

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 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: 1

🧹 Outside diff range and nitpick comments (1)
doc/release/RELEASE-NOTES.md (1)

35-36: Improve formatting and remove duplicate entry

The bug fix entry about replacing the boto3 waiter appears to be a duplicate of the PR objective. Additionally, the formatting is inconsistent with other entries in the file.

Apply this diff to improve the formatting:

-* [OSDEV-1388](https://opensupplyhub.atlassian.net/browse/OSDEV-1388)
-  * The waiter from boto3 cannot wait more than half an hour so we replaced it with our own.
+* [OSDEV-1388](https://opensupplyhub.atlassian.net/browse/OSDEV-1388) - The waiter from boto3 cannot wait more than half an hour so we replaced it with our own.
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between f2fb3db and 1ff05bd.

📒 Files selected for processing (2)
  • deployment/terraform/database_anonymizer_sheduled_task/docker/database_anonymizer.py (2 hunks)
  • doc/release/RELEASE-NOTES.md (1 hunks)
🔇 Additional comments (3)
deployment/terraform/database_anonymizer_sheduled_task/docker/database_anonymizer.py (2)

5-5: LGTM: Import addition is appropriate

The time module import is correctly placed and necessary for the new polling implementation.


116-128: Verify timeout configuration across snapshot operations

The script uses different timeout configurations for various operations:

  • DB instance waiter: 120 attempts * 120s = 4 hours
  • DB snapshot waiter: 100 attempts * 15s = 25 minutes
  • New polling mechanism: 300 attempts * 60s = 5 hours

Please verify if these varying timeouts align with your requirements.

✅ Verification successful

Based on the search results, I can now generate a final response as I have sufficient context about the waiter configurations and their purpose from both the code and release notes.

Varying timeout configurations are intentionally designed and documented

The different timeout configurations across snapshot operations are intentionally designed to handle varying AWS RDS operation durations:

  1. DB instance waiter (4 hours): Used for database restoration, which can be a lengthy operation
  2. DB snapshot waiter (25 minutes): Used for standard snapshot completion
  3. Custom polling (5 hours): Specifically implemented to handle snapshot sharing, as noted in the release notes: "The waiter from boto3 cannot wait more than half an hour so we replaced it with our own"

The varying timeouts are not an inconsistency but rather a deliberate design choice to accommodate different AWS RDS operations and their typical completion times. The custom polling mechanism was specifically added to overcome boto3's waiter limitations for longer operations.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for all waiter configurations in the codebase to ensure consistency
rg -A 5 "waiter|time.sleep" 

Length of output: 3533

doc/release/RELEASE-NOTES.md (1)

Line range hint 1-1000: LGTM!

The release notes are well-structured and provide clear documentation of changes across versions. The format is consistent, and the information is properly organized into relevant sections.

@roninzp roninzp temporarily deployed to Quality Environment October 24, 2024 12:18 — with GitHub Actions Inactive
@barecheck
Copy link

barecheck bot commented Oct 24, 2024

Dedupe Hub App | Unittest test suite - Code coverage report

Total: 56.14%

Your code coverage diff: 0.00% ▴

✅ All code changes are covered

@roninzp roninzp temporarily deployed to Quality Environment October 24, 2024 12:19 — with GitHub Actions Inactive
@roninzp roninzp temporarily deployed to Quality Environment October 24, 2024 12:19 — with GitHub Actions Inactive
@barecheck
Copy link

barecheck bot commented Oct 24, 2024

Countries App | Unittest test suite - Code coverage report

Total: 100%

Your code coverage diff: 0.00% ▴

✅ All code changes are covered

@barecheck
Copy link

barecheck bot commented Oct 24, 2024

Contricleaner App | Unittest test suite - Code coverage report

Total: 98.91%

Your code coverage diff: 0.00% ▴

✅ All code changes are covered

@roninzp roninzp temporarily deployed to Quality Environment October 24, 2024 12:28 — with GitHub Actions Inactive
@barecheck
Copy link

barecheck bot commented Oct 24, 2024

Django App | Unittest test suite - Code coverage report

Total: 79.16%

Your code coverage diff: 0.00% ▴

✅ All code changes are covered

killev
killev previously approved these changes Oct 29, 2024
Copy link
Contributor

@killev killev left a comment

Choose a reason for hiding this comment

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

LGTM

@roninzp roninzp temporarily deployed to Quality Environment November 26, 2024 08:54 — with GitHub Actions Inactive
@roninzp roninzp temporarily deployed to Quality Environment November 26, 2024 08:54 — with GitHub Actions Inactive
@roninzp roninzp temporarily deployed to Quality Environment November 26, 2024 08:54 — with GitHub Actions Inactive
@roninzp roninzp temporarily deployed to Quality Environment November 26, 2024 08:54 — with GitHub Actions Inactive
@roninzp roninzp temporarily deployed to Quality Environment November 26, 2024 08:56 — with GitHub Actions Inactive
@roninzp roninzp temporarily deployed to Quality Environment November 26, 2024 09:01 — with GitHub Actions Inactive
@roninzp roninzp temporarily deployed to Quality Environment November 26, 2024 09:01 — with GitHub Actions Inactive
@roninzp roninzp temporarily deployed to Quality Environment November 26, 2024 09:01 — with GitHub Actions Inactive
@roninzp roninzp temporarily deployed to Quality Environment November 26, 2024 09:11 — with GitHub Actions Inactive
@roninzp roninzp temporarily deployed to Quality Environment November 26, 2024 11:41 — with GitHub Actions Inactive
@roninzp roninzp temporarily deployed to Quality Environment November 26, 2024 11:41 — with GitHub Actions Inactive
@roninzp roninzp temporarily deployed to Quality Environment November 26, 2024 11:41 — with GitHub Actions Inactive
@roninzp roninzp temporarily deployed to Quality Environment November 26, 2024 11:41 — with GitHub Actions Inactive
@roninzp roninzp temporarily deployed to Quality Environment November 26, 2024 11:41 — with GitHub Actions Inactive
@roninzp roninzp temporarily deployed to Quality Environment November 26, 2024 11:41 — with GitHub Actions Inactive
@roninzp roninzp temporarily deployed to Quality Environment November 26, 2024 11:41 — with GitHub Actions Inactive
@roninzp roninzp temporarily deployed to Quality Environment November 26, 2024 11:41 — with GitHub Actions Inactive
@roninzp roninzp temporarily deployed to Quality Environment November 26, 2024 11:41 — with GitHub Actions Inactive
@roninzp roninzp temporarily deployed to Quality Environment November 26, 2024 11:41 — with GitHub Actions Inactive
@roninzp roninzp temporarily deployed to Quality Environment November 26, 2024 11:41 — with GitHub Actions Inactive
@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

🧹 Outside diff range and nitpick comments (3)
doc/release/RELEASE-NOTES.md (3)

10-10: Update the release date

The release date is set to a future date (December 14, 2024). Please update it to the actual release date.


14-14: Fill in the placeholder sections

Several sections contain placeholder text that needs to be replaced with actual content:

  • Migrations
  • Scheme changes
  • Code/API changes
  • Architecture/Environment changes
  • What's new
  • Release instructions

Please update these sections with the relevant changes being made in this release.

Also applies to: 17-17, 20-20, 23-23, 29-29, 32-32


12-12: Remove trailing colons from section headers

The section headers should not end with colons according to the markdown style guide.

Apply this change to the following headers:

  • Database changes
  • Migrations
  • Scheme changes
  • Code/API changes
  • What's new
  • Release instructions

Also applies to: 16-16, 19-19, 22-22, 28-28, 31-31

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 6e122f0 and e32198a.

📒 Files selected for processing (1)
  • doc/release/RELEASE-NOTES.md (1 hunks)
🧰 Additional context used
🪛 Markdownlint (0.35.0)
doc/release/RELEASE-NOTES.md

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

(MD026, no-trailing-punctuation)


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

(MD026, no-trailing-punctuation)

Copy link
Contributor

@vladsha-dev vladsha-dev left a comment

Choose a reason for hiding this comment

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

LGTM

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.

4 participants