Skip to content

[Misc] Use CAP Operator getDependency endpoint in the chart & minor updates#100

Draft
anirudhprasad-sap wants to merge 6 commits into
mainfrom
getDependencies
Draft

[Misc] Use CAP Operator getDependency endpoint in the chart & minor updates#100
anirudhprasad-sap wants to merge 6 commits into
mainfrom
getDependencies

Conversation

@anirudhprasad-sap
Copy link
Copy Markdown
Contributor

@anirudhprasad-sap anirudhprasad-sap commented May 11, 2026

Use CAP Operator getDependency Endpoint in Chart & Minor Updates

Misc

🔧 This PR updates the Helm chart to use the CAP Operator's native getDependency endpoint for dependency callbacks, replacing previously app-specific URLs. It also includes schema improvements, input validation enhancements, and dependency upgrades.

Changes

  • files/runtime-values.yaml.hbs: Updated getDependencies URL for both XSUAA (saasRegistry) and IAS (subscriptionManager) flows to use the CAP Operator endpoint format (https://{{capOperatorSubdomain}}.{{clusterDomain}}/dependencies/...), removing the app/provider subdomain-based URLs.

  • lib/util.js: Extended the ask() prompt utility to support a custom validator function parameter alongside the existing mandatory check. Refactored writeCAPApplicationCRO to remove the IAS-specific sme.sap.com/vs-route-request-header-set annotation, applying a unified annotation block for all cases.

  • bin/cap-op-plugin.js: Added an appNameValidator for non-service-only charts that enforces lowercase alphanumeric and hyphen characters (a-z, 0-9, -) for the app name prompt.

  • hack/schema-generation.go: Added a SubscriptionDependencyMode type with Auto/Always/Never enum values. Extended serviceInstanceExt with a subscriptionDependency field. Fixed schema post-processing for FieldsV1, Duration, Time, and IntOrString types. Switched JSON marshaling to indented format and appended trailing newlines to output files.

  • files/chart/values.schema.json & files/configurableTemplatesChart/values.schema.json: Added subscriptionDependency enum field to service instance schema. Added enableCleanupMonitoring boolean to app schema. Fixed Duration, Time, FieldsV1, and IntOrString type definitions. Added startupProbe reference to workload schema.

  • hack/go.mod / hack/go.sum: Bumped Go to 1.26.3, updated cap-operator to v0.29.1, sap-btp-service-operator to v0.10.7, invopop/jsonschema to v0.14.0, and various indirect dependencies including k8s.io/* to v0.36.0 and controller-runtime to v0.24.0.

  • test/cap-op-plugin.test.js: Added a new test case validating that an invalid app name (containing uppercase letters) triggers the validation error 'Only a-z, 0-9 and - are allowed'.

  • test/files/expectedChart/* & test/files/expectedConfigurableTemplatesChart/*: Updated expected runtime values and CRO templates to reflect the new CAP Operator dependency URLs and removal of the IAS-specific annotation.

  • 🔄 Regenerate and Update Summary
PR Bot Information

Version: 1.20.43

  • Correlation ID: 3e886b12-1f13-4a3a-b4ce-2d3e72d382c8
  • Summary Prompt: Default Prompt
  • Output Template: Default Template
  • LLM: anthropic--claude-4.6-sonnet
  • File Content Strategy: Full file content
  • Event Trigger: pull_request.opened

…ration

- Introduced SubscriptionDependencyMode with values Auto, Always, and Never.
- Updated serviceInstanceExt to include SubscriptionDependency.
- Modified schema generation to reflect changes in FieldsV1, Duration, Time, and IntOrString definitions.
- Changed JSON marshaling to use indentation for better readability.
- Ensured that generated schema files include a newline at the end.

refactor(util): enhance prompt validation in ask function

- Updated the ask function to support custom validators alongside mandatory checks.
- Simplified the validation logic for user input.

test: add validation test for runtime-values generation

- Implemented a test case to ensure invalid app names raise appropriate errors during runtime-values generation.
- Updated expected runtime-values YAML files to reflect new callback URLs.

chore: clean up unnecessary annotations in templates

- Removed commented-out annotations related to x-forwarded-client-cert from CAPApplication templates.
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 makes several good changes: updating dependency endpoints to use the CAP Operator's centralized routes, adding startupProbe and subscriptionDependency schema fields, fixing schema types for Duration/Time/IntOrString/FieldsV1, and adding input validation for the app name prompt. Two issues were found: (1) the custom validator in lib/util.js is invoked even for empty optional fields, which could surface misleading format errors on fields the user intentionally left blank; and (2) the app name format validation is skipped entirely for service-only charts even though the app name is still used in domain/URL construction where the same character constraints apply.

PR Bot Information

Version: 1.20.43

  • LLM: anthropic--claude-4.6-sonnet
  • Correlation ID: 3e886b12-1f13-4a3a-b4ce-2d3e72d382c8
  • Event Trigger: pull_request.opened
  • File Content Strategy: Full file content

Comment thread lib/util.js
Comment thread bin/cap-op-plugin.js
@anirudhprasad-sap anirudhprasad-sap marked this pull request as draft May 15, 2026 14:01
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.

1 participant