Skip to content

fix(PL-6888): generate different catalog apps per service#25

Merged
davidmdm merged 2 commits into
masterfrom
fix/PL-6888/fix-syncPolicy-defaults
Jul 20, 2026
Merged

fix(PL-6888): generate different catalog apps per service#25
davidmdm merged 2 commits into
masterfrom
fix/PL-6888/fix-syncPolicy-defaults

Conversation

@davidmdm

@davidmdm davidmdm commented Jul 20, 2026

Copy link
Copy Markdown
Contributor
  • fix(PL-6888): add chart version to helm puller logs
  • fix(PL-6888): generate different catalog app by service prefixed by service name

Summary by CodeRabbit

  • New Features
    • Added a service name setting for deployments, automatically derived from the release name.
    • Catalog applications created during reconciliation now use the configured service name as a naming prefix, improving identification across installations.
  • Improvements
    • Successful chart-pull logs now include the chart version alongside its URL, making deployment activity easier to track.
  • Maintenance
    • Updated deployment validation to reflect the new service naming behavior.

@davidmdm
davidmdm requested a review from silphid July 20, 2026 19:59
@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The chart now exposes the Helm release name as SERVICE_NAME. The operator reads and propagates it to catalog reconciliation, which prefixes applied Argo CD Application names. Integration expectations, Docker exclusions, and chart-pull logging are updated.

Changes

Service name propagation

Layer / File(s) Summary
Service name configuration and chart contract
chart/templates/deployment.yaml, chart/tests/*/expected.yaml, cmd/operator/conf.go
The Deployment renders SERVICE_NAME from the Helm release name, and operator configuration reads it with a development default.
Reconciler service name propagation
cmd/operator/reconciler_catalog.go, cmd/operator/main.go
ServiceName is passed into the catalog reconciler and prefixes applied catalog Application names.
Release-based integration test expectations
cmd/operator/main_test.go
Integration tests use the renamed release, Deployment, and catalog Application identifiers.

Build context and pull logging

Layer / File(s) Summary
Build and chart-pull metadata updates
.dockerignore, cmd/operator/puller.go
Go test files are excluded from the Docker context, and successful chart-pull logs include chart version information.

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

Suggested reviewers: silphid

Sequence Diagram(s)

sequenceDiagram
  participant Helm
  participant Deployment
  participant Operator
  participant CatalogReconciler
  participant ArgoCD
  Helm->>Deployment: render SERVICE_NAME from release name
  Deployment->>Operator: provide SERVICE_NAME
  Operator->>CatalogReconciler: pass cfg.ServiceName
  CatalogReconciler->>ArgoCD: apply prefixed catalog Application
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: generating distinct catalog apps per service.
✨ 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 fix/PL-6888/fix-syncPolicy-defaults

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

@coderabbitai coderabbitai 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@cmd/operator/main_test.go`:
- Around line 634-638: Update the polling interval passed to EventuallyNoErrorf
in the appsIntf.Get test from 50 seconds to a millisecond-scale duration,
keeping it shorter than the existing 2-second timeout so retries occur before
the test expires.

In `@cmd/operator/reconciler_catalog.go`:
- Line 53: Use a single prefixed Application name consistently across the apply
and delete branches in the reconciler, reusing the naming construction from the
apply path near Name and updating the delete logic accordingly. Add an upgrade
cleanup or migration path for existing unprefixed applications so disabling pull
mode removes both naming variants when applicable.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 6a3e5007-4278-494f-8488-0380ccc11726

📥 Commits

Reviewing files that changed from the base of the PR and between da1f61c and 50e5213.

📒 Files selected for processing (9)
  • .dockerignore
  • chart/templates/deployment.yaml
  • chart/tests/common-labels/expected.yaml
  • chart/tests/standard/expected.yaml
  • cmd/operator/conf.go
  • cmd/operator/main.go
  • cmd/operator/main_test.go
  • cmd/operator/puller.go
  • cmd/operator/reconciler_catalog.go

Comment thread cmd/operator/main_test.go
Comment on lines +634 to 638
_, err := appsIntf.Get(t.Context(), "joy-operator-tests-catalog", metav1.GetOptions{})
return err
},
50*time.Second,
2*time.Second,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Use a millisecond polling interval.

The test polls every 50*time.Second but times out after 2*time.Second. After an initial transient failure, EventuallyNoErrorf waits 50 seconds before retrying, so the test cannot honor its timeout and can stall CI.

Proposed fix
-			50*time.Second,
+			50*time.Millisecond,
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
_, err := appsIntf.Get(t.Context(), "joy-operator-tests-catalog", metav1.GetOptions{})
return err
},
50*time.Second,
2*time.Second,
_, err := appsIntf.Get(t.Context(), "joy-operator-tests-catalog", metav1.GetOptions{})
return err
},
50*time.Millisecond,
2*time.Second,
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@cmd/operator/main_test.go` around lines 634 - 638, Update the polling
interval passed to EventuallyNoErrorf in the appsIntf.Get test from 50 seconds
to a millisecond-scale duration, keeping it shorter than the existing 2-second
timeout so retries occur before the test expires.

},
ObjectMeta: metav1.ObjectMeta{
Name: event.Name,
Name: params.ServiceName + "-" + event.Name,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Use one Application name for both apply and delete.

Line 53 creates {SERVICE_NAME}-{catalog} applications, but the delete branch at Lines 81-83 still deletes only event.Name. If pull mode is disabled after an application was created, the prefixed Application remains and may continue syncing. Existing unprefixed applications also need an explicit migration or cleanup path during upgrade.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@cmd/operator/reconciler_catalog.go` at line 53, Use a single prefixed
Application name consistently across the apply and delete branches in the
reconciler, reusing the naming construction from the apply path near Name and
updating the delete logic accordingly. Add an upgrade cleanup or migration path
for existing unprefixed applications so disabling pull mode removes both naming
variants when applicable.

},
ObjectMeta: metav1.ObjectMeta{
Name: event.Name,
Name: params.ServiceName + "-" + event.Name,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you please elaborate why? 🙏

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Because otherwise we cannot have two different deployments generating different app-of-apps for the catalog (watching different envs)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

OK, but wouldn't that break the other reconcilers that expect catalog as the Catalog name?

@davidmdm davidmdm changed the title fix/PL 6888/fix syncPolicy defaults fix(PL-6888): generate different catalog apps per service Jul 20, 2026
@davidmdm
davidmdm enabled auto-merge (rebase) July 20, 2026 20:34
@davidmdm
davidmdm merged commit 9ca9119 into master Jul 20, 2026
7 checks passed
@davidmdm
davidmdm deleted the fix/PL-6888/fix-syncPolicy-defaults branch July 20, 2026 20:34
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