-
Notifications
You must be signed in to change notification settings - Fork 2
Implement configurable filter pipeline (global + per‑route filters) #11
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
The head ref may contain hidden characters: "Implement-Configurable-Filter-Pipeline-(Global-+-Per\u2011Route-Filters)"
Changes from all commits
98b40a1
c1b5f70
bf4d977
148411e
9ac7b57
875d1ef
9289c7d
6bdb1ef
781e34a
511b5ee
aaeba6d
524f33c
b9382a3
7d55536
e712b08
b8a9754
114bd2e
b40a4d1
a9a12bf
9bc1eed
afbe07f
8cc69d8
c0e3de6
aba21a5
9334691
89c5ddf
c78610c
bcb828c
61c3be0
945d32b
3128ac7
d4e7481
5c80eaa
fcdcadb
f6dc32e
afa9373
6950c14
78f7e21
86f2ba7
3e3a217
103178a
e72f073
ff4cd12
7652687
d6f1d26
27e627c
db0c574
b7154fa
fa1599a
032d91d
abed9f6
6de96b2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| name: Java CI with Maven | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ "main" ] | ||
| pull_request: | ||
| branches: [ "main" ] | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Get Java Version | ||
| run: | | ||
| JAVA_VERSION=$(mvn help:evaluate "-Dexpression=maven.compiler.release" -q -DforceStdout) | ||
| echo "JAVA_VERSION=$JAVA_VERSION" >> $GITHUB_ENV | ||
|
|
||
| - name: Set up JDK ${{ env.JAVA_VERSION }} | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| java-version: ${{ env.JAVA_VERSION }} | ||
| distribution: 'temurin' | ||
| cache: maven | ||
|
|
||
| - name: Compile with Maven | ||
| run: mvn -B compile --file pom.xml | ||
|
|
||
| - name: Test with Maven | ||
| run: mvn -B test --file pom.xml | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| name: Publish Docker Image to Github Packages on Release | ||
| on: | ||
| release: | ||
| types: | ||
| - published | ||
| jobs: | ||
| publish: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| packages: write | ||
| steps: | ||
| - uses: actions/checkout@v6.0.2 | ||
| - uses: docker/setup-qemu-action@v3.7.0 | ||
| - uses: docker/setup-buildx-action@v3.12.0 | ||
| - name: Log in to GHCR | ||
| uses: docker/login-action@v3.7.0 | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
| - name: Extract metadata | ||
| id: meta | ||
| uses: docker/metadata-action@v5.10.0 | ||
| with: | ||
| images: ghcr.io/ithsjava25/webserver | ||
| - name: Build and push | ||
| uses: docker/build-push-action@v6.18.0 | ||
| with: | ||
| context: . | ||
| push: true | ||
| platforms: linux/amd64, linux/arm64 | ||
| tags: ${{ steps.meta.outputs.tags }} | ||
| labels: ${{ steps.meta.outputs.labels }} | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| FROM maven:3-eclipse-temurin-25-alpine AS build | ||
| WORKDIR /build | ||
| COPY src/ src/ | ||
| COPY pom.xml pom.xml | ||
| RUN mvn compile | ||
|
Comment on lines
+1
to
+5
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Runtime dependencies are missing from the final image.
Additionally, the Consider using Proposed sketch (dependency-copy approach) FROM maven:3-eclipse-temurin-25-alpine AS build
WORKDIR /build
COPY src/ src/
COPY pom.xml pom.xml
-RUN mvn compile
+COPY www/ www/
+RUN mvn dependency:copy-dependencies -DoutputDirectory=target/libs && mvn compile
FROM eclipse-temurin:25-jre-alpine
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
-COPY --from=build /build/target/classes/ /app/
-ENTRYPOINT ["java", "-classpath", "/app", "org.example.App"]
USER appuser
+COPY --from=build /build/target/classes/ /app/classes/
+COPY --from=build /build/target/libs/ /app/libs/
+COPY --from=build /build/www/ /app/www/
+ENTRYPOINT ["java", "-classpath", "/app/classes:/app/libs/*", "org.example.App"]🤖 Prompt for AI Agents |
||
| RUN mvn dependency:copy-dependencies -DincludeScope=compile | ||
|
|
||
| FROM eclipse-temurin:25-jre-alpine | ||
| EXPOSE 8080 | ||
| RUN addgroup -S appgroup && adduser -S appuser -G appgroup | ||
| WORKDIR /app/ | ||
| COPY --from=build /build/target/classes/ /app/ | ||
| COPY --from=build /build/target/dependency/ /app/dependencies/ | ||
| COPY www/ ./www/ | ||
| USER appuser | ||
| ENTRYPOINT ["java", "-classpath", "/app:/app/dependencies/*", "org.example.App"] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| # Konfiguration: port (CLI → config-fil → default) | ||
|
|
||
| Det här projektet väljer vilken port servern ska starta på enligt följande prioritet: | ||
|
|
||
| 1. **CLI-argument** (`--port <port>`) – högst prioritet | ||
| 2. **Config-fil** (`application.yml`: `server.port`) | ||
| 3. **Default** (`8080`) – används om port saknas i config eller om config-filen saknas | ||
|
|
||
| --- | ||
|
|
||
| ## 1) Default-värde | ||
|
|
||
| Om varken CLI eller config anger port används: | ||
|
|
||
| - **8080** (default för `server.port` i `AppConfig`) | ||
|
|
||
| --- | ||
|
|
||
| ## 2) Config-fil: `application.yml` | ||
|
|
||
| ### Var ska filen ligga? | ||
| Standard: | ||
| - `src/main/resources/application.yml` | ||
|
|
||
| ### Exempel | ||
| ```yaml | ||
| server: | ||
| port: 9090 | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## 3) CLI-argument | ||
|
|
||
| CLI kan användas för att override:a config: | ||
|
|
||
| ```bash | ||
| java -cp target/classes org.example.App --port 8000 | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## 4) Sammanfattning | ||
|
|
||
| Prioritet: | ||
|
|
||
| 1. CLI (`--port`) | ||
| 2. `application.yml` (`server.port`) | ||
| 3. Default (`8080`) |
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.
Spotless format check is not enforced in CI.
The
spotless-maven-plugincheck is bound to theverifyphase inpom.xml, but CI only runscompileandtest. Formatting violations will go undetected. Either add a separatemvn spotless:checkstep or change the test step to runmvn -B verify.Proposed fix: add a Spotless check step
- name: Test with Maven run: mvn -B test --file pom.xml + + - name: Check formatting with Spotless + run: mvn -B spotless:check --file pom.xml📝 Committable suggestion
🤖 Prompt for AI Agents