Skip to main content

Before the first release: dock-scheduling

The first merge to main runs docker-publish and release. Two services built from this template (pick-face-replenishment, task-interleaving) each needed a rework because packaging was missing or wrong when that moment came. Work through this list on a feature branch, before the first develop → main PR. Delete a row only when the service really does not have that part, and say so in the PR.

new-service.sh already generated Dockerfile and .dockerignore for you (verbatim from the fleet reference). The chart is NOT generated: it is shaped by what the service runs (consumer groups, MCP, analytics, frontend), so copy the closest sibling's charts/<repo>/ and adapt it. References on origin/develop: IQVO/pick-face-replenishment (Kafka consumers, MCP, analytics, frontend) and IQVO/task-interleaving.

#ItemDone whenGuarded by
1Real runtime only. cmd/api wires Postgres and Kafka; the in-memory adapters (internal/adapters/outbound/memory) are test doubles. No *_MODE/permissive fallback, no default that boots "healthy" without DATABASE_URL or KAFKA_BROKERS.cmd/** has no import of the memory package; the binary exits at boot on missing DATABASE_URL, KAFKA_BROKERS or a consumer group id.TestRuntimeBinaryHasNoInMemoryAdapters (internal/architecture/runtime_no_memory_fitness_test.go). The boot-error behaviour has no generic sensor: cover it in cmd/api tests and in the chart test (row 8).
2No Go file at the repo root. The godog runner and steps live in features/ (package features_test, Paths: "."), binaries in cmd/<name>/, everything else in internal/.ls *.go at the root prints nothing; make bdd still finds TestFeatures.TestNoGoFilesAtRepoRoot (internal/architecture/no_go_files_at_root_fitness_test.go).
3Dockerfile builds every cmd/*. Generated; confirm ENTRYPOINT ["./api"] matches your main binary and EXPOSE matches HTTP_ADDR.docker build . succeeds locally; docker run --rm <image> /app/api starts (or exits with the intended config error).trivy-scan job builds the image on every PR to main/develop; docker-publish on push to main.
4.dockerignore excludes docs, charts, harness, tests output. Generated.Build context is small; .git, .claude/, docs/, charts/ are not sent.none: review once.
5Helm chart charts/dock-scheduling/ with Chart.yaml name: dock-scheduling. The chart directory name, the Chart.yaml name and the helm package file name in the release job must all be dock-scheduling.helm lint charts/dock-scheduling and helm template with the required values both pass.helm-lint (PRs) and the release job (packages dock-scheduling-<version>.tgz).
6DATABASE_URL comes from a Secret (secretKeyRef, chart secret.yaml or database.existingSecret), never from the ConfigMap or a literal.helm template shows secretKeyRef for DATABASE_URL; the ConfigMap has no DSN.chart test (row 8).
7Pod hardening and shutdown room. runAsNonRoot, readOnlyRootFilesystem: true, allowPrivilegeEscalation: false, capabilities.drop: [ALL]; terminationGracePeriodSeconds greater than the sum of the binary's shutdown bounds (drain delay + HTTP + consumers + relay).Values and Deployment carry all of it; the chart refuses a grace period below the sum.chart test (row 8).
8Chart tests in charts/dock-scheduling/tests/ (render_test.sh, test_service_selectors.py): envFrom ConfigMap mounted, mandatory values refuse to render, every env var cmd/api reads is rendered, no *_MODE, Secret for the DSN, hardening, grace period, every Service selects exactly one Deployment. Copy and adapt the reference tests.bash charts/dock-scheduling/tests/render_test.sh prints PASS.chart-tests job runs every tests/*.sh and test_*.py. It only warns when the directory is empty, so an absent test passes CI: the checklist is the guard.
9Consumer group ids are chart values, stable and service-prefixed, never derived from the pod name.Each *_CONSUMER_GROUP is rendered from config.* and refuses to render empty.chart test (row 8); kafka-testing-and-consumers.md rule.
10Optional CI jobs match the service. web (needs web/), docs-api-drift (needs docs/ and apis/openapi.yaml), api-lint (needs apis/*.yaml and the spectral rulesets): delete a job and its docker-publish needs: entry if the service has no such part, or add the part.No job in ci.yml is permanently red or skipped for a missing directory.first PR's CI run.
11Registry access images push to ghcr.io/iqvo with the Actions token (packages: write on docker-publish/release, already in ci.yml); no Docker Hub secrets are needed.A dry-run of docker-publish on a throwaway branch, or ask the repo admin.none.
12govulncheck is clean before the PR to main (CI vuln job installs @latest; make vuln runs the same command).make vuln exits 0.vuln job (a docker-publish prerequisite).

Tick this list in the PR that adds Dockerfile/chart wiring, and keep the file: it is the service's packaging record. Reference for the three failures this list prevents: a runtime that can run without Postgres/Kafka (row 1), Go files at the root (row 2), a release that fails on the first push to main because packaging was never built (rows 3-8).

State on develop​

Checked against the code of origin/develop; the checklist is a record, so re-check each row before the PR to main.

#StateEvidence
1Metcmd/api refuses to boot without DATABASE_URL, KAFKA_BROKERS and the four *_CONSUMER_GROUP variables (cmd/api/config.go); TestRuntimeBinaryHasNoInMemoryAdapters is in internal/architecture.
2MetNo .go file at the repo root; the godog runner is features/features_test.go; TestNoGoFilesAtRepoRoot exists.
3MetThe Dockerfile builds every cmd/* (six binaries) into /app; ENTRYPOINT ["./api"], EXPOSE 8080 8090 8091 8092 8094 covers the API, MCP, projector, reports and relay ports.
4Met.dockerignore excludes .git, .github, *.md, docs/, charts/, web/.
5Metcharts/dock-scheduling/Chart.yaml; CI has helm-lint and the release job.
6MetDATABASE_URL is a secretKeyRef in every Deployment; the chart refuses to render without database.url or database.existingSecret.
7PartlyHardening is in values.yaml. terminationGracePeriodSeconds is 40 and render_test.sh refuses lower values, but the code's await bounds (consumers 30 s, relay 30 s) exceed the 10 s budgeted in the comment. See the runbook.
8Metcharts/dock-scheduling/tests/ holds render_test.sh, test_service_selectors.py and test_sweeps_cronjob.py; the chart-tests job runs them.
9MetThe five consumer groups are chart values; the chart refuses to render an empty one.
10Metci.yml has api-lint (three specs) and no web or docs-api-drift job, matching a repo with neither web/ nor a generated-docs drift check.
11Not verifiedRegistry access is an org setting; not checked from the repository.
12Not verifiedmake vuln was not run for this page.

Platform registration in warehouse-infra​

The packaging rows above say nothing of the platform side, which lives in warehouse-infra. State on its origin/develop:

ItemStateEvidence
terraform/apps.yaml entry (kind: service, database: true, analytics: true, no web part)Donewarehouse-infra PR 193, commit b4b827e, entry dock-scheduling.
helm-values/dock-scheduling.yaml (stable dock-scheduling-* consumer groups, existingSecret wiring, reports and MCP routes, relay, sweeps, Kong plugins)DonePR 193, commit b4b827e.
Dashboard and alert rulesDonePR 193, commit b4b827e: terraform/dashboards/contexts/dock-scheduling.json and six rules in terraform/alerting/warehouse-alert-rules.json (see Observability).
Chart lint and selector check in warehouse-infra CIDonePR 193, commit b4b827e (.github/workflows/ci.yml, scripts/check-chart-selectors.py).
Image pinnedDoneCommit c42c475 pinned dock-scheduling at 7f20813-arm64 (v0.1.1); commit 05fd28b (#200, "chore(images): pin dock-scheduling and yard-management at v0.1.2") moved it to d5db895-arm64, the commit of this repository's v0.1.2 tag.
Yard-domain Kafka topics pre-created before the first syncNot verifieddocs/kafka-topics-yard-dock.md in warehouse-infra (PR 193) gives the command. The first sync has happened (Argo operation Succeeded 2026-11-10T03:10:38Z), but whether the topics were pre-created, or exist now, was not checked: a topic listing needs kubectl exec. The api log (read 2026-11-10) names partitions 0 to 7 of warehouse.yard-management.events, warehouse.inbound-receiving.events and warehouse.facility.events, so the broker answered for those.
Applied to the k3s clusterDone (api only)Read-only on 2026-11-10: kubectl get application dock-scheduling -n argocd is Synced and Healthy (last operation Succeeded 2026-11-10T03:10:38Z); pod dock-scheduling-675b448888-qcx4b is 1/1 Running with 0 restarts on ghcr.io/iqvo/warehouse-infra/dock-scheduling:d5db895-arm64, the v0.1.2 commit. MCP, the dedicated relay, analytics and the no-show sweep are switched off by warehouse-infra commit 89c9592. See the runbook.

The service is built on develop, registered in warehouse-infra develop and applied to the k3s cluster at v0.1.2 (api only). Consumer lag and topic contents are not verified. The ADR bodies in docs/adr/ are not edited by this update.