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

Allow users to start auto-annotation again if the previous request fails #8587

Merged
merged 1 commit into from
Oct 23, 2024

Conversation

SpecLad
Copy link
Contributor

@SpecLad SpecLad commented Oct 23, 2024

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

  • I submit my changes into the develop branch
  • I have created a changelog fragment
  • [ ] I have updated the documentation accordingly
  • [ ] I have added tests to cover my changes
  • [ ] I have linked related issues (see GitHub docs)
  • I have increased versions of npm packages if it is necessary
    (cvat-canvas,
    cvat-core,
    cvat-data and
    cvat-ui)

License

  • I submit my code changes under the same MIT License that covers the project.
    Feel free to contact the maintainers if that's a concern.

Summary by CodeRabbit

  • New Features

    • Users can now restart the automatic annotation process directly from the UI if a previous request fails, enhancing recovery options.
  • Version Updates

    • Updated the application version from 1.66.1 to 1.66.2.
  • Improvements

    • Enhanced state management for inference tasks, providing a more accurate reflection of task statuses in the UI.

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.
Copy link

sonarcloud bot commented Oct 23, 2024

@SpecLad SpecLad marked this pull request as ready for review October 23, 2024 11:50
Copy link
Contributor

coderabbitai bot commented Oct 23, 2024

Walkthrough

The 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 package.json file for the cvat-ui project has been updated to reflect a new version number. Modifications to the ActionsMenuContainer component's state management logic improve how the application determines if an inference process is active, incorporating a new variable for better accuracy.

Changes

File Path Change Summary
changelog.d/20241023_144231_roman_aa_after_fail.md Added functionality to restart the automatic annotation process after a failure.
cvat-ui/package.json Updated version number from 1.66.1 to 1.66.2.
cvat-ui/src/containers/actions-menu/actions-menu.tsx Modified mapStateToProps to include a new variable inference and updated logic for inferenceIsActive.

Poem

In the garden of code, where rabbits play,
A button now glows, to restart the fray.
With version updated, we hop with delight,
Inferences dance, making logic just right.
So let’s celebrate, with a joyful cheer,
For a smoother process, we hold so dear! 🐇✨


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
Contributor

@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 (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

📥 Commits

Files that changed from the base of the PR and between 5259603 and 69d5c4a.

📒 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 addition

The RQStatus import is appropriately placed and necessary for the enhanced inference status checking.


50-51: LGTM: Clean state retrieval

The inference state is properly retrieved from the Redux store using the task ID.


54-55: Verify completeness of inference status checks

The 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-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.26%. Comparing base (4354f72) to head (69d5c4a).
Report is 10 commits behind head on develop.

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     
Components Coverage Δ
cvat-ui 78.71% <ø> (+0.04%) ⬆️
cvat-server 70.47% <ø> (+<0.01%) ⬆️

@SpecLad SpecLad merged commit 5a77da3 into cvat-ai:develop Oct 23, 2024
42 of 43 checks passed
@SpecLad SpecLad deleted the aa-after-fail branch October 23, 2024 13:46
@cvat-bot cvat-bot bot mentioned this pull request Oct 24, 2024
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.

3 participants