Skip to content

[Misc] Add enableCleanupMonitoring configuration support & serviceExposure restriction removal#97

Merged
anirudhprasad-sap merged 7 commits intomainfrom
cavCleanupConfigurable
Apr 28, 2026
Merged

[Misc] Add enableCleanupMonitoring configuration support & serviceExposure restriction removal#97
anirudhprasad-sap merged 7 commits intomainfrom
cavCleanupConfigurable

Conversation

@anirudhprasad-sap
Copy link
Copy Markdown
Contributor

@anirudhprasad-sap anirudhprasad-sap commented Apr 24, 2026

@hyperspace-insights
Copy link
Copy Markdown
Contributor

hyperspace-insights Bot commented Apr 24, 2026

Summary

The following content is AI-generated and provides a summary of the pull request:


Add enableCleanupMonitoring Configuration & Remove serviceExposures Chart-Type Restriction

New Features

✨ This PR introduces two enhancements to the CAP Operator plugin:

  1. enableCleanupMonitoring support: Adds the sme.sap.com/enable-cleanup-monitoring annotation to CAPApplication resources, defaulting to true. This allows the CAP Operator to automatically clean up stale CAPApplicationVersion resources that accumulate after Helm upgrades or ArgoCD syncs.

  2. Unrestricted serviceExposures generation: Removes the service-only chart type guard on the serviceExposures block in the configurable templates chart. The block is already wrapped in a conditional ({{- if .Values.serviceExposures }}), so it has no effect when not configured — enabling multi-tenant apps with approuters to use direct ingress routes for BTP callbacks.

  3. ttlSecondsAfterFinished: 300 is now set as a default on all job workloads (TenantOperation, Content, ams-deployer) to ensure finished Kubernetes jobs are cleaned up automatically.

Changes

  • lib/util.js: Added sme.sap.com/enable-cleanup-monitoring annotation unconditionally (both IAS and non-IAS paths); removed isService guard on serviceExposures in configurable templates; added ttlSecondsAfterFinished: 300 default to all job workload definitions via a Helm merge.
  • files/chart/values.yaml.hbs & files/configurableTemplatesChart/values.yaml.hbs: Added enableCleanupMonitoring: true default under the app section.
  • files/chart/values.schema.json & files/configurableTemplatesChart/values.schema.json: Added enableCleanupMonitoring boolean field to the app schema definition.
  • hack/schema-generation.go: Added EnableCleanupMonitoring field to the app struct for schema generation.
  • test/files/expected*: Updated all expected chart templates and values files to reflect the new annotation, ttlSecondsAfterFinished, and unrestricted serviceExposures output.

Jira Issues

  • #95: serviceExposures Only Generated for Service-Only Charts
  • #96: Missing enable-cleanup-monitoring Annotation on CAPApplication

  • 🔄 Regenerate and Update Summary
  • ✏️ Insert as PR Description (deletes this comment)
  • 🗑️ Delete comment
PR Bot Information

Version: 1.20.33

Copy link
Copy Markdown
Contributor

@hyperspace-insights hyperspace-insights Bot left a comment

Choose a reason for hiding this comment

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

The PR adds enableCleanupMonitoring support across schemas, the Go struct, template generation logic, and test fixtures. The implementation is consistent and the logic is correct.

One minor gap worth noting: the new enableCleanupMonitoring boolean field is defined in both values.schema.json files and used in the generated Helm templates, but it is not added to either values.yaml.hbs template (files/chart/values.yaml.hbs and files/configurableTemplatesChart/values.yaml.hbs). As a result, users have no indication this opt-in field exists, and there is no explicit false default in the generated values.yaml. Every other app-level field has a commented entry in those templates. Consider adding # -- Enable cleanup monitoring for the CAP application / enableCleanupMonitoring: false under the app: section in both .hbs files to improve discoverability and self-documentation of the chart.

PR Bot Information

Version: 1.20.33

  • LLM: anthropic--claude-4.6-sonnet
  • Correlation ID: 49f5bc57-b60f-42a3-8257-ad58068c3247
  • Event Trigger: pull_request.opened
  • File Content Strategy: Full file content

@anirudhprasad-sap anirudhprasad-sap changed the title [Misc] Add enableCleanupMonitoring configuration support [Misc] Add enableCleanupMonitoring configuration support & serviceExposure restriction removal Apr 24, 2026
@Pavan-SAP Pavan-SAP linked an issue Apr 24, 2026 that may be closed by this pull request
@anirudhprasad-sap anirudhprasad-sap force-pushed the cavCleanupConfigurable branch 2 times, most recently from fb4fbd7 to d9c3018 Compare April 27, 2026 13:45
@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown
Contributor

@Pavan-SAP Pavan-SAP left a comment

Choose a reason for hiding this comment

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

@anirudhprasad-sap anirudhprasad-sap merged commit 0c60581 into main Apr 28, 2026
9 checks passed
@anirudhprasad-sap anirudhprasad-sap deleted the cavCleanupConfigurable branch April 28, 2026 11:38
@Pavan-SAP Pavan-SAP linked an issue Apr 29, 2026 that may be closed by this pull request
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.

Missing enable-cleanup-monitoring Annotation on CAPApplication serviceExposures Only Generated for Service-Only Charts

2 participants