Skip to content

feat(PL-6131): make Project CR operator compatible with apimachinery meta#281

Merged
davidmdm merged 1 commit into
masterfrom
feat/PL-6131/operator-compat
Jun 17, 2026
Merged

feat(PL-6131): make Project CR operator compatible with apimachinery meta#281
davidmdm merged 1 commit into
masterfrom
feat/PL-6131/operator-compat

Conversation

@davidmdm

@davidmdm davidmdm commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Note

Medium Risk
Changes the Project API shape and JSON/YAML metadata serialization; any external consumers or schemas expecting flat name/labels/annotations fields need to stay compatible with embedded metadata.

Overview
Project metadata now embeds metav1.ObjectMeta (same pattern as Environment / Release), replacing hand-rolled name, labels, and annotations fields so the Project CR matches Kubernetes apimachinery expectations for operator/controller tooling.

Call sites that constructed ProjectMetadata literals were updated to set ObjectMeta: metav1.ObjectMeta{Name: ...} instead of a top-level Name field; GetName() still reads project.ProjectMetadata.Name via the embedded meta.

Reviewed by Cursor Bugbot for commit fcff83e. Bugbot is set up for automated code reviews on this repo. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 6cf8cdd. Configure here.

Comment thread api/v1alpha1/project.go

// Annotations is the list of annotations for the project.
Annotations map[string]string `yaml:"annotations,omitempty" json:"annotations,omitempty"`
metav1.ObjectMeta `yaml:",inline" json:"metadata"`

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nested metadata in Project JSON

High Severity

The embedded metav1.ObjectMeta on ProjectMetadata is tagged json:"metadata", while EnvironmentMetadata and ReleaseMetadata only use yaml:",inline" on ObjectMeta. Project JSON therefore nests apimachinery fields under metadata.metadata instead of metadata.name / labels / annotations beside relativePath, which breaks the standard Kubernetes metadata shape this change is meant to support.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 6cf8cdd. Configure here.

Comment thread internal/links/provider_test.go
@davidmdm davidmdm force-pushed the feat/PL-6131/operator-compat branch from 6cf8cdd to fcff83e Compare June 17, 2026 17:59
@davidmdm davidmdm merged commit 95510f3 into master Jun 17, 2026
7 checks passed
@davidmdm davidmdm deleted the feat/PL-6131/operator-compat branch June 17, 2026 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants