Skip to content

[ASE-000] Automatically Deploy Backend #4

Closed
Janne6565 wants to merge 12 commits intomainfrom
deployment
Closed

[ASE-000] Automatically Deploy Backend #4
Janne6565 wants to merge 12 commits intomainfrom
deployment

Conversation

@Janne6565
Copy link
Copy Markdown
Member

This pull request introduces significant improvements to the project’s build, deployment, and service architecture. It adds full Kubernetes support for deployment, sets up CI/CD pipelines with GitHub Actions, migrates the application to a new lecturer-focused domain, and improves code style and build configuration.

Kubernetes & Deployment Integration

  • Added Kubernetes manifests for deployment (k8s/deployment.yaml), service exposure (k8s/service.yaml), ingress routing (k8s/ingress.yaml), and kustomization (k8s/kustomization.yaml), enabling containerized deployment and secure HTTPS ingress. [1] [2] [3] [4]
  • Introduced a multi-stage Dockerfile for efficient building and running of the Spring Boot application as a non-root user.

CI/CD Automation

  • Added GitHub Actions workflow for continuous integration testing across Java 21 and 22, including artifact uploads for test reports.
  • Added a deployment workflow to automate building, publishing, and deploying Docker images to Kubernetes on every push.

Project Refactoring & Domain Migration

  • Renamed package and main class from userservice to lecturerservice, reflecting the new domain focus. [1] [2]
  • Added new controller (LecturerController) and DTO (ExamDto) for lecturer-specific endpoints and data transfer. [1] [2]
  • Introduced a shared BaseController interface for consistent API versioning.

Build & Dependency Updates

  • Added Spring Boot Actuator for health endpoints and configured the Maven build for Spring Boot packaging and deployment. [1] [2]

Code Style & Quality Improvements

  • Increased maximum line length to 100 characters and relaxed strict condition enforcement in checkstyle.xml for more flexible code formatting. [1] [2]
  • Updated .editorconfig to improve import layout for Java files.

Let me know if you want to dive deeper into any of these areas or see how the new deployment and CI/CD pipelines work!

Currently still missing:
Deploy only if tests succeed

joonjester and others added 6 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.
@Janne6565 Janne6565 self-assigned this Aug 30, 2025
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 pull request transforms the project from a user service to a lecturer service, adding comprehensive deployment infrastructure and CI/CD automation. The changes include Kubernetes manifests for containerized deployment, GitHub Actions workflows for testing and deployment, and a complete domain migration to lecturer-focused functionality.

  • Migrated from user service to lecturer service with new domain entities and controllers
  • Added Kubernetes deployment infrastructure with service, ingress, and configuration manifests
  • Implemented CI/CD pipelines with GitHub Actions for testing and automated deployment

Reviewed Changes

Copilot reviewed 29 out of 38 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/main/java/com/ase/lecturerservice/ Package renamed and new lecturer domain entities, services, and controllers added
src/test/java/com/ase/lecturerservice/ Comprehensive test suite for lecturer service functionality
k8s/ Kubernetes deployment manifests for service, ingress, and deployment configuration
.github/workflows/ CI/CD workflows for testing and automated deployment
pom.xml Dependencies updated with Spring Boot Actuator and Maven build configuration
Dockerfile Multi-stage Docker build for containerized deployment

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +25 to +26
throw new ResponseStatusException(HttpStatus.BAD_REQUEST,
"Lecturer name is required");
Copy link

Copilot AI Aug 30, 2025

Choose a reason for hiding this comment

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

The error message 'Lecturer name is required' doesn't match the validation logic which checks for null or blank. Consider using 'Lecturer cannot be empty' to match the test expectation.

Suggested change
throw new ResponseStatusException(HttpStatus.BAD_REQUEST,
"Lecturer name is required");
"Lecturer cannot be empty");

Copilot uses AI. Check for mistakes.
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import com.ase.lecturerservice.MockValues;
Copy link

Copilot AI Aug 30, 2025

Choose a reason for hiding this comment

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

There are two different MockValues classes being imported - one from the test package and one from the main package. This creates confusion and potential for using the wrong class.

Suggested change
import com.ase.lecturerservice.MockValues;
import com.ase.lecturerservice.test.MockValues;

Copilot uses AI. Check for mistakes.
Janne6565 and others added 5 commits August 30, 2025 19:05
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>
@Janne6565 Janne6565 closed this Sep 15, 2025
davidclarafigueiredo pushed a commit that referenced this pull request Oct 17, 2025
* change indendation

* try to fix errors

* again

* next try

* Lets try it this way

* magic number

* next

* next

* next

* next

* next

* next

* next

* test checkstyle

* next

* next

* nextz

* temporary skip of Workflow
@joonjester joonjester deleted the deployment branch October 30, 2025 07:27
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