feat(pipelines): Add compile-time type-safe pipeline inputs support
Implement strongly-typed pipeline inputs for `CreatePipeline` and
`RunPipelineTrigger` using generics to ensure compile-time type safety. This
approach prevents invalid input types from being used at compile time rather
than failing at runtime.
Implementation details:
- Add `PipelineInputsOption` type to represent pipeline input parameters
- Create `PipelineInputValue[T]` generic wrapper with type constraints
- Use `PipelineInputValueInterface` to enable map storage while maintaining
type safety
- Constrain valid types using `PipelineInputValueType` (string, integers,
floats, bool, string slice)
- Provide `NewPipelineInputValue()` constructor following the `Ptr()` pattern
Key design benefits:
- Compile-time type validation eliminates runtime type errors
- Invalid types (e.g., `struct{}`, `map`) cannot compile
- Explicit API contract through type constraints
- Consistent with existing patterns (similar to `Ptr()` usage)
- Self-documenting through IDE autocomplete and type hints
Usage example:
```go
client.Pipelines.CreatePipeline(projectID, &CreatePipelineOptions{
Ref: Ptr("main"),
Inputs: PipelineInputsOption{
"environment": NewPipelineInputValue("production"),
"replicas": NewPipelineInputValue(3),
"debug": NewPipelineInputValue(false),
"regions": NewPipelineInputValue([]string{"us-east", "eu-west"}),
},
})
```
Testing:
- Update tests to use `NewPipelineInputValue()` wrapper
- Verify compile-time type checking prevents invalid types
- Maintain comprehensive coverage for all supported types
- Test both `CreatePipeline` and `RunPipelineTrigger` endpoints
Fixes: #2154
-
mentioned in commit 7108931a
-
mentioned in merge request gitlab-org/cli!2399 (merged)
-
mentioned in merge request gitlab-com/gl-infra/platform/runway/runwayctl!1233 (merged)
-
mentioned in merge request gitlab-org/release-tools!4481 (merged)
-
mentioned in merge request gitlab-com/gl-infra/woodhouse!681 (merged)
-
🔨 @glrenovatebotmentioned in merge request gitlab-com/gl-infra/oncall-robot-assistant!104
-
mentioned in merge request fforster/epic-update!15 (merged)
-
mentioned in merge request fforster/gitlab-mcp!171 (merged)
-
mentioned in merge request gitlab-com/gl-infra/autolabels!99 (merged)
-
mentioned in merge request gitlab-com/gl-infra/ringctl!357 (merged)
-
🤘 @pascal.sickmentioned in merge request sickit/token-operator!15 (merged)
-
mentioned in merge request schober-server/kubernetes/images/gitlab-token-refresher!35
-
mentioned in merge request ydkn/gitlab-runner-cleanup!42
-
mentioned in merge request gitlab-org/terraform-provider-gitlab!2677 (merged)
-
mentioned in merge request hojerdev/git-sync!64 (merged)
-
mentioned in merge request sue445/tanuki_reminder!262 (merged)
-
mentioned in merge request sue445/create-merge-request!149 (merged)
-
mentioned in merge request gitlab-org/container-registry!2558 (merged)