Skip to content

Expose code from internal package#4490

Merged
efiacor merged 1 commit intokptdev:mainfrom
nokia:export-fnruntime
Apr 20, 2026
Merged

Expose code from internal package#4490
efiacor merged 1 commit intokptdev:mainfrom
nokia:export-fnruntime

Conversation

@mozesl-nokia
Copy link
Copy Markdown
Contributor

I've moved some code from the internal package to pkg so it can be used externally. The main use-case for this is Porch at the moment.

Currently moved:

  • internal/fnruntimepkg/fn/runtime

Copilot AI review requested due to automatic review settings April 17, 2026 08:51
@mozesl-nokia mozesl-nokia requested a review from efiacor as a code owner April 17, 2026 08:51
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 17, 2026

Deploy Preview for kptdocs ready!

Name Link
🔨 Latest commit bf40c54
🔍 Latest deploy log https://app.netlify.com/projects/kptdocs/deploys/69e5d98f3ba1030008f218c3
😎 Deploy Preview https://deploy-preview-4490--kptdocs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. area/fn-runtime KRM function runtime go Pull requests that update Go code labels Apr 17, 2026
Copy link
Copy Markdown
Contributor

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 aims to make the function runtime code externally reusable by moving it out of internal and updating in-repo consumers to import it from pkg/fn/runtime.

Changes:

  • Update call sites to import the runtime from github.com/kptdev/kpt/pkg/fn/runtime instead of internal/fnruntime.
  • Rename the moved package from fnruntime to runtime within pkg/fn/runtime.
  • Minor import cleanup in the wasmtime implementation.

Reviewed changes

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

Show a summary per file
File Description
thirdparty/kyaml/runfn/runfn.go Switches function-runtime import to pkg/fn/runtime.
pkg/test/runner/runner.go Updates test runner to import runtime from pkg/fn/runtime.
pkg/lib/kptops/eval_test.go Updates eval tests to import runtime from pkg/fn/runtime.
pkg/lib/errors/resolver/container.go Updates error resolver to reference pkg/fn/runtime error types.
pkg/fn/runtime/container.go Renames package declaration to runtime.
pkg/fn/runtime/container_test.go Renames package declaration to runtime.
pkg/fn/runtime/container_utils.go Renames package declaration to runtime.
pkg/fn/runtime/container_utils_test.go Renames package declaration to runtime.
pkg/fn/runtime/exec.go Renames package declaration to runtime.
pkg/fn/runtime/fnerrors.go Renames package declaration to runtime.
pkg/fn/runtime/fnerrors_test.go Renames package declaration to runtime.
pkg/fn/runtime/imagepullpolicy.go Renames package declaration to runtime.
pkg/fn/runtime/jsglue.go Renames package declaration to runtime.
pkg/fn/runtime/nodejs.go Renames package declaration to runtime.
pkg/fn/runtime/runner.go Renames package declaration to runtime.
pkg/fn/runtime/runner_test.go Renames package declaration to runtime.
pkg/fn/runtime/tag_resolution.go Renames package declaration to runtime.
pkg/fn/runtime/tag_resolution_test.go Renames package declaration to runtime.
pkg/fn/runtime/utils.go Renames package declaration to runtime.
pkg/fn/runtime/utils_test.go Renames package declaration to runtime.
pkg/fn/runtime/wasm.go Renames package declaration to runtime.
pkg/fn/runtime/wasmtime.go Renames package declaration to runtime and adjusts wasmtime-go import.
pkg/fn/runtime/wasmtime_unsupported.go Renames package declaration to runtime.
internal/util/render/executor_test.go Updates runtime import to pkg/fn/runtime.
internal/util/render/executor.go Updates runtime import to pkg/fn/runtime.
internal/hook/executor.go Updates runtime import to pkg/fn/runtime.
e2e/fn_test.go Updates runtime import to pkg/fn/runtime.
commands/fn/doc/cmdfndoc_test.go Updates runtime import to pkg/fn/runtime.
commands/fn/doc/cmdfndoc.go Updates runtime import to pkg/fn/runtime.
Comments suppressed due to low confidence (2)

pkg/fn/runtime/runner.go:15

  • pkg/fn/runtime is intended to be externally consumable, but this package still imports github.com/kptdev/kpt/internal/... (e.g., internal/builtins, internal/pkg, internal/types). Any external module importing github.com/kptdev/kpt/pkg/fn/runtime will fail to compile due to Go's internal visibility rules. To truly expose this runtime, move those dependencies to non-internal packages (or refactor to avoid them) so pkg/fn/runtime has no internal imports.
    pkg/fn/runtime/runner_test.go:17
  • The file header comment describes Package pipeline/Pipeline, but the package is runtime. This mismatch will produce incorrect GoDoc for the package and is confusing for readers. Update the comment to describe what pkg/fn/runtime provides (or remove it if it’s not meant to be a package doc comment).

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

Comment thread thirdparty/kyaml/runfn/runfn.go
@mozesl-nokia mozesl-nokia changed the title Expose code internal package Expose code from internal package Apr 17, 2026
@dosubot dosubot Bot added the lgtm label Apr 18, 2026
@efiacor
Copy link
Copy Markdown
Contributor

efiacor commented Apr 20, 2026

rebase required

Signed-off-by: Mózes László Máté <laszlo.mozes@nokia.com>
@efiacor efiacor merged commit 46c29a9 into kptdev:main Apr 20, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/fn-runtime KRM function runtime cleanup go Pull requests that update Go code lgtm size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants