Skip to content

Conversation

@khushiiagrawal
Copy link

Description of your changes:

This PR implements validation for Literal runtime parameters as part of KEP-11385.

Fixes #12602

Changes Made

1. Proto Definition (api/v2alpha1/pipeline_spec.proto)

  • Added literals field to ComponentInputsSpec.ParameterSpec
  • Regenerated Go protocol buffer bindings

2. API Server Validation (backend/src/apiserver/template/v2_template.go)

  • Extended validatePipelineJobInputs() to check runtime parameters against the literals field
  • If literals is non-empty, validates that the runtime value matches one of the allowed literals using proto.Equal()
  • Returns clear error message when validation fails

3. Driver Validation (backend/src/v2/driver/resolve.go)

  • Added validateLiteralParameter() helper function
  • Integrated validation in resolveInputs() to check resolved upstream parameters against literal constraints

4. Unit Tests (backend/src/apiserver/template/v2_literal_test.go)

  • Added 10 test cases covering:
    • Valid/invalid string, number, and boolean literal matches
    • Backward compatibility (empty/nil literals = no constraint)
    • Multiple parameters with literals

Backward Compatibility

  • Parameters without literals field continue to work unchanged
  • Empty literals array is treated the same as no literals (no constraint)

Test Results

All 16 tests pass (14 existing + 2 new test functions with sub-tests)

Checklist:

Copilot AI review requested due to automatic review settings January 4, 2026 19:24
@google-oss-prow
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign chensun for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@github-actions
Copy link

github-actions bot commented Jan 4, 2026

🎉 Welcome to the Kubeflow Pipelines repo! 🎉

Thanks for opening your first PR! We're excited to have you onboard 🚀

Next steps:

Feel free to ask questions in the comments.

@google-oss-prow
Copy link

Hi @khushiiagrawal. Thanks for your PR.

I'm waiting for a kubeflow member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Copy link
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 implements validation for Literal runtime parameters to enforce that parameter values match a predefined set of allowed values, as specified in KEP-11385. The validation occurs at two critical points: when pipeline jobs are submitted to the API server and when the driver resolves upstream parameters at runtime.

Key Changes:

  • Added literals field to the proto definition for parameter specifications
  • Implemented validation logic in both API server and driver components
  • Added comprehensive test coverage for API server validation

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
api/v2alpha1/pipeline_spec.proto Added literals field to ComponentInputsSpec.ParameterSpec to store allowed literal values
api/v2alpha1/go/pipelinespec/pipeline_spec.pb.go Regenerated Go bindings with new literals field and getter method
api/v2alpha1/go/cachekey/cache_key.pb.go Updated protoc version metadata (v6.33.2)
backend/src/apiserver/template/v2_template.go Extended validatePipelineJobInputs() to validate runtime parameters against literal constraints using proto.Equal()
backend/src/v2/driver/resolve.go Added validateLiteralParameter() helper and integrated validation in resolveInputs() to check resolved upstream parameters
backend/src/apiserver/template/v2_literal_test.go Added comprehensive test suite with 10 test cases covering valid/invalid matches for strings, numbers, booleans, and backward compatibility scenarios

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

@google-oss-prow google-oss-prow bot added size/XL and removed size/L labels Jan 4, 2026
@droctothorpe
Copy link
Collaborator

/ok-to-test

@alyssacgoins can you review this?

@khushiiagrawal
Copy link
Author

hii @alyssacgoins , do let me know if any changes required :)

// The description for this input parameter of the component.
// Should not exceed 1024 characters.
Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"`
Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like you updated this line for Description in additional to adding Literals. Can you revert this line back?

Copy link
Author

Choose a reason for hiding this comment

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

This file is auto-generated by protoc from the .proto file. When I added the Literals field to pipeline_spec.proto and regenerated the Go code, the protoc compiler reformatted this line as part of the regeneration. I can't selectively revert just this line without breaking the generated code. The spacing change has no functional impact , it's just a formatting difference from the protobuf compiler version.
Thanks!

@alyssacgoins
Copy link
Contributor

hii @alyssacgoins , do let me know if any changes required :)

Hey @khushiiagrawal thanks for your PR - I've added a round of comments.

@khushiiagrawal
Copy link
Author

Hey @khushiiagrawal thanks for your PR - I've added a round of comments.

Thanks @alyssacgoins for taking the time to review and for the detailed comments. I’ll go through them and make the required changes.

@khushiiagrawal
Copy link
Author

@droctothorpe @alyssacgoins
I’ve addressed all the review comments and pushed the updates.
The remaining failing checks appear to be due to test timeouts, not code changes.
Thanks!

@khushiiagrawal
Copy link
Author

@alyssacgoins Please take a look!
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feature] KEP-11385: Add validation for Literal runtime parameters in API Server and Driver

3 participants