Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
36f2dcd
Merge branch 'refactor/api-contract' into develop
enzobbom Jun 18, 2026
b50bd5d
Merge branch 'master' into develop
enzobbom Jun 18, 2026
f8080b8
Prepare structure for (local) RabbitMQ
enzobbom Jun 22, 2026
069279b
Implement minimum working flow with RabbitMQ, including migrating Cro…
enzobbom Jun 26, 2026
9a6089e
Clean up: remove end points not used anymore
enzobbom Jun 26, 2026
94434f6
Clean up: remove exceptions not used anymore
enzobbom Jun 26, 2026
8f6b2ad
Adjust names (and NotificationCompleted flow) based on changes in the…
enzobbom Jul 3, 2026
e719d3e
Adapt packages structure to adapters/ports to better support differen…
enzobbom Jul 3, 2026
d97a0d6
Add some missing output port interfaces, adjust some Spring stereotyp…
enzobbom Jul 3, 2026
19265da
Change NotifcationStatus for when failure is retryable
enzobbom Jul 4, 2026
e9b0d61
Add RabbitListener to NotificationFailed event and adjust Service acc…
enzobbom Jul 4, 2026
8ad7189
Fully working RabbitMQ messaging flow
enzobbom Jul 4, 2026
c4f5fb1
Change creation of event to use its 'create' static method (which int…
enzobbom Jul 8, 2026
3ef045b
Move translation of RabbitMQ events from service to RabbitMQ Publishe…
enzobbom Jul 9, 2026
6eadcf8
WIP: introduce input validation to RabbitMQ listener and a Recoverer …
enzobbom Jul 10, 2026
51224c4
Adjustments regarding reorganization of packages/names and introducti…
enzobbom Jul 10, 2026
d6e1f1b
Update AMQP dependency version to fix NullPointerException for header…
enzobbom Jul 10, 2026
b259784
Remove RabbitMQ resources creation (moved to infra repo) and add env …
enzobbom Jul 13, 2026
117b4a7
Adjustments to use ts:events library published on JitPack
enzobbom Jul 14, 2026
bc43589
Small clean up
enzobbom Jul 14, 2026
2e77434
Add version to the API
enzobbom Jul 15, 2026
bdd8eb4
Replace usage API Response objects by new shared api-contract library
enzobbom Jul 16, 2026
5de9142
Add indexes to Task fields for better read performance
enzobbom Jul 16, 2026
75692f7
Make method that retrieves Tasks by period also filter by Notificatio…
enzobbom Jul 16, 2026
3e1d3b1
Remove @Transactional from update method as it deals with a single co…
enzobbom Jul 16, 2026
eafe15b
Move Data class from domain to application layer and turn ResponseDTO…
enzobbom Jul 17, 2026
7ab042e
Change RequestParam by PathVariable in delete/update end points for b…
enzobbom Jul 17, 2026
e2376e3
Small fix in PathVariable syntax
enzobbom Jul 17, 2026
4dfce09
Fix Task update logic ('save' was not being called after object update)
enzobbom Jul 20, 2026
d2eb6c1
Change Task.description() attribute update logic to: remains unchange…
enzobbom Jul 21, 2026
7b1f2e9
Make AuthenticationEntryPoint also return ErrorResponse
enzobbom Jul 23, 2026
283cf81
Define DTO types in SuccessResponse objects returned by end points fo…
enzobbom Jul 23, 2026
a061d0c
Add Swagger documentation to REST Controller
enzobbom Jul 23, 2026
5f05d33
Fix missing path variable in PATCH end point and change GET end point…
enzobbom Jul 23, 2026
7612156
Add missing configuration to add 'Authorize' button in swagger
enzobbom Jul 23, 2026
d8e148f
Refactor security so there is no more user credentials authentication…
enzobbom Jul 26, 2026
af37e89
Remove now unnecessary Feign dependency and implementations (call to …
enzobbom Jul 26, 2026
8ef3423
Introduce userId to Task entity
enzobbom Jul 26, 2026
441ef42
Make 'getTasks()' method use userId instead of userEmail (for cases w…
enzobbom Jul 26, 2026
658e778
Adjustmets for proper Gateway routing of Swagger end points
enzobbom Jul 29, 2026
d3e5035
Fix MongoConfig Bean dependency injection and add uuid-representation…
enzobbom Jul 30, 2026
4bc5950
Clean up and organize application properties
enzobbom Jul 31, 2026
c29d82a
Final application properties refactor before first deploy
enzobbom Jul 31, 2026
96db541
Rename service to 'task'
enzobbom Aug 2, 2026
2a67798
Rename env var
enzobbom Aug 2, 2026
95f5d2f
Missing change regarding service rename
enzobbom Aug 2, 2026
bf6afbd
Rename Task model Document name to plural (as it's actually the name …
enzobbom Aug 2, 2026
7a73ba3
(Hopefully) last renaming change
enzobbom Aug 2, 2026
95d4b06
Build and docker adjustments
enzobbom Aug 2, 2026
8746b25
Adjust build.gradle version, permit all actuator health check end poi…
enzobbom Aug 4, 2026
882d4cb
Final env vars adjustments
enzobbom Aug 5, 2026
d74a0c1
Change name of SpringBootApplication class
enzobbom Aug 5, 2026
0c9e800
Introduce docker-publish GH workflow to build Docker image, publish t…
enzobbom Aug 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.gradle
build
out
.idea
.git
*.iml
docker-compose*.yml
README.md
9 changes: 0 additions & 9 deletions .env.example

This file was deleted.

81 changes: 81 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Build and Publish Docker Image

on:
push:
branches:
- master

permissions:
contents: read
packages: write

jobs:
build-publish:
runs-on: ubuntu-latest

outputs:
image_tag: ${{ steps.meta.outputs.sha_tag }}

steps:
- name: Checkout
uses: actions/checkout@v7

- name: Set up Java 17
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 17
cache: gradle

- name: Grant execute permission for Gradle
run: chmod +x gradlew

- name: Run tests
run: ./gradlew test

- name: Set image metadata
id: meta
run: |
SHORT_SHA=${GITHUB_SHA::7}
echo "sha_tag=sha-${SHORT_SHA}" >> $GITHUB_OUTPUT
echo "short_sha=${SHORT_SHA}" >> $GITHUB_OUTPUT

- name: Log in to GHCR
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4

- name: Build and push multi-arch image
uses: docker/build-push-action@v7
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/enzobbom/ts-task:master
ghcr.io/enzobbom/ts-task:${{ steps.meta.outputs.sha_tag }}
labels: |
org.opencontainers.image.source=https://github.com/enzobbom/ts-task
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.created=${{ github.event.head_commit.timestamp }}
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Trigger ts-system
env:
GH_TOKEN: ${{ secrets.TS_SYSTEM_PAT }}
IMAGE_TAG: ${{ steps.meta.outputs.sha_tag }}
run: |
curl -X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${GH_TOKEN}" \
https://api.github.com/repos/enzobbom/ts-system/dispatches \
-d "$(jq -n \
--arg service "task" \
--arg tag "${IMAGE_TAG}" \
'{event_type:"update-image",client_payload:{service:$service,tag:$tag}}')"
41 changes: 0 additions & 41 deletions .github/workflows/gradle.yml

This file was deleted.

34 changes: 34 additions & 0 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: PR Check

on:
pull_request:
branches:
- master
types:
- opened
- synchronize
- reopened

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v7

- name: Set up JDK 17
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: '17'
cache: gradle

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build with Gradle
run: ./gradlew build
46 changes: 31 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,37 @@
# Basic Docker file
#FROM eclipse-temurin:17-jdk-jammy
#WORKDIR /app
#COPY build/libs/task-scheduler-0.0.1-SNAPSHOT.jar /app/task-scheduler.jar
#EXPOSE 8081
#CMD ["java", "-jar", "/app/task-scheduler.jar"]

# Build
### Build stage

# creates a build image stage with Gradle and JDK
FROM gradle:jdk17 AS build

# sets the working directory inside the image stage
WORKDIR /app
COPY . .

# Run .jar
RUN gradle build --no-daemon
FROM eclipse-temurin:17-jdk-jammy
# copies build files and Gradle wrapper to the image stage
COPY build.gradle settings.gradle gradlew ./
COPY gradle gradle

# downloads dependencies and caches them in a Docker image layer
RUN ./gradlew dependencies --no-daemon || true

# copies source code to the image stage
COPY src src

# runs a temporary build container, builds the executable .jar, and saves the generated files as a new image layer
RUN ./gradlew bootJar --no-daemon

### Runtime stage

# creates a smaller runtime image stage with only the JRE
FROM eclipse-temurin:17-jre-jammy

# sets the working directory inside the runtime image
WORKDIR /app
COPY --from=build /app/build/libs/*.jar /app/task-scheduler.jar
EXPOSE 8081
CMD ["java", "-jar", "/app/task-scheduler.jar"]

# copies the built .jar file from the build stage into the runtime image
COPY --from=build /app/build/libs/*.jar ts-task.jar

# documents the port the application container listens on
EXPOSE 8080

# defines the command executed when the application container starts
ENTRYPOINT ["java", "-jar", "/app/ts-task.jar"]
31 changes: 17 additions & 14 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
plugins {
id 'java'
id 'org.springframework.boot' version '4.0.0'
id 'org.springframework.boot' version '4.0.1'
id 'io.spring.dependency-management' version '1.1.7'
id "org.sonarqube" version "7.2.3.7755"
id 'org.sonarqube' version '7.2.3.7755'
}

group = 'com.javanauta.ts'
version = '0.0.1-SNAPSHOT'
description = 'Task Scheduler - Task scheduler module'
version = '1.0.0-SNAPSHOT'
description = 'Task Scheduler - Task module'

java {
toolchain {
Expand All @@ -21,25 +21,24 @@ configurations {
}
}

repositories {
mavenCentral()
}

ext {
set('springCloudVersion', "2025.1.0")
set('springCloudVersion', '2025.1.0')
}

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-mongodb'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-webmvc'
implementation 'org.springframework.boot:spring-boot-starter-actuator:4.0.0'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.cloud:spring-cloud-starter-openfeign'
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:3.0.3'
implementation 'io.jsonwebtoken:jjwt-api:0.13.0'
implementation 'org.mapstruct:mapstruct:1.6.3'
implementation 'org.mapstruct:mapstruct-processor:1.6.3'
implementation 'com.fasterxml.jackson.core:jackson-databind'
implementation 'org.springframework.boot:spring-boot-starter-amqp'
implementation 'com.github.enzobbom:ts-events:v1.0.0'
implementation 'com.github.enzobbom:ts-api-contract:v1.1.0'

compileOnly 'org.projectlombok:lombok'

Expand All @@ -62,14 +61,18 @@ dependencyManagement {
}
}

tasks.named('jar') {
enabled = false
}

tasks.named('test') {
useJUnitPlatform()
}

sonarqube {
properties {
property "sonar.projectKey", "task-scheduler"
property "sonar.host.url", "http://localhost:9000"
property "sonar.login", "squ_dc76e8eeb6ed2d1dfc066db1af123d8dde47f3f6"
property 'sonar.projectKey', 'task'
property 'sonar.host.url', 'http://localhost:9000'
property 'sonar.login', 'squ_dc76e8eeb6ed2d1dfc066db1af123d8dde47f3f6'
}
}
18 changes: 17 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1,17 @@
rootProject.name = 'task-scheduler'
rootProject.name = 'task'

dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)

repositories {
mavenCentral()

maven {
url = uri("https://jitpack.io")

content {
includeGroup("com.github.enzobbom")
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
package com.javanauta.ts.taskscheduler;

import org.springframework.amqp.rabbit.annotation.EnableRabbit;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.mongodb.autoconfigure.MongoAutoConfiguration;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.scheduling.annotation.EnableScheduling;

@SpringBootApplication(exclude = MongoAutoConfiguration.class)
@EnableFeignClients
public class TaskSchedulerApplication {
@EnableScheduling
@EnableRabbit
public class TaskApplication {
public static void main(String[] args) {
SpringApplication.run(TaskSchedulerApplication.class, args);
SpringApplication.run(TaskApplication.class, args);
}
}
Loading