Skip to content

Commit 12fbde1

Browse files
authored
Merge pull request #1279 from softwaremill/generate-openapi-spec
Generate OpenAPI spec during compile
2 parents d96b1f8 + 9289c0e commit 12fbde1

File tree

89 files changed

+5633
-5573
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+5633
-5573
lines changed

.github/workflows/bootzooka-ci.yml

Lines changed: 26 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -11,33 +11,33 @@ on:
1111
release:
1212
types:
1313
- released
14-
paths-ignore:
15-
- "helm/**"
1614

1715
jobs:
1816
verify:
19-
runs-on: ubuntu-22.04
17+
runs-on: ubuntu-24.04
2018

2119
steps:
2220
- name: Check-out repository
2321
id: repo-checkout
24-
uses: actions/checkout@v2
22+
uses: actions/checkout@v4
2523

26-
- name: Set up JDK 21
27-
id: jdk-setup
28-
uses: actions/setup-java@v1
24+
- name: Set up JDK
25+
uses: actions/setup-java@v4
2926
with:
30-
java-version: 21
27+
distribution: 'zulu'
28+
java-version: '21'
29+
cache: 'sbt'
3130

32-
- name: Cache SBT
33-
id: cache-sbt
34-
uses: actions/cache@v2
31+
- uses: sbt/setup-sbt@v1
32+
33+
- name: Set up Node.js
34+
uses: actions/setup-node@v4
3535
with:
36-
path: |
37-
~/.sbt
38-
~/.ivy2/cache
39-
~/.coursier
40-
key: ${{ runner.os }}-sbt-${{ hashFiles('**/build.sbt') }}
36+
node-version: 22
37+
38+
- name: Generate OpenAPI Spec
39+
id: generate-openapi-spec
40+
run: sbt "backend/generateOpenAPIDescription"
4141

4242
- name: Run tests
4343
id: run-tests
@@ -51,38 +51,31 @@ jobs:
5151
deploy:
5252
if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/v')
5353
needs: [ verify ]
54-
runs-on: ubuntu-latest
54+
runs-on: ubuntu-24.04
5555

5656
steps:
5757
- name: Check-out repository
5858
id: repo-checkout
59-
uses: actions/checkout@v2
59+
uses: actions/checkout@v4
6060

61-
- name: Set up JDK 21
62-
id: jdk-setup
63-
uses: actions/setup-java@v1
61+
- name: Set up JDK
62+
uses: actions/setup-java@v4
6463
with:
65-
java-version: 21
66-
67-
- name: Cache SBT
68-
id: cache-sbt
69-
uses: actions/cache@v2
70-
with:
71-
path: |
72-
~/.sbt
73-
~/.ivy2/cache
74-
~/.coursier
75-
key: ${{ runner.os }}-sbt-${{ hashFiles('**/build.sbt') }}
64+
distribution: 'zulu'
65+
java-version: '21'
66+
cache: 'sbt'
7667

7768
- name: Login to DockerHub
7869
uses: docker/login-action@v1
7970
with:
8071
username: ${{ secrets.DOCKERHUB_USERNAME }}
8172
password: ${{ secrets.DOCKERHUB_TOKEN }}
73+
8274
- name: Extract version
8375
run: |
8476
version=${GITHUB_REF/refs\/tags\/v/}
8577
echo "VERSION=$version" >> $GITHUB_ENV
78+
8679
- name: Publish release notes
8780
uses: release-drafter/release-drafter@v5
8881
with:
@@ -93,5 +86,6 @@ jobs:
9386
version: "v${{ env.VERSION }}"
9487
env:
9588
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
89+
9690
- name: Publish docker image
9791
run: sbt backend/docker:publish

.github/workflows/bootzooka-helm-ci.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ on:
1515
jobs:
1616
lint-chart:
1717
name: Lint Helm Chart
18-
runs-on: ubuntu-22.04
18+
runs-on: ubuntu-24.04
1919
steps:
2020
- name: Check-out repository
2121
id: repo-checkout
@@ -34,7 +34,7 @@ jobs:
3434
needs:
3535
- lint-chart
3636
name: Install & Test Helm Chart
37-
runs-on: ubuntu-22.04
37+
runs-on: ubuntu-24.04
3838
strategy:
3939
matrix:
4040
k8s:
@@ -67,7 +67,7 @@ jobs:
6767
- lint-chart
6868
- install-test-chart
6969
name: Validate Helm Chart Docs
70-
runs-on: ubuntu-22.04
70+
runs-on: ubuntu-24.04
7171
steps:
7272
- name: Check-out repository
7373
id: repo-checkout
@@ -91,7 +91,7 @@ jobs:
9191
- install-test-chart
9292
- validate-chart-docs
9393
name: Publish Helm Chart
94-
runs-on: ubuntu-22.04
94+
runs-on: ubuntu-24.04
9595
steps:
9696
- name: Check-out repository
9797
id: repo-checkout

.github/workflows/scala-steward.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88

99
jobs:
1010
scala-steward:
11-
runs-on: ubuntu-22.04
11+
runs-on: ubuntu-24.04
1212
steps:
1313
- name: Checkout
1414
uses: actions/checkout@v3

