Skip to content

Improve FunctionConfig related validation errors#4512

Open
mozesl-nokia wants to merge 2 commits intokptdev:mainfrom
nokia:fnconf-err-msg
Open

Improve FunctionConfig related validation errors#4512
mozesl-nokia wants to merge 2 commits intokptdev:mainfrom
nokia:fnconf-err-msg

Conversation

@mozesl-nokia
Copy link
Copy Markdown
Contributor

Currently, the error message is rather vague when a configPath based functionConfig cannot be found, simply stating that functionConfig must exist in the current package.

This PR rewords and improves that validation message in both places it could be returned + some code deduplication and refactoring.

Copilot AI review requested due to automatic review settings May 6, 2026 11:30
@mozesl-nokia mozesl-nokia requested a review from liamfallon as a code owner May 6, 2026 11:30
@mozesl-nokia mozesl-nokia added the area/fn-runtime KRM function runtime label May 6, 2026
@mozesl-nokia mozesl-nokia added the go Pull requests that update Go code label May 6, 2026
@netlify
Copy link
Copy Markdown

netlify Bot commented May 6, 2026

Deploy Preview for kptdocs ready!

Name Link
🔨 Latest commit 95da4a3
🔍 Latest deploy log https://app.netlify.com/projects/kptdocs/deploys/69fb30a6952b240008dcb344
😎 Deploy Preview https://deploy-preview-4512--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.

@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label May 6, 2026
Signed-off-by: Mózes László Máté <laszlo.mozes@nokia.com>
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 improves user-facing validation errors when a configPath-based functionConfig cannot be found, replacing the prior vague message with more actionable context. It also refactors pipeline validation to deduplicate error construction and updates e2e expected outputs accordingly.

Changes:

  • Reword functionConfig open/validation errors to include the configured path and underlying filesystem error.
  • Refactor pipeline configPath validation to reuse a helper for consistent error construction (and to include function name/image context).
  • Update e2e harness/expected outputs to make stderr comparisons stable across temp dirs.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
pkg/test/runner/runner.go Adds stderr normalization for temp-dir prefixes when comparing e2e outputs.
pkg/api/kptfile/v1/validation.go Improves configPath functionConfig open error to include path and wrapped error.
internal/pkg/pkg.go Refactors pipeline configPath validation errors and adds helpers for step naming.
internal/pkg/pkg_test.go Adds unit tests for step name/image display helper.
e2e/testdata/fn-render/missing-fnconfig/.expected/config.yaml Updates expected stderr to match new validation message.
e2e/testdata/fn-render/fnconfig-cannot-refer-subpkgs/.expected/diff.patch Updates expected output to match new validation message.
e2e/testdata/fn-render/fnconfig-cannot-refer-subpkgs/.expected/config.yaml Updates expected stderr to match new validation message.

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

Comment thread pkg/test/runner/runner.go Outdated
Comment thread pkg/test/runner/runner.go
Comment thread internal/pkg/pkg.go
Comment thread internal/pkg/pkg.go
Signed-off-by: Mózes László Máté <laszlo.mozes@nokia.com>
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 go Pull requests that update Go code size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants