test: add basic input validation tests for plugin api structs
What this PR does
Adds basic input validation unit tests for PipeCD Plugin API structs under:
pkg/plugin/api/v1alpha1/...
The tests cover generated:
protoc-gen-validate
validation behavior across:
commondeploymentlivestateplanpreview
Specifically, this PR adds validation coverage for:
- Required fields
- Minimum string length checks
- Index boundary validation
- Nested model validation
Why we need it
PipeCD’s plugin API depends on generated validation logic to enforce:
- Request correctness
- API schema integrity
- Plugin contract consistency
at the API boundary.
Adding explicit validation tests helps ensure:
- Invalid plugin API payloads are rejected early
- Required API contracts remain enforced
- Nested validation behavior continues working correctly
- Future proto/schema changes do not accidentally weaken validation guarantees
This improves:
- API reliability
- Contract stability
- Confidence when evolving plugin interfaces
- Long-term schema safety
Which issue(s) this PR fixes
Fixes:
#[issue-number]
Does this PR introduce a user-facing change?
No
How are users affected by this change
There is no direct user-facing behavior change.
Developers and maintainers benefit from:
- Stronger Plugin API validation coverage
- Better regression protection
- Improved confidence in request validation behavior
This reduces the risk of validation regressions in plugin-related request handling.
Is this a breaking change
No
How to migrate (if breaking change)
N/A
Verification
Verified locally using:
go test ./pkg/plugin/api/v1alpha1/...
go test ./pkg/plugin/api/v1alpha1/deployment -v
All Plugin API validation tests pass successfully, including:
- Required-field validation
- Nested validation
- Boundary validation cases
- Generated PGV constraint enforcement
@rahulshendre @khanhtc1202 @eeshaanSA
PR is too dependent on AI. Follow template here: https://github.com/pipe-cd/pipecd/blob/master/.github/PULL_REQUEST_TEMPLATE.md
whats the objective of this PR, what is been tested. It is hard to know the changes here.
This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
This PR was closed because it has been stalled for 7 days with no activity. Feel free to reopen if still applicable.