Skip to content

Fix Deployment pipeline to only run on main#10

Closed
Janne6565 wants to merge 15 commits intomainfrom
feature/fix-deployment-pipeline
Closed

Fix Deployment pipeline to only run on main#10
Janne6565 wants to merge 15 commits intomainfrom
feature/fix-deployment-pipeline

Conversation

@Janne6565
Copy link
Copy Markdown
Member

No description provided.

joonjester and others added 15 commits August 29, 2025 21:55
* 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>
Copilot AI review requested due to automatic review settings September 15, 2025 09:02
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.userservice to com.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())
Copy link

Copilot AI Sep 15, 2025

Choose a reason for hiding this comment

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

The code references EXAM_UUID6 but this constant is not defined in the MockValues enum. This will cause a compilation error.

Suggested change
.examId(MockValues.UuidMocks.EXAM_UUID6.getValue())
.examId(MockValues.UuidMocks.EXAM_UUID2.getValue())

Copilot uses AI. Check for mistakes.
.grade(MockValues.FloatMocks.GRADE.getValue())
.build(),
Feedback.builder()
.uuid(MockValues.UuidMocks.GRADE_UUID4.getValue())
Copy link

Copilot AI Sep 15, 2025

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
.grade(MockValues.FloatMocks.GRADE.getValue())
.build(),
Feedback.builder()
.uuid(MockValues.UuidMocks.GRADE_UUID5.getValue())
Copy link

Copilot AI Sep 15, 2025

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
.grade(MockValues.FloatMocks.GRADE.getValue())
.build(),
Feedback.builder()
.uuid(MockValues.UuidMocks.GRADE_UUID6.getValue())
Copy link

Copilot AI Sep 15, 2025

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
.grade(MockValues.FloatMocks.GRADE.getValue())
.build(),
Feedback.builder()
.uuid(MockValues.UuidMocks.GRADE_UUID7.getValue())
Copy link

Copilot AI Sep 15, 2025

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
public List<Exam> getExamsByLecturer(String lecturerUuid) {
if (lecturerUuid == null || lecturerUuid.isBlank()) {
throw new ResponseStatusException(HttpStatus.BAD_REQUEST,
"Lecturer name is required");
Copy link

Copilot AI Sep 15, 2025

Choose a reason for hiding this comment

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

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.

Suggested change
"Lecturer name is required");
"Lecturer UUID is required");

Copilot uses AI. Check for mistakes.
.module("Test Module")
.build();

DummyData.EXAMS = List.of(exam);
Copy link

Copilot AI Sep 15, 2025

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.

@Test
void fetchExamsByLecturerShouldGetExams() {
DummyData.EXAMS = List.of(Exam.builder()
Copy link

Copilot AI Sep 15, 2025

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.

@Test
void fetchExamsByLecturerShouldNotGetExams() {
DummyData.EXAMS = List.of();
Copy link

Copilot AI Sep 15, 2025

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.

import java.time.LocalDate;
import java.util.List;
import org.antlr.v4.runtime.misc.NotNull;
Copy link

Copilot AI Sep 15, 2025

Choose a reason for hiding this comment

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

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.

Suggested change
import org.antlr.v4.runtime.misc.NotNull;
import javax.validation.constraints.NotNull;

Copilot uses AI. Check for mistakes.
@Janne6565 Janne6565 closed this Sep 15, 2025
davidclarafigueiredo pushed a commit that referenced this pull request Oct 17, 2025
* 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
@Janne6565 Janne6565 deleted the feature/fix-deployment-pipeline branch November 14, 2025 13:10
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.

3 participants