Skip to content

Patch python strings in java - #14044

Merged
weizhouapache merged 3 commits into
apache:mainfrom
DaanHoogland:patch-1
Sep 3, 2026
Merged

Patch python strings in java#14044
weizhouapache merged 3 commits into
apache:mainfrom
DaanHoogland:patch-1

Conversation

@DaanHoogland

@DaanHoogland DaanHoogland commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Description

This PR solved a code generated issue where java strings are interpreted in python and this break escaping. an alternative is use puthon multiline strings which would work as java concatenated string, but would be confusing (i.e. ‘\”.”””’)

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

How did you try to break this feature and the system with this change?

chunkyen and others added 2 commits August 18, 2026 06:19
…lates in createKubernetesCluster

Add usage examples to the @parameter descriptions for nodeofferings and
nodetemplates in CreateKubernetesClusterCmd.java, showing how to specify
different service offerings and templates for control vs worker nodes.

Discussion: apache#13395
@DaanHoogland DaanHoogland changed the title Patch 1 Patch python strings in java Sep 3, 2026
@DaanHoogland DaanHoogland added this to the 24.0.0 milestone Sep 3, 2026
@DaanHoogland
DaanHoogland marked this pull request as ready for review September 3, 2026 10:44
Copilot AI lite review requested due to automatic review settings September 3, 2026 10:44
@codecov

codecov Bot commented Sep 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 19.78%. Comparing base (b7a834b) to head (77d44ef).

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #14044      +/-   ##
============================================
- Coverage     19.78%   19.78%   -0.01%     
+ Complexity    19998    19988      -10     
============================================
  Files          6371     6371              
  Lines        575899   575899              
  Branches      70495    70495              
============================================
- Hits         113967   113915      -52     
- Misses       449501   449557      +56     
+ Partials      12431    12427       -4     
Flag Coverage Δ
uitests 3.53% <ø> (ø)
unittests 21.05% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

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.

🟡 Changes recommended

The updated examples include single quotes around values, which would be interpreted literally if copied into real API requests and can mislead users.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR updates the CloudStack Kubernetes cluster creation API parameter descriptions to avoid problematic quoting/escaping in generated documentation (as described, Java strings being interpreted/escaped incorrectly in a Python-based generation step).

Changes:

  • Adjusted the nodeofferings[...] example string in NODE_TYPE_OFFERING_MAP parameter documentation.
  • Adjusted the nodetemplates[...] example string in NODE_TYPE_TEMPLATE_MAP parameter documentation.
File summaries
File Description
plugins/integrations/kubernetes-service/src/main/java/org/apache/cloudstack/api/command/user/kubernetes/cluster/CreateKubernetesClusterCmd.java Updates API parameter description examples for node offering/template maps to change quoting/escaping behavior in generated docs.
Review details

Suppressed comments (1)

plugins/integrations/kubernetes-service/src/main/java/org/apache/cloudstack/api/command/user/kubernetes/cluster/CreateKubernetesClusterCmd.java:129

  • The nodetemplates example uses single quotes around values (node='control', template=''), which would be interpreted as literal quotes if copied into a real request. To avoid misleading API users (and to match other examples in this class), remove the quotes and show raw values/placeholders instead.
            description = "(Optional) Node Type to Template ID mapping. If provided, it overrides the default template: System VM template. " +
                    "Example: nodetemplates[0].node='control'&nodetemplates[0].template='<template-uuid>'&" +
                    "nodetemplates[1].node='worker'&nodetemplates[1].template='<template-uuid>'",
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines 119 to +121
description = "(Optional) Node Type to Service Offering ID mapping. If provided, it overrides the serviceofferingid parameter. " +
"Example: nodeofferings[0].node=\"control\"&nodeofferings[0].offering=\"<service-offering-uuid>\"&" +
"nodeofferings[1].node=\"worker\"&nodeofferings[1].offering=\"<service-offering-uuid>\"",
"Example: nodeofferings[0].node='control'&nodeofferings[0].offering='<service-offering-uuid>'&" +
"nodeofferings[1].node='worker'&nodeofferings[1].offering='<service-offering-uuid>'",
@weizhouapache
weizhouapache merged commit 44ab7dd into apache:main Sep 3, 2026
25 of 27 checks passed
@DaanHoogland
DaanHoogland deleted the patch-1 branch September 3, 2026 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants