Fix Deployment pipeline to only run on main#10
Conversation
* feat: implemented the Users * feat: Implemented the Exam Entity and it's dto * feat: Implemented the Basic Controller and Service * feat: DummyData for development * fix: removed semester from Exam Entity * fix: Added Exceptions and removed semester for Exams and Dto * feat: Added controller test and service test * refactor: changed the count to submissions * fix: changed Indentation * refactor: moved files and adjusted exception * fix: linting * fix: formatting * feat: Added Mocks * fix: fixed Attributes * fix: lint * fix: linting and adjusted the checkstyle * fix: linting * fix: magic number * fix:import layout in editor config * fix: added newline and changed controller and service. * fix: go rid of jakarta * fix: change controller and service and imports * fix: imports and config for imports * fix: got rid of the mapping and added uuid.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* implement cors config * refactor: added ExamType * feat: get Grade and Exam Data * fix: simplified the service and controller * test: implemented * fix: Got rid of the gitkeep * fix: Adjusted the mocks to be more clear * fix: testing * fix: changed day of the date * refactor: changed the locations of the funktions * refactor: split lecturer service,controller and test * chore: added more types and clean up * fix: got rid of achievedPoints * fix: added Grade * refactor: renaming * adjust gitignore * implement submissions and feedback retrieval for lecturers * filter exams by lecturerUuid, adjust API endpoints and update test cases * add submission controller and service tests; refactor lecturer field to lecturerUuid in exam entity and update related logic * refactor services and test methods for improved readability; adjust formatting in controller and related classes * fix: linting --------- Co-authored-by: Janne <jabbekeipert@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull Request Overview
This PR transforms the codebase from a generic user service to a specialized lecturer service for an exam grading system. The change involves extensive refactoring of package names, application structure, and implementation of domain-specific functionality.
- Complete package rename from
com.ase.userservicetocom.ase.lecturerservice - Implementation of lecturer-specific services for exams, submissions, and feedback management
- Addition of comprehensive test coverage and deployment infrastructure
Reviewed Changes
Copilot reviewed 42 out of 48 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
src/main/java/com/ase/lecturerservice/Application.java |
Updated main application class with new package structure |
src/main/java/com/ase/lecturerservice/services/* |
Added core business logic services for exam, submission, and feedback management |
src/main/java/com/ase/lecturerservice/controllers/* |
Implemented REST API controllers for lecturer service endpoints |
src/main/java/com/ase/lecturerservice/entities/* |
Added domain entities for exams, submissions, feedback, and users |
src/test/java/com/ase/lecturerservice/* |
Comprehensive test suite covering services and controllers |
k8s/* |
Kubernetes deployment configuration for grading service |
.github/workflows/* |
CI/CD pipeline setup for testing and deployment |
pom.xml |
Updated dependencies and build configuration |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| .build(), | ||
| Submission.builder() | ||
| .studentId(MockValues.UuidMocks.STUDENT_UUID.getValue()) | ||
| .examId(MockValues.UuidMocks.EXAM_UUID6.getValue()) |
There was a problem hiding this comment.
The code references EXAM_UUID6 but this constant is not defined in the MockValues enum. This will cause a compilation error.
| .examId(MockValues.UuidMocks.EXAM_UUID6.getValue()) | |
| .examId(MockValues.UuidMocks.EXAM_UUID2.getValue()) |
| .grade(MockValues.FloatMocks.GRADE.getValue()) | ||
| .build(), | ||
| Feedback.builder() | ||
| .uuid(MockValues.UuidMocks.GRADE_UUID4.getValue()) |
There was a problem hiding this comment.
The code references GRADE_UUID4, GRADE_UUID5, GRADE_UUID6, and GRADE_UUID7 but these constants are not defined in the MockValues enum. This will cause compilation errors.
| .grade(MockValues.FloatMocks.GRADE.getValue()) | ||
| .build(), | ||
| Feedback.builder() | ||
| .uuid(MockValues.UuidMocks.GRADE_UUID5.getValue()) |
There was a problem hiding this comment.
The code references GRADE_UUID4, GRADE_UUID5, GRADE_UUID6, and GRADE_UUID7 but these constants are not defined in the MockValues enum. This will cause compilation errors.
| .grade(MockValues.FloatMocks.GRADE.getValue()) | ||
| .build(), | ||
| Feedback.builder() | ||
| .uuid(MockValues.UuidMocks.GRADE_UUID6.getValue()) |
There was a problem hiding this comment.
The code references GRADE_UUID4, GRADE_UUID5, GRADE_UUID6, and GRADE_UUID7 but these constants are not defined in the MockValues enum. This will cause compilation errors.
| .grade(MockValues.FloatMocks.GRADE.getValue()) | ||
| .build(), | ||
| Feedback.builder() | ||
| .uuid(MockValues.UuidMocks.GRADE_UUID7.getValue()) |
There was a problem hiding this comment.
The code references GRADE_UUID4, GRADE_UUID5, GRADE_UUID6, and GRADE_UUID7 but these constants are not defined in the MockValues enum. This will cause compilation errors.
| public List<Exam> getExamsByLecturer(String lecturerUuid) { | ||
| if (lecturerUuid == null || lecturerUuid.isBlank()) { | ||
| throw new ResponseStatusException(HttpStatus.BAD_REQUEST, | ||
| "Lecturer name is required"); |
There was a problem hiding this comment.
The error message says 'Lecturer name is required' but the parameter is actually 'lecturerUuid'. The message should be 'Lecturer UUID is required' to accurately reflect what is being validated.
| "Lecturer name is required"); | |
| "Lecturer UUID is required"); |
| .module("Test Module") | ||
| .build(); | ||
|
|
||
| DummyData.EXAMS = List.of(exam); |
There was a problem hiding this comment.
Modifying static data in tests can cause test pollution and make tests dependent on execution order. Consider using @DirtiesContext or mocking the data source instead of directly modifying static fields.
|
|
||
| @Test | ||
| void fetchExamsByLecturerShouldGetExams() { | ||
| DummyData.EXAMS = List.of(Exam.builder() |
There was a problem hiding this comment.
Modifying static data in tests can cause test pollution and make tests dependent on execution order. Consider using @DirtiesContext or mocking the data source instead of directly modifying static fields.
|
|
||
| @Test | ||
| void fetchExamsByLecturerShouldNotGetExams() { | ||
| DummyData.EXAMS = List.of(); |
There was a problem hiding this comment.
Modifying static data in tests can cause test pollution and make tests dependent on execution order. Consider using @DirtiesContext or mocking the data source instead of directly modifying static fields.
|
|
||
| import java.time.LocalDate; | ||
| import java.util.List; | ||
| import org.antlr.v4.runtime.misc.NotNull; |
There was a problem hiding this comment.
Using @NotNull from ANTLR runtime is incorrect. This should be either @javax.validation.constraints.NotNull for validation or @org.jetbrains.annotations.NotNull for static analysis.
| import org.antlr.v4.runtime.misc.NotNull; | |
| import javax.validation.constraints.NotNull; |
* Fixed:API Endpoint & Code Quality * Delete Log * Delete Log * Delete Log * Delete Log * Deleted @operation annotation * Changed Notification Columns Added separation logic in "NotificationController" * Deleted imports * Deleted imports * Added RootController Pack Patched missing arguments for notificationType in Controller and DTO * Changed notificationtype to enum * Changed notificationtype to enum
No description provided.