Skip to content

Added column for TDAMM tags #1174

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

Draft
wants to merge 38 commits into
base: dev
Choose a base branch
from

Conversation

dhanur-sharma
Copy link
Contributor

No description provided.

@dhanur-sharma dhanur-sharma linked an issue Jan 9, 2025 that may be closed by this pull request
dhanur-sharma and others added 5 commits February 7, 2025 11:09
…rough an exception

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…rough an exception

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@dhanur-sharma
Copy link
Contributor Author

dhanur-sharma commented Feb 7, 2025

The green tags have a 'manual' source and the blue tags have the 'ml' source. The tooltip displays the full form of the tag on hover.

Test videos:

Item(s) that are a work in progress:

  • The logic to filter based on the source of the tags is a work in progress though the HTML is present.

@dhanur-sharma dhanur-sharma marked this pull request as ready for review February 7, 2025 20:37
@dhanur-sharma dhanur-sharma marked this pull request as draft February 7, 2025 21:27
@dhanur-sharma
Copy link
Contributor Author

Needs to be updated to leverage patterns for the TDAMM tags instead of writing to the database directly.

return Response({"status": "success"})
except Exception as e:
logger.error(f"Error occurred: {str(e)}")
return Response({"error": f"An internal error has occurred: {str(e)}"}, status=500)

Check warning

Code scanning / CodeQL

Information exposure through an exception Medium

Stack trace information
flows to this location and may be exposed to an external user.

Copilot Autofix

AI 2 months ago

To fix the problem, we need to ensure that the detailed error information is not exposed to the end user. Instead, we should log the detailed error message on the server side and return a generic error message to the user. This can be achieved by modifying the response on line 490 to remove the detailed exception message and replace it with a generic message.

Suggested changeset 1
sde_collections/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/sde_collections/views.py b/sde_collections/views.py
--- a/sde_collections/views.py
+++ b/sde_collections/views.py
@@ -489,3 +489,3 @@
             logger.error(f"Error occurred: {str(e)}")
-            return Response({"error": f"An internal error has occurred: {str(e)}"}, status=500)
+            return Response({"error": "An internal error has occurred."}, status=500)
 
EOF
@@ -489,3 +489,3 @@
logger.error(f"Error occurred: {str(e)}")
return Response({"error": f"An internal error has occurred: {str(e)}"}, status=500)
return Response({"error": "An internal error has occurred."}, status=500)

Copilot is powered by AI and may make mistakes. Always verify output.
return Response({"status": "success"})
except Exception as e:
logger.error(f"Error occurred: {str(e)}")
return Response({"error": f"An internal error has occurred: {str(e)}"}, status=500)

Check warning

Code scanning / CodeQL

Information exposure through an exception Medium

Stack trace information
flows to this location and may be exposed to an external user.

Copilot Autofix

AI 2 months ago

To fix the problem, we need to ensure that detailed error messages are logged on the server while returning a generic error message to the user. This can be achieved by modifying the exception handling block to log the detailed error message using the logger and returning a generic error message in the response.

  • Modify the exception handling block in the remove_tag method to log the detailed error message.
  • Return a generic error message to the user instead of the detailed exception message.
Suggested changeset 1
sde_collections/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/sde_collections/views.py b/sde_collections/views.py
--- a/sde_collections/views.py
+++ b/sde_collections/views.py
@@ -651,4 +651,4 @@
         except Exception as e:
-            logger.error(f"Error occurred: {str(e)}")
-            return Response({"error": f"An internal error has occurred: {str(e)}"}, status=500)
+            logger.error(f"Error occurred: {str(e)}", exc_info=True)
+            return Response({"error": "An internal error has occurred. Please try again later."}, status=500)
 
EOF
@@ -651,4 +651,4 @@
except Exception as e:
logger.error(f"Error occurred: {str(e)}")
return Response({"error": f"An internal error has occurred: {str(e)}"}, status=500)
logger.error(f"Error occurred: {str(e)}", exc_info=True)
return Response({"error": "An internal error has occurred. Please try again later."}, status=500)

Copilot is powered by AI and may make mistakes. Always verify output.
return Response({"status": "success"})
except Exception as e:
logger.error(f"Error occurred: {str(e)}")
return Response({"error": f"An internal error has occurred: {str(e)}"}, status=500)

Check warning

Code scanning / CodeQL

Information exposure through an exception Medium

Stack trace information
flows to this location and may be exposed to an external user.

Copilot Autofix

AI 2 months ago

To fix the problem, we need to ensure that the detailed error information is not exposed to the end user. Instead, we should log the detailed error message on the server and return a generic error message to the user. This can be achieved by modifying the exception handling block to log the error and return a generic message.

  • Modify the exception handling block in the add_tag method to log the detailed error message and return a generic error message.
  • Ensure that the logging captures the necessary details for debugging purposes.
Suggested changeset 1
sde_collections/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/sde_collections/views.py b/sde_collections/views.py
--- a/sde_collections/views.py
+++ b/sde_collections/views.py
@@ -887,4 +887,4 @@
         except Exception as e:
-            logger.error(f"Error occurred: {str(e)}")
-            return Response({"error": f"An internal error has occurred: {str(e)}"}, status=500)
+            logger.error(f"Error occurred: {str(e)}", exc_info=True)
+            return Response({"error": "An internal error has occurred"}, status=500)
 
EOF
@@ -887,4 +887,4 @@
except Exception as e:
logger.error(f"Error occurred: {str(e)}")
return Response({"error": f"An internal error has occurred: {str(e)}"}, status=500)
logger.error(f"Error occurred: {str(e)}", exc_info=True)
return Response({"error": "An internal error has occurred"}, status=500)

Copilot is powered by AI and may make mistakes. Always verify output.
return Response({"status": "success"})
except Exception as e:
logger.error(f"Error occurred: {str(e)}")
return Response({"error": f"An internal error has occurred: {str(e)}"}, status=500)

Check warning

Code scanning / CodeQL

Information exposure through an exception Medium

Stack trace information
flows to this location and may be exposed to an external user.

Copilot Autofix

AI 2 months ago

To fix the problem, we need to ensure that the detailed error message is not exposed to the end user. Instead, we should log the detailed error message on the server side and return a generic error message to the user. This can be achieved by modifying the return statement on line 1070 to exclude the exception message.

  • Modify the return statement on line 1070 to return a generic error message.
  • Ensure that the detailed error message is logged on the server side using the existing logger.error statement.
Suggested changeset 1
sde_collections/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/sde_collections/views.py b/sde_collections/views.py
--- a/sde_collections/views.py
+++ b/sde_collections/views.py
@@ -1069,3 +1069,3 @@
             logger.error(f"Error occurred: {str(e)}")
-            return Response({"error": f"An internal error has occurred: {str(e)}"}, status=500)
+            return Response({"error": "An internal error has occurred"}, status=500)
 
EOF
@@ -1069,3 +1069,3 @@
logger.error(f"Error occurred: {str(e)}")
return Response({"error": f"An internal error has occurred: {str(e)}"}, status=500)
return Response({"error": "An internal error has occurred"}, status=500)

Copilot is powered by AI and may make mistakes. Always verify output.
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.

ML Classification Delta Url Page
1 participant