-
Notifications
You must be signed in to change notification settings - Fork 2
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
Event history refactor #71
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Warning Rate limit exceeded@eriktaubeneck has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 9 minutes and 44 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. WalkthroughThis update brings substantive improvements to the Changes
Poem
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? TipsChatThere are 3 ways to chat with CodeRabbit:
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 as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need this empty file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well this is fun. pre-commit working locally but not on GH. I'll debug |
There was a problem hiding this 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
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (13)
- .github/workflows/pre-commit.yaml (1 hunks)
- .gitignore (1 hunks)
- .pre-commit-config.yaml (1 hunks)
- .pyre_configuration (1 hunks)
- pyproject.toml (2 hunks)
- sidecar/app/query/base.py (7 hunks)
- sidecar/app/query/status.py (1 hunks)
- sidecar/app/query/step.py (1 hunks)
- sidecar/app/routes/start.py (1 hunks)
- sidecar/app/routes/stop.py (1 hunks)
- sidecar/app/routes/websockets.py (1 hunks)
- sidecar/cli/cli.py (1 hunks)
- sidecar/tests/app/query/test_status.py (1 hunks)
Files skipped from review due to trivial changes (7)
- .github/workflows/pre-commit.yaml
- .gitignore
- pyproject.toml
- sidecar/app/routes/start.py
- sidecar/app/routes/stop.py
- sidecar/app/routes/websockets.py
- sidecar/cli/cli.py
Additional comments not posted (31)
.pyre_configuration (1)
4-4
: LGTM!The modification of
source_directories
to a dictionary format is correct and aligns with the JSON structure..pre-commit-config.yaml (3)
22-28
: Additions forpytest
configuration look good.The configuration for
pytest
is correctly added and will enhance testing.
29-35
: Additions forcoverage
configuration look good.The configuration for
coverage
is correctly added and will enhance coverage reporting.
35-35
: Verify thepyre-check
configuration.Ensure that the modified
pyre-check
configuration works as expected.sidecar/app/query/step.py (1)
11-11
: LGTM!The import statement for
Status
is correct and aligns with the refactoring.sidecar/app/query/status.py (1)
1-83
: LGTM!The new functionality for managing status history is well-structured and aligns with the refactoring objectives.
However, ensure that the logic for adding status and managing status history works as expected.
sidecar/tests/app/query/test_status.py (10)
10-17
: Fixture setup looks good.The
_status_history_fixture
correctly sets up aStatusHistory
instance with a temporary file path and a logger.
20-33
: Fixture setup looks good.The
_full_status_history_fixture
correctly sets up aStatusHistory
instance with a sequence of status events.
36-46
: Test function looks good.The
test_status_history_add
function correctly tests adding status events and verifies the current status event.
49-55
: Test function looks good.The
test_status_history_add_write_to_file
function correctly tests writing status events to a file and verifies the file contents.
57-63
: Test function looks good.The
test_status_history_add_load_from_file
function correctly tests loading status events from a file and verifies the loadedStatusHistory
instance.
65-69
: Test function looks good.The
test_status_history_cannot_add_when_locked
function correctly tests that status events cannot be added when theStatusHistory
instance is locked.
71-80
: Test function looks good.The
test_status_history_cannot_add_lower_status
function correctly tests that lower status events cannot be added to theStatusHistory
instance.
82-85
: Test function looks good.The
test_status_history_current_status_event
function correctly tests retrieving the current status event from theStatusHistory
instance.
88-89
: Test function looks good.The
test_status_history_current_status
function correctly tests retrieving the current status from theStatusHistory
instance.
92-115
: Test function looks good.The
test_status_history_status_event_json
function correctly tests retrieving the status event in JSON format from theStatusHistory
instance.sidecar/app/query/base.py (15)
33-42
: Method implementation looks good.The
__post_init__
method correctly initializes theStatusHistory
instance, creates status directories, and sets up logging.
55-57
: Property implementation looks good.The
_log_dir
property correctly returns the path to the log directory.
64-65
: Property implementation looks good.The
started
property correctly checks the status to determine if the query has started.
68-69
: Property implementation looks good.The
finished
property correctly checks the status to determine if the query has finished.
90-90
: Property implementation looks good.The
status
property correctly retrieves the current status from theStatusHistory
instance.
94-95
: Setter implementation looks good.The
status
setter correctly adds a new status to theStatusHistory
instance if the status has changed and is less than or equal toStatus.COMPLETE
.
97-99
: Property implementation looks good.The
status_event_json
property correctly retrieves the status event in JSON format from theStatusHistory
instance.
111-112
: Property implementation looks good.The
steps
property correctly yields steps built from the query.
Line range hint
114-127
:
Method implementation looks good.The
start
method correctly initiates the steps, handles exceptions, and updates the status.
Line range hint
129-135
:
Method implementation looks good.The
finish
method correctly updates the status toStatus.COMPLETE
, logs the completion, and performs cleanup.
142-146
: Method implementation looks good.The
kill
method correctly updates the status toStatus.KILLED
, logs the termination, and performs cleanup.
150-154
: Method implementation looks good.The
crash
method correctly updates the status toStatus.CRASHED
, logs the crash, and performs cleanup.
156-162
: Method implementation looks good.The
_cleanup
method correctly resets the current step, removes the logger, and deletes the query from the dictionary.Tools
Ruff
159-162: Use
contextlib.suppress(ValueError)
instead oftry
-except
-pass
Replace with
contextlib.suppress(ValueError)
(SIM105)
164-166
: Property implementation looks good.The
cpu_usage_percent
property correctly retrieves the CPU usage percentage from the current step.
Line range hint
168-170
:
Property implementation looks good.The
memory_rss_usage
property correctly retrieves the memory RSS usage from the current step.Tools
Ruff
159-162: Use
contextlib.suppress(ValueError)
instead oftry
-except
-pass
Replace with
contextlib.suppress(ValueError)
(SIM105)
this moves all the
status
related elements into it's own directory, and adds tests for those elements.currently set up to compare against #70 , so review that first, and make sure to change the base before merging.
Summary by CodeRabbit
New Features
StatusHistory
for improved tracking and management of query statuses.Bug Fixes
Status
to ensure consistency across different modules.Chores
.gitignore
to exclude.coverage*
files.pytest
andcoverage
tools.Tests
StatusHistory
class to ensure reliable functionality.