-
Notifications
You must be signed in to change notification settings - Fork 76
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
feat: Add endpoint and service for all data models #14668
Conversation
📝 WalkthroughWalkthroughThis pull request renames several methods and updates service calls to clarify schema file retrieval. It distinguishes between general schema files and application-specific files by introducing a set of new methods and corresponding API endpoints. The changes span controllers, repository classes, service implementations, interfaces, tests, and frontend API paths. Test cases have been updated to match the new naming conventions, ensuring that both JSON and XSD files are correctly handled in different contexts. Changes
Possibly related PRs
Suggested labels
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (9)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
backend/src/Designer/Controllers/DatamodelsController.cs
(2 hunks)backend/src/Designer/Infrastructure/GitRepository/AltinnAppGitRepository.cs
(1 hunks)backend/src/Designer/Services/Implementation/SchemaModelService.cs
(1 hunks)backend/src/Designer/Services/Interfaces/ISchemaModelService.cs
(1 hunks)backend/tests/Designer.Tests/Infrastructure/GitRepository/AltinnAppGitRepositoryTests.cs
(3 hunks)backend/tests/Designer.Tests/Services/SchemaModelServiceTests.cs
(5 hunks)frontend/packages/shared/src/api/paths.js
(1 hunks)frontend/packages/shared/src/api/queries.ts
(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Build environment and run e2e test
- GitHub Check: Testing
🔇 Additional comments (13)
backend/src/Designer/Services/Interfaces/ISchemaModelService.cs (1)
19-24
: LGTM! Clear and descriptive method name.The renaming from
GetSchemaFiles
toGetAllSchemaFiles
improves clarity by explicitly indicating that the method retrieves all schema files within the repository.frontend/packages/shared/src/api/queries.ts (1)
113-114
: LGTM! Consistent with backend changes.The functions have been updated to use the new app-specific paths, maintaining alignment with the backend API changes.
frontend/packages/shared/src/api/paths.js (1)
34-37
: LGTM! Well-structured path definitions.The new path functions follow a consistent naming convention and align with the backend route changes, providing clear separation between all models and app-specific models.
backend/src/Designer/Controllers/DatamodelsController.cs (4)
124-131
: LGTM! Clear method renaming.The method name change from
GetDataModels
toGetAllJsonDataModels
improves clarity by explicitly indicating it retrieves all JSON data models.
142-149
: LGTM! Consistent method renaming.The method name change from
GetXSDDataModels
toGetAllXsdDataModels
maintains consistency with the JSON counterpart.
151-167
: LGTM! Well-structured new endpoint.The new
GetAppJsonDataModels
method follows the established pattern and properly handles app-specific JSON data models.
169-185
: LGTM! Consistent implementation.The new
GetAppXsdDataModels
method maintains consistency with its JSON counterpart and follows the same implementation pattern.backend/tests/Designer.Tests/Services/SchemaModelServiceTests.cs (1)
48-49
: LGTM! Method calls updated consistently.The changes correctly update the method calls from
GetSchemaFiles
toGetAllSchemaFiles
while maintaining the same test logic and assertions.Also applies to: 60-61, 86-87, 98-99, 127-128, 135-136
backend/tests/Designer.Tests/Infrastructure/GitRepository/AltinnAppGitRepositoryTests.cs (2)
392-434
: LGTM! Test methods renamed consistently.The test methods have been appropriately renamed to match the new method names in the repository layer while preserving the test logic and assertions.
436-481
: LGTM! Comprehensive test coverage for new functionality.The new test methods provide thorough coverage for the
GetAppSchemaFiles
functionality, including edge cases and property validation.backend/src/Designer/Services/Implementation/SchemaModelService.cs (1)
83-96
: LGTM! Service layer changes are well-structured.The service layer changes are consistent with the repository layer changes. The methods are well-documented and follow existing patterns.
backend/src/Designer/Infrastructure/GitRepository/AltinnAppGitRepository.cs (2)
980-991
: LGTM! New method follows existing patterns.The new
GetAllSchemaFiles
method is well-documented and efficiently reuses existing functionality for finding and mapping files.
993-1014
: LGTM! Method renamed while preserving functionality.The method has been appropriately renamed to
GetAppSchemaFiles
while maintaining its original functionality and error handling.
backend/src/Designer/Services/Interfaces/ISchemaModelService.cs
Outdated
Show resolved
Hide resolved
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #14668 +/- ##
=======================================
Coverage 95.76% 95.76%
=======================================
Files 1914 1914
Lines 24948 24950 +2
Branches 2858 2858
=======================================
+ Hits 23892 23894 +2
Misses 798 798
Partials 258 258 ☔ View full report in Codecov by Sentry. |
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work, Tested ok!
Description
In PR #14625 we limited the data model lookup to the
App/models
directory. This might be a problem fororg-datamodels
repos, which often have custom folder structures.This PR adds GET endpoints which returns all data models in a repo.
Out of scope:
all-json
andall-xsd
endpoints to query hooks.Verification
Summary by CodeRabbit
Summary by CodeRabbit
New Features
Refactor