You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Clean up deployer temporary directories when no envrc was written #322
Track temporary-directory retention separately from the configured envrc path.
Deployer.New() creates a temporary directory for each invocation. Deployer.Cleanup() currently retains that directory whenever envrc output is configured, even if the invocation never successfully writes an envrc. This can leave unused temporary directories after deployments without Central, failed deployments, failed envrc writes, or teardown when the loaded configuration includes roxie.envrc.
Requested by @mclasmeier as a follow-up outside the scope of PR #320. The requester identified the underlying cleanup issue as pre-existing.
Required changes
Affected area: internal/deployer/deployer.go, particularly Deployer.Cleanup(), Deployer.deployCentral(), and Deployer.writeEnvrcFile().
Track whether this deployer instance successfully wrote an envrc.
Retain its temporary directory only after a successful envrc write, because the envrc can reference temporary CA certificate files.
Otherwise remove the temporary directory during cleanup, regardless of whether an envrc path is configured.
Add regression coverage for successful writes, failed writes, and invocations that do not write an envrc.
Acceptance criteria
A successful envrc write preserves the temporary files needed by that envrc.
A configured envrc path alone does not prevent cleanup.
Failed envrc writes and deployments that fail before writing an envrc do not retain unused temporary directories.
Teardown and deployments without Central clean up their newly created temporary directories when no envrc is written.
Cleanup remains safe when the temporary-directory path is empty.
Activity