Skip to content

Comments

[Misc] Plugin: providerSubaccountId runtime support added#85

Open
Pavan-SAP wants to merge 1 commit intomainfrom
provider-appId
Open

[Misc] Plugin: providerSubaccountId runtime support added#85
Pavan-SAP wants to merge 1 commit intomainfrom
provider-appId

Conversation

@Pavan-SAP
Copy link
Contributor

@Pavan-SAP Pavan-SAP commented Feb 20, 2026

Add providerSubaccountId Runtime Support to CAP Operator Plugin

New Features

✨ Added support for the providerSubaccountId field across the CAP Operator plugin to prepare for its transition to a mandatory field in upcoming releases.

Changes

This pull request introduces the providerSubaccountId parameter throughout the CAP Operator plugin infrastructure, ensuring it is properly handled in runtime value generation, schema validation, and template files.

  • bin/cap-op-plugin.js: Added providerSubaccountId to required fields for both service-only and full application charts, and included a new interactive prompt to capture the provider sub-account ID during runtime value generation.

  • files/chart/values.yaml.hbs & files/configurableTemplatesChart/values.yaml.hbs: Added providerSubaccountId field with documentation comment to the BTP configuration section, changing globalAccountId from mandatory (with inline comment) to optional.

  • files/chart/values.schema.json & files/configurableTemplatesChart/values.schema.json: Removed globalAccountId from the required fields array in the BTP schema definition and added providerSubaccountId as an optional string property.

  • files/runtime-values.yaml.hbs: Added providerSubaccountId interpolation to the BTP section of the runtime values template.

  • hack/schema-generation.go: Modified the btp struct to make GlobalAccountId optional (using omitempty tag) while keeping ProviderSubaccountId as an optional field.

  • test/cap-op-plugin.test.js: Updated all test cases to include the new providerSubaccountId prompt response, adjusting the call sequence indices for subsequent prompts across multiple chart type scenarios (standard, configurable templates, service-only, and IAS variants).

  • Test fixture files (test/files/expectedChart/*.yaml, test/files/expectedConfigurableTemplatesChart/*.yaml, test/files/*.yaml): Updated all expected output files and test input files to include the providerSubaccountId field in the BTP configuration section, ensuring consistency across all test scenarios.

  • 🔄 Regenerate and Update Summary

📬 Subscribe to the Hyperspace PR Bot DL to get the latest announcements and pilot features!

PR Bot Information

Version: 1.17.61 | 📖 Documentation | 🚨 Create Incident | 💬 Feedback

  • Correlation ID: 22c55c60-0e78-11f1-93f0-b05e7cda2838
  • Event Trigger: issue_comment.edited


type btp struct {
GlobalAccountId string `json:"globalAccountId"`
GlobalAccountId string `json:"globalAccountId,omitempty"`
Copy link
Contributor Author

@Pavan-SAP Pavan-SAP Feb 20, 2026

Choose a reason for hiding this comment

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

I was thinking perhaps we should for now leave both as required instead, but maybe optional is better for now?

minor enhancement to source `providerSubaccountId`.
- misc adjustments until the field becomes mandatory (soon).
@sonarqubecloud
Copy link

Copy link
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 review has identified a logic inconsistency between the plugin's validation logic and the schema definitions. The globalAccountId field is treated as required in the JavaScript plugin but made optional in the schema files, creating a mismatch that could cause confusion or unexpected validation failures.

PR Bot Information

Version: 1.17.61 | 📖 Documentation | 🚨 Create Incident | 💬 Feedback

  • Event Trigger: pull_request.opened
  • Correlation ID: 739f8540-0e76-11f1-832a-48ca17e8817a
  • LLM: anthropic--claude-4.5-sonnet

Comment on lines +187 to +188
? ['appName', 'capOperatorSubdomain', 'clusterDomain', 'globalAccountId', 'providerSubaccountId']
: ['appName', 'capOperatorSubdomain', 'clusterDomain', 'globalAccountId', 'providerSubaccountId', 'providerSubdomain', 'tenantId']
Copy link
Contributor

Choose a reason for hiding this comment

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

Logic Error: Inconsistency in globalAccountId required status

The globalAccountId is listed as a required field here (lines 187-188), but in the schema files (files/chart/values.schema.json and files/configurableTemplatesChart/values.schema.json), it has been removed from the required array, and in hack/schema-generation.go:47 it's marked with omitempty. This creates an inconsistency where the plugin will reject YAML files missing globalAccountId even though the schema allows it to be optional.

Either globalAccountId should remain required in all places, or it should be made optional everywhere. Based on the PR description mentioning "misc adjustments until the field becomes mandatory (soon)", it appears both fields should be optional for now.

Suggested change
? ['appName', 'capOperatorSubdomain', 'clusterDomain', 'globalAccountId', 'providerSubaccountId']
: ['appName', 'capOperatorSubdomain', 'clusterDomain', 'globalAccountId', 'providerSubaccountId', 'providerSubdomain', 'tenantId']
const requiredFields = isServiceOnly
? ['appName', 'capOperatorSubdomain', 'clusterDomain', 'providerSubaccountId']
: ['appName', 'capOperatorSubdomain', 'clusterDomain', 'providerSubaccountId', 'providerSubdomain', 'tenantId']

Double-check suggestion before committing. Edit this comment for amendments.


Please provide feedback on the review comment by checking the appropriate box:

  • 🌟 Awesome comment, a human might have missed that.
  • ✅ Helpful comment
  • 🤷 Neutral
  • ❌ This comment is not helpful

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