Skip to content

feat(PL-6288): add reconcile status to joy resources - #294

Merged
silphid merged 1 commit into
masterfrom
feat/PL-6288/expose-resource-statuses
Jul 30, 2026
Merged

feat(PL-6288): add reconcile status to joy resources#294
silphid merged 1 commit into
masterfrom
feat/PL-6288/expose-resource-statuses

Conversation

@silphid

@silphid silphid commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Related PRs — PL-6288

One of 3 coordinated PRs:

Merge order: merge joy → cut a joy release → re-pin joy-operator go.mod to the tag → merge joy-operator. infra can merge any time (no-ops until resources carry conditions).


What

This PR adds the API/type layer.

  • New api/v1alpha1/status.go:
    • ResourceStatus (observedGeneration + []metav1.Condition) — the shared status shape.
    • StatusObject[T] constraint so the operator can drive status updates for all resource kinds through one generic helper.
  • Status field + GetStatus() on Catalog, Environment, Release.
  • GroupVersionResource identifiers (catalogs/environments/releases/projects) in scheme.go.

Why the json:"...,omitzero" yaml:"...,omitempty" tag split

Matches the existing convention in this package (e.g. Chart, Spec, metadata). For a non-pointer struct field the two codecs differ:

  • encoding/json: omitempty is a no-op on a zero struct; omitzero (Go 1.24+) drops it.
  • gopkg.in/yaml.v3: omitempty drops a zero struct; omitzero is unsupported.

Both spellings omit an unset status, so no status: {} lands in the catalog git repo, while a populated status (written by the operator) still serializes to the Kubernetes API. The joy CLI never sets status.

Testing

  • go build ./..., go vet ./api/... clean.
  • go test ./api/... ./pkg/catalog/... pass.
  • Full go test ./... clean except TestReleaseRender/diff*, which fails identically on master (git worktree fixture requires refs not present locally) — unrelated to this change.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added status tracking to Catalog, Environment, and Release resources.
    • Added readiness condition support and observed-generation tracking.
    • Added resource identifiers for Environment, Project, Release, and Catalog resources.
    • Added a shared interface for accessing resource status information.

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: b0c001d9-805f-4b79-a1b9-dfb3cc2b0054

📥 Commits

Reviewing files that changed from the base of the PR and between 7c5a2de and 8f97c72.

📒 Files selected for processing (5)
  • api/v1alpha1/catalog.go
  • api/v1alpha1/environment.go
  • api/v1alpha1/release.go
  • api/v1alpha1/scheme.go
  • api/v1alpha1/status.go

📝 Walkthrough

Walkthrough

The v1alpha1 API adds shared resource status primitives, status accessors to Catalog, Environment, and Release, and exported GroupVersionResource identifiers for Environment, Project, Release, and Catalog.

Changes

Resource status API

Layer / File(s) Summary
Shared status and resource identity contracts
api/v1alpha1/status.go, api/v1alpha1/scheme.go
Defines ConditionReady, ResourceStatus, the generic StatusObject interface, and exported resource identifiers.
Resource status fields and accessors
api/v1alpha1/catalog.go, api/v1alpha1/environment.go, api/v1alpha1/release.go
Adds serialized Status fields and GetStatus() methods to the three resource types.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: alexstojda, davidmdm

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding reconcile status support to Joy resources.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/PL-6288/expose-resource-statuses

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Add a shared ResourceStatus (observedGeneration + conditions) and a
StatusObject[T] constraint in api/v1alpha1, exposed as a Status field with
GetStatus() on Catalog, Environment and Release, plus GroupVersionResource
identifiers in the scheme. The joy-operator populates this status so
reconcile outcomes can surface as Argo CD health.

The json/yaml tag split (omitzero for encoding/json, omitempty for yaml.v3)
keeps an unset status out of the catalog git repo while still serializing to
the Kubernetes API.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@silphid
silphid force-pushed the feat/PL-6288/expose-resource-statuses branch from acfba73 to 8f97c72 Compare July 30, 2026 13:31
@silphid silphid changed the title feat(PL6288): add reconcile status to joy resources feat(PL-6288): add reconcile status to joy resources Jul 30, 2026
@silphid
silphid marked this pull request as ready for review July 30, 2026 14:17
@silphid
silphid requested a review from greiko July 30, 2026 19:48
@silphid
silphid merged commit 98bf33f into master Jul 30, 2026
8 checks passed
@silphid
silphid deleted the feat/PL-6288/expose-resource-statuses branch July 30, 2026 20:05
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