-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
base: develop
Are you sure you want to change the base?
Project quality #9116
Conversation
…roject-quality-v2
"job__segment__task", | ||
"job__segment__task__project", | ||
"task", | ||
"task__project", |
Check warning
Code scanning / CodeQL
Information exposure through an exception
Show autofix suggestion
Hide autofix suggestion
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.
-
Copy modified line R6 -
Copy modified line R50 -
Copy modified lines R350-R351
@@ -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.") | ||
|
|
Motivation and context
Obsoletes #6367
Depends on: #9275, #9272
How has this been tested?
Checklist
develop
branchLicense
Feel free to contact the maintainers if that's a concern.