-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Allow users to start auto-annotation again if the previous request fails #8587
Conversation
Currently, if an auto-annotation request fails, the UI doesn't re-enable the "Automatic annotation" menu item. This seems like a mistake, since at that point there's no reason why a new request could not be started - in fact, it's possible to do if you just refresh the page. Fix this by only disabling the menu item if the current AR is still in progress.
faa1da3
to
69d5c4a
Compare
Quality Gate passedIssues Measures |
WalkthroughThe changes introduced in this pull request enhance the user interface of the CVAT application by allowing users to restart the automatic annotation process after a failure. Additionally, 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 using PR comments)
Other keywords and placeholders
CodeRabbit Configuration 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.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
changelog.d/20241023_144231_roman_aa_after_fail.md (1)
3-4
: Improve readability by adding "the" before "UI".Consider updating the text for better readability.
-- UI now allows the user to start automatic annotation again +- The UI now allows the user to start automatic annotation again🧰 Tools
🪛 LanguageTool
[uncategorized] ~3-~3: You might be missing the article “the” here.
Context: ### Fixed - UI now allows the user to start automatic ...(AI_EN_LECTOR_MISSING_DETERMINER_THE)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (3)
- changelog.d/20241023_144231_roman_aa_after_fail.md (1 hunks)
- cvat-ui/package.json (1 hunks)
- cvat-ui/src/containers/actions-menu/actions-menu.tsx (2 hunks)
✅ Files skipped from review due to trivial changes (1)
- cvat-ui/package.json
🧰 Additional context used
🪛 LanguageTool
changelog.d/20241023_144231_roman_aa_after_fail.md
[uncategorized] ~3-~3: You might be missing the article “the” here.
Context: ### Fixed - UI now allows the user to start automatic ...(AI_EN_LECTOR_MISSING_DETERMINER_THE)
🔇 Additional comments (3)
cvat-ui/src/containers/actions-menu/actions-menu.tsx (3)
20-20
: LGTM: Clean import additionThe RQStatus import is appropriately placed and necessary for the enhanced inference status checking.
50-51
: LGTM: Clean state retrievalThe inference state is properly retrieved from the Redux store using the task ID.
54-55
: Verify completeness of inference status checksThe logic correctly implements the ability to retry after failure, but let's verify if there are other terminal states that should be considered.
✅ Verification successful
Based on the search results, I can now generate the final response since I have a complete view of the RQStatus enum and its usage across the codebase.
Current status checks are complete and correct
The implementation correctly handles all possible RQStatus states. From the enum definition in
cvat-core/src/enums.ts
, there are exactly 5 states:
- QUEUED
- STARTED
- FINISHED
- FAILED
- UNKNOWN
The current logic
![RQStatus.FAILED, RQStatus.FINISHED].includes(inference.status)
considers inference as active when it's not in terminal states (FAILED or FINISHED), which means it will be active during QUEUED, STARTED, and UNKNOWN states. This aligns with the codebase's handling of these states in other components, particularly in the automatic annotation progress component (cvat-ui/src/components/tasks-page/automatic-annotation-progress.tsx
).🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Search for all RQStatus enum definitions and usages to ensure we're handling all relevant states echo "Searching for RQStatus definition and usage patterns..." rg -A 10 "enum RQStatus" rg "RQStatus\."Length of output: 7821
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #8587 +/- ##
===========================================
+ Coverage 74.24% 74.26% +0.02%
===========================================
Files 403 403
Lines 43287 43313 +26
Branches 3914 3914
===========================================
+ Hits 32137 32165 +28
+ Misses 11150 11148 -2
|
Motivation and context
Currently, if an auto-annotation request fails, the UI doesn't re-enable the "Automatic annotation" menu item. This seems like a mistake, since at that point there's no reason why a new request could not be started - in fact, it's possible to do if you just refresh the page.
Fix this by only disabling the menu item if the current AR is still in progress.
How has this been tested?
Checklist
develop
branch[ ] I have updated the documentation accordingly[ ] I have added tests to cover my changes[ ] I have linked related issues (see GitHub docs)(cvat-canvas,
cvat-core,
cvat-data and
cvat-ui)
License
Feel free to contact the maintainers if that's a concern.
Summary by CodeRabbit
New Features
Version Updates
Improvements