Skip to content

Merge changes from develop/spapadop#30

Closed
spapa013 wants to merge 5 commits intomainfrom
develop/spapadop
Closed

Merge changes from develop/spapadop#30
spapa013 wants to merge 5 commits intomainfrom
develop/spapadop

Conversation

@spapa013
Copy link
Collaborator

This PR merges changes from develop/spapadop.

Closes PLT-851 #29

spapa013 and others added 5 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
…rated-without-corresponding-http-service-when

Ensure ingress generation follows HTTP/hostname contract and split manifest generation into plan/render/post-render stages
@spapa013 spapa013 requested a review from eywalker March 11, 2026 23:58
@codecov
Copy link

codecov bot commented Mar 11, 2026

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR merges changes from develop/spapadop, aligning ingress manifest generation with the HTTP/hostname configuration contract and refactoring manifest generation into explicit plan/render/post-render phases to prevent template-selection drift.

Changes:

  • Gate ingress rendering on httpPort + hostName via shared config helpers and dev render planning.
  • Introduce RenderPlan, GenerationSpec, and a post-render cleanup phase (with --no-cleanup) to separate planning, rendering, and output management.
  • Add/update tests and golden fixtures to cover the new ingress contract and cleanup semantics.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
cmd/devenv/generate.go Switch CLI generation to GenerationSpec + generateManifests, add --no-cleanup, and run post-render steps after successful rendering.
internal/config/types.go Add HasHTTPPort, HasHostName, and ShouldRenderIngress helpers to centralize ingress eligibility.
internal/config/validation.go Enforce config dependencies (httpPorthostName, auth option constraints) consistent with rendering behavior.
internal/config/validation_test.go Add validation tests for ingress/auth dependency rules.
internal/templates/generation_spec.go Add GenerationSpec to bundle config, plan, template root, output dir, and post-render options.
internal/templates/plan.go Add RenderPlan plus dev/system plan builders to compute template sets before rendering.
internal/templates/plan_test.go Add contract and invariant tests for dev/system template planning and managed-template ownership.
internal/templates/post_render.go Add post-render cleanup of unplanned managed outputs.
internal/templates/post_render_test.go Add tests for cleanup behavior (remove stale, preserve planned/unmanaged, respect cleanup disable).
internal/templates/renderer.go Bind renderer to config + target template list; simplify RenderTemplate/RenderAll signatures.
internal/templates/renderer_test.go Update renderer tests for new APIs and add cases verifying ingress inclusion/exclusion and stale-file behavior on render failure.
internal/templates/testdata/golden/ingress.yaml Update golden ingress fixture to use a valid hostname-based rule and TLS wildcard.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

templateNames := append([]string{}, devBaseTemplates...)

if cfg != nil && cfg.ShouldRenderIngress() {
templateNames = append(templateNames, "ingress")
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason why we don't use devOptionalTemplates here is because In the future devOptionalTemplates could contain more than ingress, however, the relevant line in BuildDevRenderPlan specifically checks whether ingress should be included in templateNames, and it will always be ingress.

@spapa013 spapa013 closed this Mar 17, 2026
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.

2 participants