Skip to content

Allow users to specify a commit summary when mutating xDS resources - #1332

Merged
minwoox merged 3 commits into
line:mainfrom
minwoox:xds_commit_summary
Jul 14, 2026
Merged

Allow users to specify a commit summary when mutating xDS resources#1332
minwoox merged 3 commits into
line:mainfrom
minwoox:xds_commit_summary

Conversation

@minwoox

@minwoox minwoox commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Motivation:

There was no way to specify a commit for xds resource update.

Modifications:

  • Add an optional summary field to all xDS Create/Update/Delete request proto messages (cluster, listener, route, endpoint, group, k8s). The field is a query parameter in the HTTP-JSON transcoding because the request body is already mapped to the resource message.

Result:

  • You can now enter a free-form commit summary when creating, updating, or deleting an xDS resource.

Motivation:

There was no way to specify a commit for xds resource update.

Modifications:

- Add an optional `summary` field to all xDS Create/Update/Delete
  request proto messages (cluster, listener, route, endpoint, group,
  k8s). The field is a query parameter in the HTTP-JSON transcoding
  because the request body is already mapped to the resource message.

Result:

- You can now enter a free-form commit summary when creating, updating,
or deleting an xDS resource.
@minwoox minwoox added this to the 0.85.0 milestone Jul 13, 2026
@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 4a1d3f9d-40b7-479c-9db5-46f0f7da1dea

📥 Commits

Reviewing files that changed from the base of the PR and between dd1d751 and d2f4784.

📒 Files selected for processing (6)
  • webapp/src/dogma/features/xds/xdsApiSlice.ts
  • xds/src/main/java/com/linecorp/centraldogma/xds/cluster/v1/XdsClusterService.java
  • xds/src/main/java/com/linecorp/centraldogma/xds/endpoint/v1/XdsEndpointService.java
  • xds/src/main/java/com/linecorp/centraldogma/xds/k8s/v1/XdsKubernetesService.java
  • xds/src/main/java/com/linecorp/centraldogma/xds/listener/v1/XdsListenerService.java
  • xds/src/main/java/com/linecorp/centraldogma/xds/route/v1/XdsRouteService.java
🚧 Files skipped from review as they are similar to previous changes (6)
  • xds/src/main/java/com/linecorp/centraldogma/xds/endpoint/v1/XdsEndpointService.java
  • xds/src/main/java/com/linecorp/centraldogma/xds/k8s/v1/XdsKubernetesService.java
  • xds/src/main/java/com/linecorp/centraldogma/xds/route/v1/XdsRouteService.java
  • xds/src/main/java/com/linecorp/centraldogma/xds/cluster/v1/XdsClusterService.java
  • xds/src/main/java/com/linecorp/centraldogma/xds/listener/v1/XdsListenerService.java
  • webapp/src/dogma/features/xds/xdsApiSlice.ts

📝 Walkthrough

Walkthrough

xDS request schemas, backend services, frontend API mutations, and editors now support optional commit summaries for create, update, and delete operations, with default summaries retained when no value is provided.

Changes

xDS commit summary flow

Layer / File(s) Summary
Request summary contracts
xds/src/main/proto/centraldogma/xds/...
Create, update, and delete request messages add optional summary fields.
Backend summary propagation
xds/src/main/java/com/linecorp/centraldogma/xds/...
Services use request summaries when non-empty and otherwise retain operation-specific defaults.
Frontend API summary transport
webapp/src/dogma/features/xds/xdsApiSlice.ts
Resource and Kubernetes aggregator mutations accept summaries and append URL-encoded query parameters.
Editor summary controls
webapp/src/dogma/features/xds/ResourceEditor.tsx, webapp/src/dogma/features/xds/K8sAggregatorEditor.tsx, webapp/src/dogma/common/components/DeleteConfirmationModal.tsx
Create, update, and delete editors collect summaries, pass them to mutations, reset state, and render summary content in delete dialogs.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Editor
  participant FrontendAPI
  participant XdsService
  participant ResourceManager
  Editor->>FrontendAPI: mutation with optional summary
  FrontendAPI->>XdsService: request with summary query or field
  XdsService->>XdsService: select provided or default summary
  XdsService->>ResourceManager: create, update, or delete with summary
Loading

Suggested reviewers: jrhee17, ikhoon, trustin

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding user-specified commit summaries for xDS mutations.
Description check ✅ Passed The description is directly related to the changeset and accurately describes the added summary fields and query parameter behavior.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
xds/src/main/java/com/linecorp/centraldogma/xds/cluster/v1/XdsClusterService.java (1)

18-18: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Extract the repeated summary-fallback logic into a shared helper.

The isNullOrEmpty(request.getSummary()) ? "<Verb> <type>: " + name : request.getSummary() pattern is duplicated identically 3× in this file and repeats across XdsEndpointService, XdsKubernetesService, XdsListenerService, and XdsRouteService (15 occurrences total). A single shared helper would remove this duplication and also lets you fix the edge case where a whitespace-only summary (e.g. a single space) is currently treated as "non-empty" and used verbatim instead of falling back to the default.

