feat: Stabilize ResourceGroup API to v1 with backward compatibility#4467
feat: Stabilize ResourceGroup API to v1 with backward compatibility#4467NETIZEN-11 wants to merge 22 commits intokptdev:mainfrom
Conversation
* Add status.conditions to show the renderstatus to Kptfile Signed-off-by: aravind.est <aravindhan.a@est.tech> * Address copilot and dosubot comments Signed-off-by: aravind.est <aravindhan.a@est.tech> --------- Signed-off-by: aravind.est <aravindhan.a@est.tech> Signed-off-by: NETIZEN-11 <kumarnitesh121411@gmail.com>
…nctions - Upgrade sigs.k8s.io/kustomize/api from v0.20.1 to v0.21.0 - Upgrade sigs.k8s.io/kustomize/kyaml from v0.20.1 to v0.21.0 - Upgrade k8s.io/api from v0.34.1 to v0.35.0 - Upgrade k8s.io/apimachinery from v0.34.1 to v0.35.0 - Upgrade k8s.io/kubectl from v0.34.1 to v0.35.0 - Upgrade github.com/kptdev/krm-functions-catalog/functions/go/apply-setters from v0.2.2 to v0.2.4 - Update catalog function registry to reference new apply-setters version - Run go mod tidy to resolve transitive dependencies Resolves GitHub Issue kptdev#4406 All catalog functions remain compatible with new APIs - zero breaking changes encountered. Zero compilation errors and zero failing tests across repository. Signed-off-by: NETIZEN-11 <kumarnitesh121411@gmail.com>
…nctions - Upgrade sigs.k8s.io/kustomize/api from v0.20.1 to v0.21.0 - Upgrade sigs.k8s.io/kustomize/kyaml from v0.20.1 to v0.21.0 - Upgrade k8s.io/api from v0.34.1 to v0.35.0 - Upgrade k8s.io/apimachinery from v0.34.1 to v0.35.0 - Upgrade k8s.io/kubectl from v0.34.1 to v0.35.0 - Upgrade github.com/kptdev/krm-functions-catalog/functions/go/apply-setters from v0.2.2 to v0.2.4 - Update catalog function registry to reference new apply-setters version - Run go mod tidy to resolve transitive dependencies Resolves GitHub Issue kptdev#4406 All catalog functions remain compatible with new APIs - zero breaking changes encountered. Zero compilation errors and zero failing tests across repository. Signed-off-by: NETIZEN-11 <nitesh@example.com> Signed-off-by: NETIZEN-11 <kumarnitesh121411@gmail.com>
- Add new RenderStatus and PipelineStepResult structs as per GitHub issue kptdev#4390 - Clearly separate mutation pipeline steps from validation steps - Capture execution failures (network errors, missing images, command failures) - Record stderr and exit codes for each pipeline step - Extract and categorize error results from function results - Aggregate all failures into comprehensive ErrorSummary - Update pipeline execution logic to populate detailed step results - Maintain backward compatibility with existing Rendered conditions - Add comprehensive unit tests for new functionality - Fix JSON tags and serialization issues This addresses the problems with the current schema: - Difficult troubleshooting → Clear step-by-step execution details - Unclear error reporting → Structured error information with aggregation - Inability to represent execution failures → Detailed execution error capture - Confusing result structure → Clean separation of mutation/validation steps Signed-off-by: NETIZEN-11 <kumarnitesh121411@gmail.com>
…ng issues - Add Windows build constraints to exclude wasmtime support - Fix linting issues: spelling, unused parameters, unused functions - Use errors.New for static error strings - Remove unused setRenderCondition function This resolves the failing CI checks for docker and podman builds. Signed-off-by: NETIZEN-11 <kumarnitesh121411@gmail.com>
- Update k8s.io/apiextensions-apiserver from v0.34.1 to v0.35.0 - Add yaml tags to RenderStatus, PipelineStepResult, and ResultItem structs - Fix result classification logic to use severity instead of ExitCode - Fix YAML test input to use proper multiline format - Run go mod tidy to normalize dependencies All changes maintain Go formatting and project coding style. Signed-off-by: NETIZEN-11 <kumarnitesh121411@gmail.com>
…subpackages - Add isRootKptfile() helper function for robust root detection - Enhance pkgContextResource() to generate package-context.yaml only for root packages - Subpackages are now correctly suppressed to prevent duplicate ConfigMap creation - Fix path normalization to handle relative paths like './Kptfile' - Ensure only one ConfigMap 'kptfile.kpt.dev' exists in mutation pipeline This resolves the 'ConfigMap already exists' error when rendering packages with subpackages. Signed-off-by: NETIZEN-11 <kumarnitesh121411@gmail.com>
- Removed mistakenly pushed changes that were related to another issue - Cleaned up commits to keep this PR focused on the intended issue - No functional changes introduced This ensures the PR only contains relevant changes. Signed-off-by: NETIZEN-11 <niteshkumar121411@gmail.com> Signed-off-by: NETIZEN-11 <kumarnitesh121411@gmail.com>
Signed-off-by: Michael Greaves <michael.greaves@nokia.com> Signed-off-by: NETIZEN-11 <kumarnitesh121411@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Michael Greaves <michael.greaves@nokia.com> Signed-off-by: NETIZEN-11 <kumarnitesh121411@gmail.com>
Signed-off-by: Michael Greaves <michael.greaves@nokia.com> Signed-off-by: NETIZEN-11 <kumarnitesh121411@gmail.com>
CI failure due to renderstatus merge fixed. Env variable to use nodejs as wasm env moved to Makefile from Github workflow Signed-off-by: aravind.est <aravindhan.a@est.tech> Signed-off-by: NETIZEN-11 <kumarnitesh121411@gmail.com>
…subpackages - Add isRootKptfile() helper function for robust root detection - Enhance pkgContextResource() to generate package-context.yaml only for root packages - Subpackages are now correctly suppressed to prevent duplicate ConfigMap creation - Fix path normalization to handle relative paths like './Kptfile' - Ensure only one ConfigMap 'kptfile.kpt.dev' exists in mutation pipeline This resolves 'ConfigMap already exists' error when rendering packages with subpackages. Signed-off-by: NETIZEN-11 <niteshkumar121411@gmail.com> Signed-off-by: NETIZEN-11 <kumarnitesh121411@gmail.com>
…ML serialization, result classification, and test YAML parsing Fixes applied: 1. Kubernetes Dependency Alignment - Updated all k8s.io modules to v0.35.0 2. YAML Serialization Fix - Added yaml tags alongside json tags in RenderStatus, PipelineStepResult, ResultItem 3. Correct Result Classification Logic - Updated extractResultsFromFnResults to use severity instead of ExitCode 4. Test YAML Parsing Fix - Fixed yaml.MustParse test input with proper multiline YAML Result: Eliminates dependency/API mismatch, ensures correct YAML output, fixes logic bug in result classification, makes tests valid and reliable Closes: kptdev#4432 Signed-off-by: NETIZEN-11 <niteshkumar121411@gmail.com> Signed-off-by: NETIZEN-11 <kumarnitesh121411@gmail.com>
- Added Signed-off-by line to comply with Developer Certificate of Origin (DCO) - Ensured commit author email matches GitHub account Signed-off-by: NETIZEN-11 <niteshkumar121411@gmail.com> Signed-off-by: NETIZEN-11 <kumarnitesh121411@gmail.com>
- Remove 50+ lines of commented dead code - Resolve TODO comment with proper printer implementation - Replace hardcoded strings with constants (KptfileName, EmptyTempDirPrefix, RootPackagePath) - Split monolithic function into 7 focused functions - Add comprehensive input validation and error handling - Improve resource cleanup with proper defer statements - Update copyright to 2022-2026 for modifications Fixes kptdev#4379 Signed-off-by: NETIZEN-11 <niteshkumar121411@gmail.com> Signed-off-by: NETIZEN-11 <kumarnitesh121411@gmail.com>
…n, and CRLF - Update testdata Kptfiles to use apply-setters:v0.2.4 (was v0.2.0) which is not registered in the functions map, causing TestRender failures - Fix validateFnConfigPathSyntax to use path.IsAbs (forward-slash) instead of filepath.IsAbs so absolute path detection works correctly on all platforms - Normalize CRLF to LF in pkg_context_test.go when reading expected output files to fix TestPkgContextGenerator on Windows - Remove unused absPath helper and os import from executor_test.go Signed-off-by: NETIZEN-11 <kumarnitesh121411@gmail.com>
- Remove duplicate dependency declarations in go.mod (apply-setters v0.2.2 and krm-functions-sdk v1.0.0) - Fix duplicate field initializations in executor_test.go hydrationContext structs - Fix malformed if statement in runMutators function (removed unclosed if block) - Implement setRenderConditionWithStatus function properly - Remove redundant RenderStatus assignment in setRenderStatus function - Remove duplicate type declarations in types.go (Status, RenderStatus, PipelineStepResult, ResultItem) - Add Resource field to ResultItem struct (required by executor.go) All compilation errors resolved and tests compile successfully. Signed-off-by: NETIZEN-11 <kumarnitesh121411@gmail.com>
✅ Deploy Preview for kptdocs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Copilot reviewed 18 out of 19 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
26041d7 to
52b4935
Compare
52b4935 to
26041d7
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 18 out of 19 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Introduce stable v1 API for ResourceGroup - Add v1/types.go with stable ResourceGroup type - Add v1/doc.go with API documentation - Mark v1alpha1 as deprecated with migration path - Maintain backward compatibility with v1alpha1 - Follow semantic versioning for API stability Part of kptdev#4450 - API Types Stabilization Signed-off-by: NETIZEN-11 <niteshkumar121411@gmail.com>
- Remove duplicate validator.Filter() call in runValidators function - Remove duplicate setRenderStatus function (keeping setRenderConditionWithStatus) - Fix code duplication issues identified in code review Resolves code review comments on PR for issue kptdev#4450 Signed-off-by: NETIZEN-11 <niteshkumar121411@gmail.com>
b55379b to
596b621
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 18 out of 19 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Please rebase this PR and please fix the failing tests. |
Description
This PR introduces the stable v1 API for ResourceGroup while maintaining full backward compatibility with v1alpha1. It marks v1alpha1 as deprecated and provides a clear migration path for users.
Part of #4450 - Stabilize kpt API to version 1
Changes Made
New Stable v1 API
pkg/api/resourcegroup/v1/types.gopkg/api/resourcegroup/v1/doc.goDeprecation of v1alpha1
pkg/api/resourcegroup/v1alpha1/types.goAPI Stability Guarantees
The v1 API provides the following guarantees:
Migration Path
Users can migrate from v1alpha1 to v1 by updating imports: