Skip to content

Dont hardcode the home directory mount point in devenv#33

Open
spapa013 wants to merge 10 commits intonauticalab:mainfrom
spapa013:spapadop/plt-863-dont-hardcode-the-home-directory-mount-point-in-devenv
Open

Dont hardcode the home directory mount point in devenv#33
spapa013 wants to merge 10 commits intonauticalab:mainfrom
spapa013:spapadop/plt-863-dont-hardcode-the-home-directory-mount-point-in-devenv

Conversation

@spapa013
Copy link
Collaborator

Summary

  • Adds HomeDirMountBase to BaseConfig (default /mnt/devenv) to replace the hardcoded host path prefix in the StatefulSet template
  • Updates the StatefulSet template to use {{.HomeDirMountBase}} for the dev-storage and dev-linuxbrew host paths
  • Removes stray trailing whitespace from the StatefulSet golden file

Decision log

HomeDirMountBase is defined on BaseConfig and is therefore overridable by individual developer configs. A future issue will audit all fields against a consistent override policy and introduce a generic enforcement mechanism if needed.

Test plan

  • Existing template golden file test passes with the default value (/mnt/devenv)
  • Manually verify that setting a custom homeDirMountBase in devenv.yaml produces the correct host paths in the generated StatefulSet
  • Verify that omitting homeDirMountBase entirely still produces /mnt/devenv paths (default preserved)

⚠️ This PR is stacked on #32 . Rebase onto main after that PR is merged before merging this one.

Closes PLT-863

spapa013 added 10 commits March 11, 2026 23:22
Align config validation with the ingress manifests that generation can produce.

The original validation path did not fully enforce the conditions needed
to render ingress safely. This change centralizes HTTP/hostname checks,
tightens auth validation, and updates tests and fixtures to reflect the
actual supported config combinations.

- add helpers for HTTP exposure and hostname presence
- require hostName when httpPort is set
- reject enableAuth combined with skipAuth
- require authURL and authSignIn when auth is enabled
- expand validation tests for ingress and auth dependencies
- update the ingress golden fixture to use a valid hostname
Extract template selection and ownership into an explicit RenderPlan.

The original renderer implicitly owned the template sets for dev and
system generation. This change moves that planning logic into a separate
module so template selection is explicit, testable, and reusable by the
rest of the generation pipeline.

- add RenderPlan with TemplateNames and ManagedTemplates
- add BuildDevRenderPlan and BuildSystemRenderPlan
- define dev/system base and optional template sets outside the renderer
- add contract tests for dev and system plans
- add invariants to ensure all planned templates are managed
- cover ingress inclusion and exclusion through plan tests
Introduce an explicit post-render phase for manifest output handling.

This change adds a dedicated post-render step that manages generated
outputs after a successful render, including cleanup of stale managed
files from previous runs that are no longer planned.

- add RunPostRender for post-render output handling
- add cleanup behavior for managed outputs that are no longer planned
- add post-render tests for managed, planned, and unmanaged outputs
- keep renderer tests focused on rendering behavior and failure paths
- make the invalid output directory test deterministic
- document the dev/system renderer wrappers as convenience helpers
Refactor manifest generation around an explicit GenerationSpec.

The original generate command assembled rendering inputs directly inside
the system and developer generation paths. This change packages the
generation contract into a typed spec, adds a shared generateManifests
pipeline, and introduces a no-cleanup flag for post-render behavior.

- add GenerationSpec with dev and system builders
- add NewPostRenderOptions for explicit post-render policy creation
- add --no-cleanup and map it into post-render behavior
- standardize the CLI flow on spec -> render -> post-render
- add a shared generateManifests helper for dev and system generation
- switch the command path to the generic NewRenderer constructor
- keep RenderPlan focused on TemplateNames only
- build dev plans by filtering the full dev template set
- add explicit cleanup-scope helpers for dev and system templates
- make BuildDevRenderPlan return an error for nil config
- update renderer/tests to use the new plan contract
- move cleanup to a pre-render step gated by --no-cleanup
- scope cleanup to known template outputs
- restore explicit generateSystemManifests / generateDeveloperManifests flows
use NewSystemRenderer and NewDevRenderer again instead of hardcoding generic render flow
- keep post-render invocation as an explicit pipeline stage
… no-op hook

- remove GenerationSpec and its builders
- simplify post-render to a no-op extension point for future work
- keep PostRenderOptions minimal
- reduce tests to cover the current no-op post-render contract
LoadGlobalConfig now returns an error when devenv.yaml is absent, rather than silently falling back to system defaults. The error message names the missing file and tells the user what to create and where.

Tests updated to reflect the new contract; the two test cases that asserted the silent-default behavior have been replaced with error assertions.

Refs: PLT-855
Replace the two-step os.Stat + os.ReadFile pattern in all three config load functions with a single os.ReadFile call, inspecting the error for os.IsNotExist. Eliminates a redundant syscall and the race window between the existence check and the read.

Refs: PLT-855
Adds HomeDirMountBase to BaseConfig, allowing the host path prefix for per-developer home and linuxbrew volumes to be configured rather than being hardcoded to /mnt/devenv in the StatefulSet template.

Defaults to /mnt/devenv to preserve existing behavior. Also removes stray trailing whitespace from the StatefulSet golden file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant