Skip to content

Conversation

@ompat5
Copy link
Collaborator

@ompat5 ompat5 commented Oct 24, 2025

Changes Made

  • Added a new helper function validate_html_dictionary() to recursively validate HTML content within dictionaries.
  • Added validate_html_list() to handle lists that may contain other nested lists or dictionaries.
  • Created a PROPERTIES_EXEMPT set to exclude certain properties from validation where HTML is expected or unnecessary to sanitize.
  • Wrapped validation logic under an environment variable (ADR_VALIDATION_BETAFLAG_ANSYS) to allow toggling validation on/off for easier testing and to avoid affecting users.

User Story: https://tfs.ansys.com:8443/tfs/ANSYS_Development/Portfolio/_workitems/edit/1249514

Other than selected properties and HTML, all strings in params are validated.
@ompat5 ompat5 requested a review from margalva October 24, 2025 15:07
@ompat5 ompat5 self-assigned this Oct 24, 2025
@ompat5 ompat5 requested a review from viseshrp as a code owner October 24, 2025 15:07
@codecov-commenter
Copy link

codecov-commenter commented Oct 24, 2025

Codecov Report

❌ Patch coverage is 83.78378% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.58%. Comparing base (5ecad29) to head (9a0ed7d).

Files with missing lines Patch % Lines
src/ansys/dynamicreporting/core/common_utils.py 93.10% 1 Missing and 1 partial ⚠️
...ansys/dynamicreporting/core/serverless/template.py 33.33% 1 Missing and 1 partial ⚠️
...nsys/dynamicreporting/core/utils/report_objects.py 60.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #431      +/-   ##
==========================================
+ Coverage   81.57%   81.58%   +0.01%     
==========================================
  Files          28       28              
  Lines        7990     8027      +37     
  Branches     1477     1492      +15     
==========================================
+ Hits         6518     6549      +31     
- Misses       1002     1005       +3     
- Partials      470      473       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@margalva
Copy link
Collaborator

@ompat5 can you please add tests for this? Thanks.

@ompat5 ompat5 merged commit 0aa5d92 into main Oct 28, 2025
17 checks passed
@ompat5 ompat5 deleted the feat/params_input_validation branch October 28, 2025 19:12
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.

5 participants