-
Notifications
You must be signed in to change notification settings - Fork 319
Development
: Migrate file URL paths for various entities
#10433
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
Conversation
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
🧹 Nitpick comments (1)
src/test/playwright/support/requests/CourseManagementAPIRequests.ts (1)
107-109
: Fix inconsistent property naming convention.The newly added property
courseIconpath
has inconsistent casing compared to the originalcourseIcon
property. To maintain consistent naming conventions throughout the codebase, consider changing it tocourseIconPath
with a capital 'P'.const json = await response.json(); -json.courseIconpath = addPublicFilePrefix(json.courseIcon); +json.courseIconPath = addPublicFilePrefix(json.courseIcon); return json;
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/test/playwright/support/requests/CourseManagementAPIRequests.ts
(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (7)
- GitHub Check: Call Build Workflow / Build and Push Docker Image
- GitHub Check: Call Build Workflow / Build .war artifact
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: client-tests
- GitHub Check: server-tests
- GitHub Check: client-tests-selected
- GitHub Check: Analyse
🔇 Additional comments (1)
src/test/playwright/support/requests/CourseManagementAPIRequests.ts (1)
12-12
: Good addition of theaddPublicFilePrefix
import.The import of the utility function aligns with the migration goal to update URL paths consistently across the codebase.
src/test/playwright/support/requests/CourseManagementAPIRequests.ts
Outdated
Show resolved
Hide resolved
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: 0
🧹 Nitpick comments (1)
src/main/webapp/app/course/manage/course-management.service.ts (1)
529-538
: Fix typo in method comment and consider checking if courseIcon exists.The implementation correctly adds the public file prefix to the course icon path, but there are two minor issues:
- There's a typo in the comment: "THis" should be "This"
- The method doesn't check if
courseIcon
exists before using it withaddPublicFilePrefix
/** - * THis method adds the public file prefix to the course icon. + * This method adds the public file prefix to the course icon. * @param courseRes */ private processCourseIcon(courseRes: EntityResponseType): EntityResponseType { if (courseRes.body) { - courseRes.body.courseIconPath = addPublicFilePrefix(courseRes.body.courseIcon); + courseRes.body.courseIconPath = courseRes.body.courseIcon ? addPublicFilePrefix(courseRes.body.courseIcon) : undefined; } return courseRes; }
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/main/webapp/app/course/manage/course-management.service.ts
(3 hunks)src/main/webapp/app/course/manage/course-update.component.ts
(4 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- src/main/webapp/app/course/manage/course-update.component.ts
🧰 Additional context used
📓 Path-based instructions (1)
`src/main/webapp/**/*.ts`: angular_style:https://angular.io/...
src/main/webapp/app/course/manage/course-management.service.ts
⏰ Context from checks skipped due to timeout of 90000ms (8)
- GitHub Check: Call Build Workflow / Build .war artifact
- GitHub Check: Call Build Workflow / Build and Push Docker Image
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: client-tests
- GitHub Check: client-tests-selected
- GitHub Check: server-tests
- GitHub Check: server-style
- GitHub Check: Analyse
🔇 Additional comments (2)
src/main/webapp/app/course/manage/course-management.service.ts (2)
31-31
: LGTM - Appropriate import added for file path prefixing.The import of
addPublicFilePrefix
from 'app/app.constants' is correctly added to support the new path processing functionality.
518-518
: LGTM - Good integration into the existing processing pipeline.The new
processCourseIcon
method is now correctly called as part of the standard course entity response processing, ensuring all course icons will have consistent paths.
Do not deploy to test servers because of DB migrations
Checklist
General
Server
Motivation and Context
In #10416, we changed the URL paths to be prefixed by the respective module name.
Since we've adapted the asset paths (that are stored in the DB), existing assets can currently not be loaded after upgrading.
Also, we will remove the API base prefix for files (
/api/core/files
) from the paths stored literally in the database. Instead, the client has to append the prefix.Description
Liquibase Migration that updates the paths for all entities that rely on this URL path. Additionally, includes all paths that need to be adapted.
Steps for Testing
Note
: Needs to be tested locally.https://artemis-test.../api/core/files/testfile.png
. the file doesn't have to exist/api/core/file
-endpoint works fine.Testserver States
You can manage test servers using Helios. Check environment statuses in the environment list. To deploy to a test server, go to the CI/CD page, find your PR or branch, and trigger the deployment.
Review Progress
Code Review
Manual Tests
Summary by CodeRabbit
New Features
Refactor
Bug Fixes