[codex] Add container restart policy accessors#21
Conversation
Greptile SummaryThis PR adds typed
Confidence Score: 5/5Safe to merge — the implementation is correct, prior review concerns have been fully addressed, and test coverage is thorough. Both previously flagged issues (from vs tryFrom risk, and missing null/string-path test cases) are resolved in this revision. The implementation follows existing codebase patterns, doc comments end with periods per project style, and no new issues were introduced. No files require special attention. Important Files Changed
Reviews (2): Last reviewed commit: "Handle restart policy edge cases" | Re-trigger Greptile |
Summary
Add a real
restartPolicyAPI toInstances\Containerso container-level restart policy can be expressed without relying on magic attribute setters.What Changed
Container::setRestartPolicy(RestartPolicy|string $policy): staticContainer::getRestartPolicy(): ?RestartPolicytests/ContainerTest.phpcovering restart policy round-trippingWhy
K8sPodalready exposes a typed restart policy API, butInstances\Containerdid not. That gap forced downstream code to set the raw attribute directly even though restart policy is part of the container spec used by newer Kubernetes sidecar semantics.This makes the container API explicit and typed, which also lets downstream projects remove local static-analysis workarounds.
Validation
Validation was not run locally in this checkout because
/Users/chiragaggarwal/Desktop/appwrite/php-k8s/vendoris not installed yet.Planned checks once dependencies are installed:
./vendor/bin/pint --test src/Instances/Container.php tests/ContainerTest.phpvendor/bin/phpunit tests/ContainerTest.php