♻️ Proposed helper (e.g. add to a shared xDS service utility)
+    static String summaryOrDefault(String summary, String defaultSummary) {
+        return isNullOrEmpty(summary) || summary.trim().isEmpty() ? defaultSummary : summary;
+    }

Then in each call site:

-        final String createSummary = isNullOrEmpty(request.getSummary()) ?
-                                     "Create cluster: " + clusterName : request.getSummary();
+        final String createSummary = summaryOrDefault(request.getSummary(), "Create cluster: " + clusterName);

Also applies to: 82-107

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@xds/src/main/java/com/linecorp/centraldogma/xds/cluster/v1/XdsClusterService.java`
at line 18, Extract the repeated summary construction used by XdsClusterService
and the related xDS service classes into one shared helper. Have the helper
treat null, empty, and whitespace-only summaries as missing, then generate the
existing verb/type/name fallback; otherwise preserve the supplied summary.
Replace all 15 duplicated call sites with the helper.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@xds/src/main/proto/centraldogma/xds/group/v1/xds_group.proto`:
- Around line 50-51: Propagate the optional summary through the group mutation
flow before exposing the proto fields: update XdsGroupService.createGroup and
deleteGroup to consume request.getSummary(), and extend the frontend group
mutations to send the summary through to those requests so custom operation
summaries are applied instead of ignored.

---

Nitpick comments:
In
`@xds/src/main/java/com/linecorp/centraldogma/xds/cluster/v1/XdsClusterService.java`:
- Line 18: Extract the repeated summary construction used by XdsClusterService
and the related xDS service classes into one shared helper. Have the helper
treat null, empty, and whitespace-only summaries as missing, then generate the
existing verb/type/name fallback; otherwise preserve the supplied summary.
Replace all 15 duplicated call sites with the helper.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d1b1438c-6482-498a-9741-e4463840d0d6

📥 Commits

Reviewing files that changed from the base of the PR and between e939b05 and dd1d751.

📒 Files selected for processing (15)
  • webapp/src/dogma/common/components/DeleteConfirmationModal.tsx
  • webapp/src/dogma/features/xds/K8sAggregatorEditor.tsx
  • webapp/src/dogma/features/xds/ResourceEditor.tsx
  • webapp/src/dogma/features/xds/xdsApiSlice.ts
  • xds/src/main/java/com/linecorp/centraldogma/xds/cluster/v1/XdsClusterService.java
  • xds/src/main/java/com/linecorp/centraldogma/xds/endpoint/v1/XdsEndpointService.java
  • xds/src/main/java/com/linecorp/centraldogma/xds/k8s/v1/XdsKubernetesService.java
  • xds/src/main/java/com/linecorp/centraldogma/xds/listener/v1/XdsListenerService.java
  • xds/src/main/java/com/linecorp/centraldogma/xds/route/v1/XdsRouteService.java
  • xds/src/main/proto/centraldogma/xds/cluster/v1/xds_cluster.proto
  • xds/src/main/proto/centraldogma/xds/endpoint/v1/xds_endpoint.proto
  • xds/src/main/proto/centraldogma/xds/group/v1/xds_group.proto
  • xds/src/main/proto/centraldogma/xds/k8s/v1/xds_kubernetes.proto
  • xds/src/main/proto/centraldogma/xds/listener/v1/xds_listener.proto
  • xds/src/main/proto/centraldogma/xds/route/v1/xds_route.proto

Comment thread xds/src/main/proto/centraldogma/xds/group/v1/xds_group.proto Outdated
@codecov

codecov Bot commented Jul 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 59.45946% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.93%. Comparing base (12bc1f0) to head (dd1d751).
⚠️ Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
...centraldogma/xds/cluster/v1/XdsClusterService.java 66.66% 0 Missing and 3 partials ⚠️
...ntraldogma/xds/endpoint/v1/XdsEndpointService.java 50.00% 0 Missing and 3 partials ⚠️
.../centraldogma/xds/k8s/v1/XdsKubernetesService.java 57.14% 0 Missing and 3 partials ⚠️
...ntraldogma/xds/listener/v1/XdsListenerService.java 50.00% 0 Missing and 3 partials ⚠️
...orp/centraldogma/xds/route/v1/XdsRouteService.java 66.66% 0 Missing and 3 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1332      +/-   ##
============================================
- Coverage     69.85%   68.93%   -0.92%     
- Complexity     5612     5649      +37     
============================================
  Files           532      540       +8     
  Lines         23646    24146     +500     
  Branches       2700     2772      +72     
============================================
+ Hits          16517    16646     +129     
- Misses         5644     5969     +325     
- Partials       1485     1531      +46     

☔ 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.

@minwoox
minwoox marked this pull request as ready for review July 13, 2026 02:42
@minwoox
minwoox requested review from ikhoon and jrhee17 as code owners July 13, 2026 02:42

@jrhee17 jrhee17 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.

👍 👍

@ikhoon ikhoon 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.

👍 👍

@minwoox
minwoox merged commit 0fe7dbe into line:main Jul 14, 2026
12 of 14 checks passed
@minwoox
minwoox deleted the xds_commit_summary branch July 14, 2026 03:36
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.

3 participants