Skip to content

Move RunnerOptions and related types to the API - #4822

Open
mozesl-nokia wants to merge 3 commits into
kptdev:mainfrom
nokia:move-runneropts
Open

mozesl-nokia wants to merge 3 commits into
kptdev:mainfrom
nokia:move-runneropts

Conversation

@mozesl-nokia

Copy link
Copy Markdown
Contributor

Moved the following types to the API module:

  • RunnerOptions
  • SingleLineFormatter
  • ImagePullPolicy consts
  • ExecError

Had to do some refactoring around ImagePullPolicy and CEL env as well.

Depends on #4811 (and currently includes the commits from that branch as well)

AI disclosure:

@mozesl-nokia
mozesl-nokia requested review from a team October 21, 2026 09:55
@mozesl-nokia mozesl-nokia added cleanup go Pull requests that update Go code area/api labels Oct 21, 2026
@netlify

netlify Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for kptdocs ready!

Name Link
🔨 Latest commit c89140e
🔍 Latest deploy log https://app.netlify.com/projects/kptdocs/deploys/6adf25a3715ad14547b71b34
😎 Deploy Preview https://deploy-preview-4822--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.

Assisted-by: Cursor:grok-4.7
Signed-off-by: Mózes László Máté <laszlo.mozes@nokia.com>
Assisted-by: Cursor:grok-4.7
Signed-off-by: Mózes László Máté <laszlo.mozes@nokia.com>
@mozesl-nokia
mozesl-nokia marked this pull request as ready for review October 26, 2026 10:01
@mozesl-nokia
mozesl-nokia requested a review from a team October 26, 2026 10:01
Copilot AI balanced review requested due to automatic review settings October 26, 2026 10:01
Signed-off-by: Mózes László Máté <laszlo.mozes@nokia.com>

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.

🟡 Changes recommended

The root and CLI modules still select an API release without the moved packages and types, blocking builds outside a local API workspace.

1 open issue
What changed in this PR

This PR moves shared function-runner types into the separately versioned API module, building on the CLI-module extraction in #4811. It keeps CLI flag handling and CEL implementation outside the API.

Changes:

  • Moves runner options, image-pull constants, formatting utilities, and execution errors into the API.
  • Introduces a condition-evaluator interface and a CLI image-pull-policy adapter.
  • Updates consumers and reorganizes tests around the new package boundaries.
File Description
README.md Documents runner options in the API module.
pkg/​lib/​util/​get/​get.go Uses API options and extracted CEL initialization.
pkg/​lib/​runneroptions/​imagepullpolicy.go Removes the old policy implementation.
pkg/​lib/​kptops/​render.go Imports API runner options.
pkg/​lib/​kptops/​render_executor.go Uses API options and execution errors.
pkg/​lib/​kptops/​render_executor_util_test.go Updates the options import.
pkg/​lib/​kptops/​render_executor_test.go Updates the options import.
pkg/​lib/​kptops/​hook_executor.go Imports API runner options.
pkg/​lib/​kptops/​fs_test.go Updates options and CEL initialization.
pkg/​lib/​kptops/​configref_test.go Updates the options import.
pkg/​lib/​celenv/​celenv.go Separates CEL implementation from API types.
pkg/​lib/​celenv/​celenv_test.go Moves tests into the CEL package.
pkg/​fn/​runtime/​runner.go Uses API types and the evaluator interface.
pkg/​fn/​runtime/​runner_test.go Updates options and formatter references.
pkg/​fn/​runtime/​imagepullpolicy.go Removes the duplicate policy implementation.
pkg/​fn/​runtime/​exec.go Returns the API execution-error type.
pkg/​fn/​runtime/​container.go Uses API options and execution errors.
pkg/​fn/​runtime/​container_test.go Receives Docker output-filter tests.
pkg/​fn/​runtime/​condition_test.go Uses the extracted CEL package.
pkg/​fn/​runtime/​celeval_test.go Updates CEL test helpers.
cli/​fn/​render/​cmdrender.go Wires the policy adapter and CEL initializer.
cli/​fn/​imagepullpolicy/​imagepullpolicy.go Adds the CLI-specific flag adapter.
cli/​fn/​doc/​cmdfndoc.go Imports API runner options.
cli/​fn/​cmdeval/​runfn.go Imports API runner options.
cli/​fn/​cmdeval/​cmdeval.go Wires the policy adapter and CEL initializer.
cli/​fn/​cmdeval/​cmdeval_test.go Updates the options import.
api/​utils/​single_line_formatter.go Houses the shared output formatter.
api/​runneroptions/​runneroptions.go Houses options and defines the evaluator interface.
api/​runneroptions/​runneroptions_test.go Adds API-level option tests.
api/​runneroptions/​imagepullpolicy.go Defines shared image-pull-policy constants.
api/​fnresult/​v1/​errors.go Houses the execution-error type.
api/​fnresult/​v1/​errors_test.go Keeps error tests separate from runtime tests.

Review effort: Balanced

Comment thread pkg/fn/runtime/runner.go
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
58.4% Coverage on New Code (required ≥ 80%)
B Security Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

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

area/api cleanup go Pull requests that update Go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants