Skip to content

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

Merged
anirudhprasad-sap merged 7 commits into
mainfrom
getDependencies
May 20, 2026
Merged

[Misc] Use CAP Operator getDependency endpoint in the chart & minor updates#100
anirudhprasad-sap merged 7 commits into
mainfrom
getDependencies

Conversation

@anirudhprasad-sap
Copy link
Copy Markdown
Contributor

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

v0.16.0: Use CAP Operator getDependency Endpoint & Schema Improvements

New Feature / Misc

🔧 This release updates the Helm chart to use the CAP Operator's native getDependencies endpoint for subscription dependency callbacks (replacing app/provider subdomain-based URLs), adds SubscriptionDependencyMode support to service instances, improves input validation for app names, and bumps several dependencies.

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 provider subdomain-based callback URLs.

  • lib/util.js: Extended the ask() prompt utility to support a custom validator function. Simplified writeCAPApplicationCRO by removing the IAS-specific sme.sap.com/vs-route-request-header-set annotation and the OptionalMutual TLS certificate config, applying a unified annotation block and always using tlsMode: Simple.

  • bin/cap-op-plugin.js: Added appNameValidator for non-service-only charts enforcing lowercase alphanumeric and hyphen characters (^[a-z0-9-]+$). Validation now applies both in interactive prompts and when using --with-input-yaml.

  • hack/schema-generation.go: Added SubscriptionDependencyMode type (Auto/Always/Never). Fixed schema post-processing for FieldsV1, Duration, Time, and IntOrString types. Switched to indented JSON marshaling 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 k8s.io/* to v0.36.0, controller-runtime to v0.24.0.

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

  • test/files/domain-ias.yaml: Removed — IAS-specific domain template no longer needed; tests now reference the unified domain.yaml.

  • README.md: Rewrote the "Configure Your Chart" section with clearer design-time vs. runtime value documentation, added subscriptionDependency references, and documented the appName character restriction.

  • package.json / package-lock.json / CHANGELOG.md: Bumped version to 0.16.0.

  • 🔄 Regenerate and Update Summary
PR Bot Information

Version: 1.20.47

  • Correlation ID: 532e0a7c-ca3e-48fe-bc1d-f84427123d45
  • Event Trigger: issue_comment.edited

…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
@anirudhprasad-sap anirudhprasad-sap marked this pull request as ready for review May 19, 2026 08:04
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 is generally well-structured with clear, coherent changes. The main substantive issues found are: the validator in lib/util.js passes the raw (non-trimmed) value to the custom validator function, creating an inconsistency with the mandatory check; the --with-input-yaml invalid-appName path lacks test coverage; and the jsonschema enum tag on SubscriptionDependency alongside the named type may interact unexpectedly with invopop/jsonschema v0.14.0 and should be verified against the actual generated output.

PR Bot Information

Version: 1.20.47

  • Event Trigger: pull_request.ready_for_review
  • Correlation ID: 9e0110a0-382b-424e-8747-a0c5c0915fb0
  • LLM: anthropic--claude-4.6-sonnet
  • File Content Strategy: Full file content

Comment thread lib/util.js Outdated
Comment thread bin/cap-op-plugin.js
Comment thread test/cap-op-plugin.test.js
Comment thread hack/schema-generation.go
@anirudhprasad-sap anirudhprasad-sap enabled auto-merge (squash) May 20, 2026 12:34
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 4f508c7 into main May 20, 2026
6 of 7 checks passed
@anirudhprasad-sap anirudhprasad-sap deleted the getDependencies branch May 20, 2026 14:24
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