.gitignore

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,44 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
node_modules
5+
.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# production
12+
build
13+
target
14+
15+
# misc
16+
.DS_Store
17+
.env.local
18+
.env.development.local
19+
.env.test.local
20+
.env.production.local
21+
ui/.env
22+
23+
npm-debug.log*
24+
yarn-debug.log*
25+
yarn-error.log*
26+
27+
*.log
28+
work.txt
29+
30+
# generated code
31+
/ui/src/api-client/openapi.d.ts
32+
33+
# IDE
134
*.iml
235
*.ipr
336
*.iws
437
.idea/
5-
target/
6-
*.log
7-
.DS_Store
8-
data/
938
*.bloop
1039
*.metals
40+
.vscode
41+
metals.sbt
1142
.bsp
1243

1344
metals.sbt

.scala-steward.conf

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +0,0 @@
1-
updates.ignore = [
2-
{groupId = "org.scala-lang", artifactId = "scala-compiler", version = "2.12."},
3-
{groupId = "org.scala-lang", artifactId = "scala-compiler", version = "2.13."},
4-
{groupId = "org.scala-lang", artifactId = "scala-compiler", version = "3."}
5-
]

.scalafix.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
OrganizeImports.groupedImports = AggressiveMerge
2+
OrganizeImports.targetDialect = Scala3

README.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,15 @@
66

77
## Quick start
88

9+
### Using Docker compose
10+
11+
The fastest way to experiment with Bootzooka is using the provided Docker compose setup. It starts three images:
12+
Bootzooka itself (either locally built or downloaded), PostgreSQL server and Graphana LGTM for observability.
13+
914
### Backend: PostgreSQL & API
1015

11-
In order to run Bootzooka, you'll need a running instance of PostgreSQL with a `bootzooka` database. You can spin
12-
up one easily using docker:
16+
To run Bootzooka's backend locally, you'll still need a running instance of PostgreSQL with a `bootzooka` database.
17+
You can spin up one easily using docker:
1318

1419
```sh
1520
# use "bootzooka" as a password
@@ -19,10 +24,12 @@ docker run --name bootzooka-postgres -p 5432:5432 -e POSTGRES_PASSWORD=bootzooka
1924
Then, you can start the backend:
2025

2126
```sh
22-
export SQL_PASSWORD=bootzooka
23-
./backend-start.sh
27+
OTEL_SDK_DISABLED=true SQL_PASSWORD=bootzooka ./backend-start.sh
2428
```
2529

30+
Unless you've got an OpenTelemetry collector running, OpenTelemetry should be disabled to avoid telemetry export
31+
exceptions.
32+
2633
### Frontend: Yarn & webapp
2734

2835
You will need the [yarn package manager](https://yarnpkg.com) to run the UI. Install it using your package manager or:

backend/src/main/resources/application.conf

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ db {
2828
migrate-on-start = ${?MIGRATE_ON_START}
2929

3030
driver = "org.postgresql.Driver"
31-
32-
connect-thread-pool-size = 32
3331
}
3432

3533
email {
Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,45 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

3-
<configuration scan="true">
3+
<configuration>
4+
<contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator">
5+
<resetJUL>true</resetJUL>
6+
</contextListener>
7+
48
<if condition='p("LOGBACK_JSON_ENCODE").equals("true")'>
59
<then>
610
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
7-
<encoder class="net.logstash.logback.encoder.LogstashEncoder"/>
11+
<encoder class="net.logstash.logback.encoder.LogstashEncoder" />
812
</appender>
913
</then>
1014
<else>
1115
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
12-
<encoder>
13-
<pattern>%d{HH:mm:ss.SSS}%boldYellow(%replace( [%X{cid}] ){' \[\] ', ' '})[%thread] %-5level %logger{5} - %msg%n%rEx</pattern>
14-
</encoder>
15-
</appender>
16+
<encoder>
17+
<pattern><![CDATA[%d{HH:mm:ss.SSS}%boldYellow(%replace( [%X{cid}] ){' \[\] ', ' '})[%thread] %-5level %logger{5} - %msg%n%rEx]]></pattern>
18+
</encoder>
19+
</appender>
1620
</else>
1721
</if>
1822

23+
<appender name="OpenTelemetry"
24+
class="io.opentelemetry.instrumentation.logback.appender.v1_0.OpenTelemetryAppender"></appender>
25+
1926
<logger name="com.softwaremill.bootzooka" level="${LOG_LEVEL:-DEBUG}" additivity="false">
20-
<appender-ref ref="STDOUT"/>
27+
<appender-ref ref="STDOUT" />
28+
<appender-ref ref="OpenTelemetry" />
2129
</logger>
2230

23-
<logger name="sttp.client3" level="${LOG_LEVEL:-DEBUG}" additivity="false">
24-
<appender-ref ref="STDOUT"/>
31+
<logger name="sttp.client3" level="${LOG_LEVEL:-INFO}" additivity="false">
32+
<appender-ref ref="STDOUT" />
33+
<appender-ref ref="OpenTelemetry" />
2534
</logger>
2635

2736
<logger name="sttp.tapir" level="${LOG_LEVEL:-DEBUG}" additivity="false">
28-
<appender-ref ref="STDOUT"/>
37+
<appender-ref ref="STDOUT" />
38+
<appender-ref ref="OpenTelemetry" />
2939
</logger>
3040

3141
<root level="${LOG_LEVEL:-INFO}">
32-
<appender-ref ref="STDOUT"/>
42+
<appender-ref ref="STDOUT" />
43+
<appender-ref ref="OpenTelemetry" />
3344
</root>
34-
35-
</configuration>
45+
</configuration>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
global.salt.length=64

0 commit comments

Comments
 (0)