Skip to content

feat: Stabilize ResourceGroup API to v1 with backward compatibility#4467

Open
NETIZEN-11 wants to merge 7 commits intokptdev:mainfrom
NETIZEN-11:feat/issue-4450-pr3-api-types
Open

feat: Stabilize ResourceGroup API to v1 with backward compatibility#4467
NETIZEN-11 wants to merge 7 commits intokptdev:mainfrom
NETIZEN-11:feat/issue-4450-pr3-api-types

Conversation

@NETIZEN-11
Copy link
Copy Markdown

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

  1. pkg/api/resourcegroup/v1/types.go

    • Introduces stable v1 ResourceGroup type
    • Defines ResourceGroupGVK() function for GroupVersionKind
    • Maintains consistent API structure with v1alpha1
    • Includes constants for file naming and inventory labels
    • Follows Kubernetes API conventions
  2. pkg/api/resourcegroup/v1/doc.go

    • Package documentation for v1 API
    • Declares API stability guarantees
    • Includes kubebuilder annotations
    • Documents semantic versioning commitment

Deprecation of v1alpha1

  1. pkg/api/resourcegroup/v1alpha1/types.go
    • Marked package as deprecated
    • Added deprecation notices to all exported types and functions
    • Provides migration path to v1 API
    • Maintains full functionality for backward compatibility
    • Will be removed in v2.0.0

API Stability Guarantees

The v1 API provides the following guarantees:

  • No breaking changes within v1.x.x versions
  • Backward compatible additions only
  • Deprecated features will be supported until v2.0.0
  • Clear migration path for all changes

Migration Path

Users can migrate from v1alpha1 to v1 by updating imports:

// Before (v1alpha1)
import "github.com/kptdev/kpt/pkg/api/resourcegroup/v1alpha1"

// After (v1)
import "github.com/kptdev/kpt/pkg/api/resourcegroup/v1"

NETIZEN-11 and others added 5 commits April 1, 2026 20:48
…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>
…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 entries for apply-setters (v0.2.2) and krm-functions-sdk (v1.0.2)
- Bump k8s.io/apiextensions-apiserver from v0.34.1 to v0.35.0 to align all k8s deps
- Remove gogo/protobuf indirect dep (no longer needed)
- Run go mod tidy to validate

Addresses reviewer feedback on PR kptdev#4432

Signed-off-by: NETIZEN-11 <kumarnitesh121411@gmail.com>
…ility

The PR bumps apply-setters to v0.2.4 in go.mod. Adding v0.2.4 to the
functions registry is required so Kptfiles referencing the new version
work with the built-in runner. v0.2.0 is kept for backward compatibility
with existing Kptfiles that already reference that version.

Also revert testdata Kptfiles back to v0.2.0 since both versions are
now supported by the functions map.

Addresses reviewer question on PR kptdev#4432

Signed-off-by: NETIZEN-11 <kumarnitesh121411@gmail.com>
Copilot AI review requested due to automatic review settings April 6, 2026 08:26
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 6, 2026

Deploy Preview for kptdocs ready!

Name Link
🔨 Latest commit ac4b1cf
🔍 Latest deploy log https://app.netlify.com/projects/kptdocs/deploys/69de64d79892d40008b0dd08
😎 Deploy Preview https://deploy-preview-4467--kptdocs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@dosubot dosubot Bot added size:XXL This PR changes 1000+ lines, ignoring generated files. enhancement New feature or request go Pull requests that update Go code labels Apr 6, 2026
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.

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.

Comment thread internal/util/render/executor.go
Comment thread internal/util/render/executor.go
@NETIZEN-11 NETIZEN-11 force-pushed the feat/issue-4450-pr3-api-types branch from 26041d7 to 52b4935 Compare April 7, 2026 13:48
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:XXL This PR changes 1000+ lines, ignoring generated files. labels Apr 7, 2026
Copilot AI review requested due to automatic review settings April 7, 2026 19:41
@NETIZEN-11 NETIZEN-11 force-pushed the feat/issue-4450-pr3-api-types branch from 52b4935 to 26041d7 Compare April 7, 2026 19:41
@dosubot dosubot Bot added size:XXL This PR changes 1000+ lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Apr 7, 2026
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

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.

Comment thread internal/util/render/executor.go
Copilot AI review requested due to automatic review settings April 7, 2026 19:55
@NETIZEN-11 NETIZEN-11 force-pushed the feat/issue-4450-pr3-api-types branch from b55379b to 596b621 Compare April 7, 2026 19:55
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

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.

@liamfallon
Copy link
Copy Markdown
Contributor

Please rebase this PR and please fix the failing tests.

Introduce stable v1 API for ResourceGroup while maintaining full
backward compatibility with v1alpha1.

Changes:
- Add pkg/api/resourcegroup/v1/ with stable ResourceGroup API
- Add v1/doc.go with API documentation
- Add v1/types.go with ResourceGroup type and ResourceGroupGVK()
- Mark v1alpha1 as deprecated with migration path
- Add deprecation notices to v1alpha1 ResourceGroupGVK()

Part of kptdev#4450 - API Types Stabilization

Signed-off-by: NETIZEN-11 <kumarnitesh121411@gmail.com>
@NETIZEN-11 NETIZEN-11 force-pushed the feat/issue-4450-pr3-api-types branch from 596b621 to 0382674 Compare April 13, 2026 21:29
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:XXL This PR changes 1000+ lines, ignoring generated files. labels Apr 13, 2026
@liamfallon
Copy link
Copy Markdown
Contributor

This PR contains dependency bumps, changes to path handling as well as adding the v1 API. Also the tests are failing.

…-api-types

Signed-off-by: NETIZEN-11 <kumarnitesh121411@gmail.com>
@NETIZEN-11 NETIZEN-11 force-pushed the feat/issue-4450-pr3-api-types branch from 5c78bf7 to ac4b1cf Compare April 14, 2026 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request go Pull requests that update Go code size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants