Skip to content

Import report items as json#548

Draft
dcansys wants to merge 3 commits into
mainfrom
feat/import-report-items-as-json
Draft

Import report items as json#548
dcansys wants to merge 3 commits into
mainfrom
feat/import-report-items-as-json

Conversation

@dcansys

@dcansys dcansys commented May 19, 2026

Copy link
Copy Markdown
Collaborator

This is implementation of reading, converting and inserting report items through the JSON format.
Items JSON import will load a JSON file, create a default template, and save all report items to ADR.
JSON Schema is in the documentation.

PoC: https://github.com/ansys-internal/adr_mechanical/tree/poc/import-report-items-as-json

Note: more enhanced default template with basic ToC and sections will come in the next iterations.

[Converting To Draft]: After having backlog refinement, it is decided to refactor the PR and come up with one 'BaseModel' pydantic based to replace the other two existing validation models, so it is not only json based. It will be revised again toward the end of the summer.

@dcansys dcansys requested a review from viseshrp as a code owner May 19, 2026 14:54
Copilot AI review requested due to automatic review settings May 19, 2026 14:54
@dcansys dcansys marked this pull request as draft May 19, 2026 14:54
@dcansys dcansys requested a review from margalva May 19, 2026 14:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a JSON import path for serverless ADR report items, backed by shared Pydantic schemas for validating item payloads.

Changes:

  • Adds shared JSON schema models for report items and top-level import payloads.
  • Adds a serverless importer that loads JSON, creates a default layout template, and saves text/table/image/file/scene/tree items.
  • Adds normalization helpers for JSON-style tags and table/tree conversion.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.

File Description
src/ansys/dynamicreporting/core/utils/json_importer_models.py Defines Pydantic models for supported JSON report item payloads.
src/ansys/dynamicreporting/core/serverless/json_importer.py Implements serverless import logic for validated JSON report items.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/ansys/dynamicreporting/core/utils/json_importer_models.py
Comment thread src/ansys/dynamicreporting/core/serverless/json_importer.py Outdated
Comment thread src/ansys/dynamicreporting/core/serverless/json_importer.py Outdated
Comment thread src/ansys/dynamicreporting/core/serverless/json_importer.py Outdated
Comment thread src/ansys/dynamicreporting/core/serverless/json_importer.py
Comment thread src/ansys/dynamicreporting/core/serverless/json_importer.py Outdated
@codecov-commenter

codecov-commenter commented May 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.83568% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.63%. Comparing base (5c61210) to head (9b6354d).

Files with missing lines Patch % Lines
.../dynamicreporting/core/serverless/json_importer.py 94.32% 4 Missing and 4 partials ⚠️
...ynamicreporting/core/utils/json_importer_models.py 95.58% 1 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #548      +/-   ##
==========================================
+ Coverage   82.33%   82.63%   +0.29%     
==========================================
  Files          32       34       +2     
  Lines        8705     8918     +213     
  Branches     1585     1616      +31     
==========================================
+ Hits         7167     7369     +202     
- Misses       1054     1059       +5     
- Partials      484      490       +6     

☔ 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.

@dcansys dcansys force-pushed the feat/import-report-items-as-json branch 14 times, most recently from 28a50b0 to 7ee078b Compare May 21, 2026 12:58
@dcansys dcansys marked this pull request as ready for review May 26, 2026 14:36
@dcansys dcansys force-pushed the feat/import-report-items-as-json branch 3 times, most recently from 358ecd0 to 9b0a2e4 Compare May 29, 2026 14:14
@viseshrp viseshrp requested a review from Copilot May 30, 2026 13:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 9 comments.

Comment thread src/ansys/dynamicreporting/core/serverless/json_importer.py
Comment thread src/ansys/dynamicreporting/core/serverless/json_importer.py
Comment thread src/ansys/dynamicreporting/core/serverless/json_importer.py
Comment thread src/ansys/dynamicreporting/core/serverless/json_importer.py
Comment thread pyproject.toml
Comment thread src/ansys/dynamicreporting/core/serverless/adr.py
Comment thread src/ansys/dynamicreporting/core/serverless/adr.py
Comment thread doc/source/serverless/json_importer.rst
Comment thread doc/source/serverless/json_importer.rst
@dcansys dcansys force-pushed the feat/import-report-items-as-json branch from 2270a46 to f0e2147 Compare June 1, 2026 10:22
@dcansys dcansys force-pushed the feat/import-report-items-as-json branch from f0e2147 to 22aae75 Compare June 1, 2026 11:02
@dcansys dcansys marked this pull request as draft June 2, 2026 14:43
@viseshrp

viseshrp commented Jun 2, 2026

Copy link
Copy Markdown
Collaborator

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