You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kie.apache.org by "ljmotta (via GitHub)" <gi...@apache.org> on 2026/02/03 23:20:46 UTC

Re: [PR] kie-issue#2216: Dev Deployments: Support recursive/nested token interpolation and remove non-standard JSON Patch operation [incubator-kie-tools]

ljmotta commented on code in PR #3403:
URL: https://github.com/apache/incubator-kie-tools/pull/3403#discussion_r2761446022


##########
packages/k8s-yaml-to-apiserver-requests/tests/jsonPatch/patchK8sResourceYaml.test.ts:
##########


Review Comment:
   Please consider inlining the test case values or creating a test table with clear given / expected fields. The current structure makes it difficult to visualize the different test scenarios.
   
   Test table example (property names are just a suggestion):
   ```ts
   [{
       name: "should add a label to existing labels",
       given: {
           yaml: `
   apiVersion: apps/v1
   kind: Deployment
   metadata:
     name: my-app
     labels:
       app: my-app
   spec:
     replicas: 1`,
           patch: [{
               op: "add",
               path: "/metadata/labels/environment",
               value: "production",
           }]
       },
       expected: "environment: production"
   },
   // ...
   ]
   ```
   
   Alternatively, inlining the values directly in the test cases would also be fine, even if it means duplicating some content between tests:
   ```ts
       it("should add a label to existing labels", () => {
           const result = patchK8sResourceYaml(`
   apiVersion: apps/v1
   kind: Deployment
   metadata:
     name: my-app
     labels:
       app: my-app
   spec:
     replicas: 1`, [{
               jsonPatches: [{
                   op: "add",
                   path: "/metadata/labels/environment",
                   value: "production",
               }]}]);
   
           expect(result).toContain("environment: production");
       });
   
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org