Skip to content

refactor(fn): return RenderStatus from Renderer interface - #4777

Open
SurbhiAgarwal1 wants to merge 1 commit into
kptdev:mainfrom
SurbhiAgarwal1:feat/4520-renderer-render-status
Open

SurbhiAgarwal1 wants to merge 1 commit into
kptdev:mainfrom
SurbhiAgarwal1:feat/4520-renderer-render-status

Conversation

@SurbhiAgarwal1

Copy link
Copy Markdown
Contributor

Description

Updates the fn.Renderer interface return value to (*kptfilev1.RenderStatus, error) instead of (*fnresultv1.ResultList, error). The underlying kptops.Renderer now tracks and returns RenderStatus directly upon execution.

Motivation

Callers of the Renderer interface need access to the structured RenderStatus metadata (such as individual mutator/validator step execution details and error summaries) rather than just the raw ResultList.

Fixes #4520

Changes

  • pkg/fn/render.go: Updated Renderer interface signature to return (*kptfilev1.RenderStatus, error).
  • pkg/lib/kptops/render_executor.go:
    • Added RenderStatus field to Renderer.
    • Updated updateRenderStatus to return the constructed *kptfilev1.RenderStatus.
    • Assigned e.RenderStatus across all execution return paths (both success and error cases).
    • Ensured buildRenderStatus populates ErrorSummary when hydration errors occur before steps are executed.
  • pkg/lib/kptops/render.go: Updated renderer.Render to return rr.RenderStatus along with execution error.
  • pkg/lib/kptops/render_status_test.go: Added unit tests verifying Render returns *kptfilev1.RenderStatus on both success and failure cases.

@SurbhiAgarwal1
SurbhiAgarwal1 requested review from a team and a balanced review from Copilot September 28, 2026 17:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@netlify

netlify Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for kptdocs ready!

Name Link
🔨 Latest commit c49f546
🔍 Latest deploy log https://app.netlify.com/projects/kptdocs/deploys/6abbe1ad8b008c0008ebc06c
😎 Deploy Preview https://deploy-preview-4777--kptdocs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Several executor error paths still return without populating the newly exposed render status.

Review effort: Balanced
Findings: 1 Medium severity · 1 Low severity

Open (2)

Comment thread pkg/lib/kptops/render.go
}
return rr.Execute(printer.WithContext(ctx, &packagePrinter{}))
_, err := rr.Execute(printer.WithContext(ctx, &packagePrinter{}))
return rr.RenderStatus, err
Comment on lines +253 to +256
if hydErr != nil {
return &kptfilev1.RenderStatus{
ErrorSummary: hydErr.Error(),
}
@mozesl-nokia

mozesl-nokia commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Since this is a breaking API change, I propose we don't straight up replace the existing interface but create a new one and deprecate the old one without changes.

@SurbhiAgarwal1
SurbhiAgarwal1 force-pushed the feat/4520-renderer-render-status branch from 479848a to 2985a24 Compare September 29, 2026 14:52
Introduce fn.StatusRenderer returning (*kptfilev1.RenderStatus, error)
and kptops.NewStatusRenderer while preserving the existing fn.Renderer
interface as deprecated to prevent breaking API changes for external callers.

Expose RenderStatus across all kptops.Renderer execution paths,
ensuring ErrorSummary is populated on pre-hydration and post-hydration errors.

Fixes kptdev#4520

Signed-off-by: Surbhi Agarwal <SurbhiAgarwal1@users.noreply.github.com>
@SurbhiAgarwal1
SurbhiAgarwal1 force-pushed the feat/4520-renderer-render-status branch from 2985a24 to c49f546 Compare September 29, 2026 16:04

This branch has not been deployed

No deployments
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.

Renderer interface return value should use the RenderStatus type

3 participants