Expose code from internal package#4490
Merged
efiacor merged 1 commit intokptdev:mainfrom Apr 20, 2026
Merged
Conversation
✅ Deploy Preview for kptdocs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
There was a problem hiding this comment.
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/runtimeinstead ofinternal/fnruntime. - Rename the moved package from
fnruntimetoruntimewithinpkg/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/runtimeis intended to be externally consumable, but this package still importsgithub.com/kptdev/kpt/internal/...(e.g.,internal/builtins,internal/pkg,internal/types). Any external module importinggithub.com/kptdev/kpt/pkg/fn/runtimewill fail to compile due to Go'sinternalvisibility rules. To truly expose this runtime, move those dependencies to non-internal packages (or refactor to avoid them) sopkg/fn/runtimehas nointernalimports.
pkg/fn/runtime/runner_test.go:17- The file header comment describes
Package pipeline/Pipeline, but the package isruntime. This mismatch will produce incorrect GoDoc for the package and is confusing for readers. Update the comment to describe whatpkg/fn/runtimeprovides (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.
internal package
liamfallon
approved these changes
Apr 18, 2026
Contributor
|
rebase required |
Signed-off-by: Mózes László Máté <laszlo.mozes@nokia.com>
a16edd4 to
bf40c54
Compare
efiacor
approved these changes
Apr 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I've moved some code from the
internalpackage topkgso it can be used externally. The main use-case for this is Porch at the moment.Currently moved:
internal/fnruntime→pkg/fn/runtime