51 lines
2.3 KiB
Markdown
51 lines
2.3 KiB
Markdown
# PR#34: the statistics service is called statistics, not server
|
|
|
|
> **WARNING:** This document describes only the change applied in this PR.
|
|
> It may already be outdated once the next PR is merged.
|
|
> Historic PR documentation is not maintained along with new PRs; treat it as a snapshot.
|
|
|
|
## The Problem
|
|
|
|
The statistics service of werkrevisor, werkrevisor.javagil.de, lives in the directory `server/`,
|
|
and its Werkator build reported the status `werkator/server`.
|
|
Neither name says what the code is for: a reader of the status list could not tell
|
|
that it is the build and test of the statistics service, and not a server that runs.
|
|
The same name is in the Kotlin package, the jar, the environment variables and the systemd unit on mih09.
|
|
|
|
## Non-Goals
|
|
|
|
- No change of behavior, endpoints, port or database.
|
|
- No change of `WERKREVISOR_STATS_URL` and `WERKREVISOR_STATS_TOKEN`, which the reviewer uses to report.
|
|
|
|
## The Scenarios
|
|
|
|
### Feature: the statistics service is named after its purpose
|
|
|
|
#### Scenario#34.01: the service reads its settings from `WERKREVISOR_STATISTICS_*`
|
|
|
|
So that the names of the settings match the name of the service.
|
|
|
|
- **Given** `WERKREVISOR_STATISTICS_PORT`, `WERKREVISOR_STATISTICS_ADDRESS` and the token variables
|
|
- **When** the service starts
|
|
- **Then** it listens on that address and port and accepts those tokens
|
|
|
|
##### Verified by
|
|
|
|
- [SettingsIntegrationTest: the service reads its settings from WERKREVISOR_STATISTICS_*](../../statistics/src/test/kotlin/de/hoennig/werkrevisor/statistics/SettingsIntegrationTest.kt)
|
|
|
|
## The Solution
|
|
|
|
- `server/` becomes `statistics/`, the package `de.hoennig.werkrevisor.server` becomes `de.hoennig.werkrevisor.statistics`,
|
|
the Gradle project and jar `werkrevisor-statistics`.
|
|
- The environment variables `WERKREVISOR_SERVER_*` become `WERKREVISOR_STATISTICS_*`.
|
|
- The Werkator machine config on mih09, outside this repository, builds `statistics/`
|
|
under the build name `statistics` and the status `werkator/werkrevisor-statistics`;
|
|
it builds `server/` on branches that still have it.
|
|
- On mih09, the systemd unit, its directory and its env file become `werkrevisor-statistics`.
|
|
- `.werkrevisor.toml` and the README name the new paths.
|
|
- werkrevisor 0.20.3.
|
|
|
|
## Prerequisite PRs
|
|
|
|
- PR#33: a reused line comment gets the text of the new review.
|