implemented 03-gitea-client.md: added Gitea API client for commit statuses, status mapping, and extensive tests
This commit is contained in:
@@ -38,3 +38,16 @@ WireMock (already a test dependency, see `WireMockSmokeTest`):
|
||||
|
||||
- `./gradlew ktlintFormat` then `./gradlew build` is green.
|
||||
- No call path throws when Gitea is unconfigured or down.
|
||||
|
||||
## Execution Notes (2026-07-07)
|
||||
|
||||
Implemented as designed; deviations and decisions:
|
||||
|
||||
- Added `org.springframework:spring-web` as a dependency; `RestClient` lives there and `spring-boot-starter` alone does not provide it.
|
||||
- `publishStatus` takes a `BuildStatus` and maps it internally instead of a raw Gitea state string.
|
||||
The forward mapping never produces `error` because the `BuildStatus` enum is exhaustive; legacy emitted `error` only for unknown status strings.
|
||||
- `readStatus` returns a sealed `GiteaStatusResult` (`Found`/`None`/`Disabled`/`Error`) so callers get explicit non-fatal error states instead of exceptions.
|
||||
- `resolveUsername` only requires `gitea.baseUrl` and `git.token`; legacy gated it on the full status-enabled check including owner/repo, which the `/api/v1/user` endpoint does not need.
|
||||
- Responses are read as strings and parsed with a dedicated Jackson `ObjectMapper` instead of RestClient message converters, keeping malformed-JSON handling explicit and independent of converter auto-detection.
|
||||
- The legacy "Build status deleted" description marker is not ported; it belongs to the result-delete feature of later steps.
|
||||
- No config changes were needed: `gitea.*` and `git.token` already exist in `GitTallyConfig`, the `init` templates, and `docs/configuration.md`.
|
||||
|
||||
Reference in New Issue
Block a user