Jinal-Sarvaiya commented on code in PR #128:
URL: https://github.com/apache/camel-kit/pull/128#discussion_r4366369747
##########
camel-kit-core/src/main/java/io/github/luigidemasi/camelkit/generator/OpenCodeConfigMerger.java:
##########
@@ -77,7 +82,15 @@ private void removeObjectEntries(JsoncObjectEditor editor,
ObjectNode generated,
editor.removeObjectMembers(field, generatedObject.fieldNames());
}
- private String mergeGenerated(ExistingConfiguration existing, ObjectNode
generated) throws IOException {
+ private void removeCitrusEntries(JsoncObjectEditor editor) {
+ editor.removeObjectMembers("mcp",
java.util.Collections.singletonList("citrus").iterator());
+ editor.removeObjectMembers("permission",
+ List.of("citrus_*").iterator());
+ }
+
+ private String mergeGenerated(
+ ExistingConfiguration existing, ObjectNode generated, boolean
withCitrusMcp)
+ throws IOException {
if (isCurrentAndOrdered(existing, generated)) {
Review Comment:
Fixed in OpenCodeConfigMerger: mergeGenerated now computes
needsCitrusRemoval = !withCitrusMcp && hasCitrusEntries(config) and skips the
early return when removal is needed. Added three regression tests: reordered
citrus_* permissions before camel_* (triggers isCurrentAndOrdered=true), citrus
in lower opencode.json with higher opencode.jsonc layer, and permission-only
citrus remnant when the server was already removed.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]