All checks were successful
ci/woodpecker/push/build-image Pipeline was successful
83 lines
3.0 KiB
Markdown
83 lines
3.0 KiB
Markdown
# Code Quality Audit Snapshot
|
|
|
|
## Purpose
|
|
|
|
This roadmap file records the current cleanup audit status for `weatherfeeder`.
|
|
It is not current-behavior documentation and should not be used as the source of
|
|
truth for implemented features. Current behavior belongs in README, config,
|
|
operations, internal, consumer, and integration docs.
|
|
|
|
## Current Assessment
|
|
|
|
`weatherfeeder` remains architecturally coherent:
|
|
|
|
- `cmd/weatherfeeder` is runtime composition.
|
|
- Source adapters fetch upstream provider payloads.
|
|
- Provider helpers isolate provider-specific parsing.
|
|
- Normalizers map raw schemas into canonical `model` payloads.
|
|
- `standards` owns schema, kind, and WMO constants.
|
|
- Postgres sink mapping is isolated under `internal/sinks/postgres`.
|
|
- Feedkit owns generic config, scheduling, processing, dispatch, and sink
|
|
mechanics.
|
|
|
|
The highest-value completed cleanup work since the original audit includes:
|
|
|
|
- event kind constants in `standards`;
|
|
- source driver constants in provider source packages;
|
|
- source registry tests derived from registered drivers;
|
|
- shared HTTP config parsing for multi-document sources;
|
|
- config/example load coverage;
|
|
- shallow documentation consistency tests for current schemas and source
|
|
drivers;
|
|
- consumer documentation for public Go packages.
|
|
|
|
## Remaining Cleanup Opportunities
|
|
|
|
### Postgres Mapper Boilerplate
|
|
|
|
The Postgres mapper still repeats event envelope values and parent-row map
|
|
patterns across canonical product families.
|
|
|
|
Recommended next action: implement the Postgres mapper envelope cleanup in
|
|
[`cleanup.md`](cleanup.md) without changing table contracts or mapper behavior.
|
|
|
|
### Package-Local Fixture Helpers
|
|
|
|
Some tests still use package-local fixture-loading helpers that may be
|
|
consolidated where multiple files in the same package duplicate the same logic.
|
|
|
|
Recommended next action: consolidate only obvious same-package duplication. Do
|
|
not add cross-package test helper packages.
|
|
|
|
### Literal Sweep
|
|
|
|
Some string literals remain intentional in docs, YAML examples, and negative
|
|
tests. Internal code and tests can still be reviewed for opportunities to use
|
|
existing constants where that reduces drift risk.
|
|
|
|
Recommended next action: perform a final literal sweep only after higher-value
|
|
cleanup stages are complete.
|
|
|
|
## Non-Issues
|
|
|
|
These areas were reviewed and should not be refactored without a new roadmap:
|
|
|
|
- Normalizer `Match` methods are intentionally explicit schema checks.
|
|
- Provider-specific time parsers should remain provider-specific.
|
|
- SPC multi-document polling should remain source-local and atomic.
|
|
- The current runtime does not need a generic workflow engine.
|
|
- The Postgres sink should not become an ORM or reflection mapper.
|
|
- Documentation should remain audience-specific rather than generated from code.
|
|
|
|
## Validation Baseline
|
|
|
|
The current test suite covers source construction, normalizer registration and
|
|
mapping, Postgres schema/mapping, maintained config loading, source-driver docs,
|
|
and event-schema docs.
|
|
|
|
Recommended baseline after any cleanup:
|
|
|
|
```sh
|
|
go test ./...
|
|
```
|