fix: Check container_name on the rolled service #100
No reviewers
Labels
No labels
priority/P0
priority/P1
priority/P2
priority/P3
size/L
size/M
size/S
size/XL
size/XS
state/blocked
state/done
state/in-progress
state/in-review
state/needs-refinement
state/ready
type/bug
type/chore
type/feature
type/refactor
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
amtronics/platform-actions!100
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/99-container-name-own-block"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Issue
Closes #99
Problem
docker compose config <service>also renders the services it depends on. So rihla's rolled api, which has nocontainer_name, was refused because its dependencymigratekeepsrihla-migrate-1. Rihla deploy run 887 failed this way before touching any container. This blocks suhba/rihla#417.Solution
Read the full rendered config and look for
container_nameonly inside the rolled service's own block (awk over theservices:section).Review notes
| grep -qunderpipefailcould SIGPIPE the producer and silently skip the refusal. Against the old code, the existing refusal case fails in the harness for exactly that reason. awk reads all of its input.Risks and trade-offs
It relies on compose's rendered layout: services at 2 spaces, their keys at 4. That is the stable
configoutput format.Blocking
fix: Check container_name on the rolled service(46).Verified at
6e2ef93(CIPR / validategreen, head contains maina1086d1):services:section, tracks the current 2-space key and setsfoundonly on a 4-spacecontainer_name:under the rolled service's own block;END { exit !found }makes the refusal branch run exactly when found. Keys outsideservices:(the stub'snetworks.default.container_name) and dependencies' names no longer count. Nogrep -q, so nothing ends the producer early underpipefail.config <service> | grep -qput back, "a rolled service with container_name is refused" fails, as the description says:mail's name matches first,grep -qexits, the stub's nextechodies of SIGPIPE and the pipeline reads as "not found". With the old check kept but reading its whole input (grep … > /dev/null), the new case "a dependency's container_name does not refuse the rolled service" fails, together with "opted in: only the other services are recreated". The two cases pin both bugs.Approval on the renamed head.
fix: Check only the rolled service for container_nameto fix: Check container_name on the rolled service6e2ef93e00c06584646dRe-review of
c065846after 1714.6e2ef93(index lines aside), so the verification there stands: awk scoped to the rolled service's own block, whole input read, harness green on the head, both mutants killed by the pair of cases.PR / validategreen atc065846; one commit, no trailers.APPROVED.