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

Project quality #9116

Open
wants to merge 244 commits into
base: develop
Choose a base branch
from
Open

Project quality #9116

wants to merge 244 commits into from

Conversation

zhiltsov-max
Copy link
Contributor

@zhiltsov-max zhiltsov-max commented Feb 18, 2025

Motivation and context

Obsoletes #6367

Depends on: #9275, #9272

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)

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.

@klakhov klakhov marked this pull request as ready for review March 27, 2025 08:45
@klakhov klakhov requested a review from nmanovic as a code owner March 27, 2025 08:45
"job__segment__task",
"job__segment__task__project",
"task",
"task__project",

Check warning

Code scanning / CodeQL

Information exposure through an exception

[Stack trace information](1) flows to this location and may be exposed to an external user.

Copilot Autofix AI about 10 hours ago

To fix the problem, we should ensure that the exception message does not expose any sensitive information to the end user. Instead of directly converting the exception to a string and raising it, we should log the detailed exception message on the server and return a generic error message to the user.

  • Modify the code to log the exception message using a logging framework.
  • Raise a ValidationError with a generic error message that does not reveal internal details.
Suggested changeset 1
cvat/apps/quality_control/views.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/cvat/apps/quality_control/views.py b/cvat/apps/quality_control/views.py
--- a/cvat/apps/quality_control/views.py
+++ b/cvat/apps/quality_control/views.py
@@ -5,3 +5,3 @@
 import textwrap
-
+import logging
 from django.db.models import Q, QuerySet
@@ -49,3 +49,3 @@
 
-
+logger = logging.getLogger(__name__)
 @extend_schema(tags=["quality"])
@@ -349,3 +349,4 @@
             except qc.QualityReportManager.QualityReportsNotAvailable as ex:
-                raise ValidationError(str(ex))
+                logger.error(f"QualityReportsNotAvailable exception: {str(ex)}")
+                raise ValidationError("Quality reports are currently not available. Please try again later.")
 
EOF
@@ -5,3 +5,3 @@
import textwrap

import logging
from django.db.models import Q, QuerySet
@@ -49,3 +49,3 @@


logger = logging.getLogger(__name__)
@extend_schema(tags=["quality"])
@@ -349,3 +349,4 @@
except qc.QualityReportManager.QualityReportsNotAvailable as ex:
raise ValidationError(str(ex))
logger.error(f"QualityReportsNotAvailable exception: {str(ex)}")
raise ValidationError("Quality reports are currently not available. Please try again later.")

Copilot is powered by AI and may make mistakes. Always verify output.
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

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