Skip to content

Conversation

@pcrespov
Copy link
Member

@pcrespov pcrespov commented May 26, 2025

What do these changes do?

Found some more fixes for invalid HTTP reason attribute observed in the front-end:

image

Related issue/s

How to test

Dev-ops

@pcrespov pcrespov self-assigned this May 26, 2025
@pcrespov pcrespov added the a:webserver webserver's codebase. Assigning the area is particularly useful for bugs label May 26, 2025
@pcrespov pcrespov added this to the Bazinga! milestone May 26, 2025
@pcrespov pcrespov marked this pull request as ready for review May 26, 2025 13:19
@pcrespov pcrespov enabled auto-merge (squash) May 26, 2025 13:20
@pcrespov
Copy link
Member Author

@mergify queue

@pcrespov pcrespov added the 🤖-automerge marks PR as ready to be merged for Mergify label May 26, 2025
@mergify
Copy link
Contributor

mergify bot commented May 26, 2025

queue

🛑 The pull request has been merged manually

The pull request has been merged manually at 5028e5a

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 fixes front-end errors caused by newline characters in the HTTP reason attribute by sanitizing these messages. Key changes include:

  • Replacing newline characters in error messages within the exception class.
  • Applying a similar sanitization in the error response factory to prevent HTTP error misconfiguration.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
services/web/server/src/simcore_service_webserver/exporter/exceptions.py Introduces message sanitization in the HTTP exception initialization
services/web/server/src/simcore_service_webserver/exception_handling/_factory.py Applies newline replacement for HTTP reason in the JSON response factory
Comments suppressed due to low confidence (1)

services/web/server/src/simcore_service_webserver/exception_handling/_factory.py:44

  • Ensure that the error message sanitization is consistent across the codebase; if similar logic is used elsewhere, consider centralizing this functionality to prevent future discrepancies.
reason=error.message.replace("\n", " ") if error.message else None,

@codecov
Copy link

codecov bot commented May 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.80%. Comparing base (7ac9104) to head (89be8b1).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7755      +/-   ##
==========================================
- Coverage   87.34%   83.80%   -3.54%     
==========================================
  Files        1841      701    -1140     
  Lines       71456    33286   -38170     
  Branches     1214      174    -1040     
==========================================
- Hits        62410    27895   -34515     
+ Misses       8703     5333    -3370     
+ Partials      343       58     -285     
Flag Coverage Δ
integrationtests 64.36% <50.00%> (-0.02%) ⬇️
unittests 87.05% <100.00%> (+0.49%) ⬆️
Components Coverage Δ
api ∅ <ø> (∅)
pkg_aws_library ∅ <ø> (∅)
pkg_dask_task_models_library ∅ <ø> (∅)
pkg_models_library ∅ <ø> (∅)
pkg_notifications_library ∅ <ø> (∅)
pkg_postgres_database ∅ <ø> (∅)
pkg_service_integration ∅ <ø> (∅)
pkg_service_library ∅ <ø> (∅)
pkg_settings_library ∅ <ø> (∅)
pkg_simcore_sdk 76.83% <ø> (-8.24%) ⬇️
agent ∅ <ø> (∅)
api_server ∅ <ø> (∅)
autoscaling ∅ <ø> (∅)
catalog ∅ <ø> (∅)
clusters_keeper ∅ <ø> (∅)
dask_sidecar ∅ <ø> (∅)
datcore_adapter ∅ <ø> (∅)
director ∅ <ø> (∅)
director_v2 77.57% <ø> (-13.50%) ⬇️
dynamic_scheduler ∅ <ø> (∅)
dynamic_sidecar 88.45% <ø> (-1.75%) ⬇️
efs_guardian ∅ <ø> (∅)
invitations ∅ <ø> (∅)
payments ∅ <ø> (∅)
resource_usage_tracker ∅ <ø> (∅)
storage ∅ <ø> (∅)
webclient ∅ <ø> (∅)
webserver 85.70% <100.00%> (-0.03%) ⬇️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7ac9104...89be8b1. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@sanderegg sanderegg left a comment

Choose a reason for hiding this comment

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

💯

@sonarqubecloud
Copy link

@pcrespov pcrespov merged commit 5028e5a into ITISFoundation:master May 26, 2025
90 of 95 checks passed
@pcrespov pcrespov deleted the fix/reason-and-new-lines branch May 26, 2025 14:22
@matusdrobuliak66 matusdrobuliak66 mentioned this pull request Jun 6, 2025
92 tasks
@matusdrobuliak66 matusdrobuliak66 mentioned this pull request Aug 5, 2025
88 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🤖-automerge marks PR as ready to be merged for Mergify a:webserver webserver's codebase. Assigning the area is particularly useful for bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants