Skip to content

Conversation

@A-Artemis
Copy link
Contributor

@A-Artemis A-Artemis commented May 27, 2025

📝 Description

Adds a data migrations script to clean up the database of local anomaly references.
The following collections are affected ["annotation_scene", "annotation_scene_state", "project", "label", "label_schema", "model", "model_storage", "task_node"]

Removes the FEATURE_FLAG_ANOMALY_REDUCTION and cleans up remaining code related to local anomaly tasks.

The dataset IE still supports

  • GetiProjectType.ANOMALY_CLASSIFICATION
  • GetiProjectType.ANOMALY_DETECTION
  • GetiProjectType.ANOMALY_SEGMENTATION
    so that old exported datasets can be imported to the new GetProjectType.ANOMALY

✨ Type of Change

Select the type of change your PR introduces:

  • 🐞 Bug fix – Non-breaking change which fixes an issue
  • 🚀 New feature – Non-breaking change which adds functionality
  • 🔨 Refactor – Non-breaking change which refactors the code base
  • 💥 Breaking change – Changes that break existing functionality
  • 📚 Documentation update
  • 🔒 Security update
  • 🧪 Tests

🧪 Testing Scenarios

Describe how the changes were tested and how reviewers can test them too:

  • ✅ Tested manually
  • 🤖 Run automated end-to-end tests

✅ Checklist

Before submitting the PR, ensure the following:

  • 🔍 PR title is clear and descriptive
  • 📝 For internal contributors: If applicable, include the JIRA ticket number (e.g., ITEP-123456) in the PR title. Do not include full URLs
  • 💬 I have commented my code, especially in hard-to-understand areas
  • 📄 I have made corresponding changes to the documentation
  • ✅ I have added tests that prove my fix is effective or my feature works

@github-actions github-actions bot added the IAI Interactive AI backend label May 27, 2025
A-Artemis added 9 commits May 27, 2025 13:19
…o aurelien/anomaly-reduction-cleanup

# Conflicts:
#	interactive_ai/data_migration/migration/changelog/30.json
…o aurelien/anomaly-reduction-cleanup

# Conflicts:
#	interactive_ai/services/director/app/communication/controllers/model_test_controller.py
#	interactive_ai/services/director/app/communication/views/annotation_rest_views.py
#	interactive_ai/services/director/app/communication/views/model_template_rest_views.py
#	interactive_ai/services/director/app/communication/views/performance_rest_views.py
#	interactive_ai/services/director/app/features/feature_flag_provider.py
#	interactive_ai/services/director/tests/unit/communication/rest_controllers/test_model_test_controller.py
#	interactive_ai/services/director/tests/unit/communication/rest_views/test_annotation_rest_views.py
#	interactive_ai/services/director/tests/unit/communication/rest_views/test_model_template_rest_views.py
#	interactive_ai/services/director/tests/unit/communication/rest_views/test_performance_rest_views.py
#	interactive_ai/services/director/tests/unit/communication/test_rest_datamodels.py
@A-Artemis A-Artemis marked this pull request as ready for review June 18, 2025 06:51
@A-Artemis A-Artemis requested a review from a team as a code owner June 18, 2025 06:51
@A-Artemis A-Artemis requested review from Copilot June 18, 2025 09:04
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR cleans up obsolete anomaly reduction logic by removing the FEATURE_FLAG_ANOMALY_REDUCTION flag from various parts of the code and unifying anomaly task types into a single ANOMALY enum value. In addition, it introduces a new data migration script to update legacy anomaly representations and bumps the project data version.

  • Removed obsolete feature flag checks and related test fixtures.
  • Updated the anomaly task type to a unified ANOMALY value in enums and test expectations.
  • Added a migration script (with corresponding tests and metadata) to reduce anomaly tasks.

Reviewed Changes

Copilot reviewed 48 out of 48 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
interactive_ai/services/director/tests/unit/... Removed obsolete feature flag imports and calls in tests.
interactive_ai/services/dataset_ie/app/... Updated feature flag usage and project type mapping.
interactive_ai/libs/iai_core_py/iai_core/utils/project_builder.py Removed anomaly-specific renaming logic to align with streamlined task type representation.
interactive_ai/data_migration/migration/scripts/reduce_anomaly_tasks.py New migration script for anomaly reduction with recursive field updates.
interactive_ai/libs/iai_core_py/iai_core/entities/... Added the unified ANOMALY task type and updated related constants.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Contributor

@JortBergfeld JortBergfeld left a comment

Choose a reason for hiding this comment

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

LGTM, I am just wondering why a new domain had to be introduced in this PR, and why the old ones are not removed.

leoll2
leoll2 previously approved these changes Jun 20, 2025
@A-Artemis A-Artemis self-assigned this Jul 14, 2025
leoll2
leoll2 previously approved these changes Jul 14, 2025
@A-Artemis A-Artemis linked an issue Jul 14, 2025 that may be closed by this pull request
@A-Artemis A-Artemis added this pull request to the merge queue Jul 15, 2025
Merged via the queue into main with commit 0838bf7 Jul 15, 2025
30 checks passed
@A-Artemis A-Artemis deleted the aurelien/anomaly-reduction-cleanup branch July 15, 2025 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

IAI Interactive AI backend Platform

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migration and removal of old code [Bug] demo_notebook.ipynb file addresses folder "Anomaly segmentation" as "Anomaly", so it fails to execute

5 participants