Skip to content

Adapt the xDS web UI to the YAML-over-HTTP resource API - #1338

Merged
minwoox merged 3 commits into
line:mainfrom
minwoox:xds_yaml_ui
Jul 24, 2026
Merged

Adapt the xDS web UI to the YAML-over-HTTP resource API#1338
minwoox merged 3 commits into
line:mainfrom
minwoox:xds_yaml_ui

Conversation

@minwoox

@minwoox minwoox commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Motivation:
The web UI still spoke JSON.

Modifications:

  • Web UI, talk YAML to the API.

Result:

  • The xDS web UI reads, edits and saves resources as YAML end-to-end against the HTTP API.

Motivation:
The web UI, however, still spoke JSON.

Modifications:
- Web UI, talk YAML to the API.

Result:
- The xDS web UI reads, edits and saves resources as YAML end-to-end against the HTTP API.
@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The webapp and xDS services now use YAML resource handling. Editors gain sticky action bars and YAML validation, API requests use YAML payloads, raw YAML responses are preserved, sample data uses YAML, and successful delete operations return HTTP 204.

Changes

Webapp xDS YAML and editor flow

Layer / File(s) Summary
YAML editor contracts
webapp/package.json, webapp/src/dogma/common/components/JsonEditor.tsx, webapp/src/dogma/features/api/baseQuery.ts, webapp/src/dogma/features/services/ErrorMessageParser.ts, webapp/src/dogma/features/xds/XdsTypes.ts, webapp/src/dogma/features/xds/xdsReferences.ts
Adds YAML dependencies, configurable Monaco language support, content-type response handling, direct string error parsing, YAML templates, and YAML reference extraction.
Sticky xDS editor actions
webapp/src/dogma/features/xds/EditorActionBar.tsx, webapp/src/dogma/features/xds/ResourceEditor.tsx, webapp/src/dogma/features/xds/K8sAggregatorEditor.tsx, webapp/src/dogma/features/xds/K8sAggregatorStatus.tsx
Adds sticky editor actions and updates resource and aggregator editors for YAML validation, preview parsing, read/edit controls, endpoint counting, error notifications, and remounting by resource ID.
YAML API transport and coverage
webapp/src/dogma/features/xds/xdsApiSlice.ts, webapp/tests/dogma/features/xds/*, webapp/e2e/xds-resource-edit.spec.ts
Uses YAML-only resource paths and payloads, updates preview and mutation requests, serializes references as YAML, and adds editor and end-to-end coverage.

xDS service response and bootstrap contracts

Layer / File(s) Summary
Raw YAML responses and bootstrap data
xds/src/main/java/.../XdsEndpointReadService.java, xds/src/test/java/com/linecorp/centraldogma/xds/XdsTestServer.java
Endpoint reads prefer raw YAML, and test bootstrap requests and sample resources use YAML payloads with application/yaml.
204 delete responses
xds/src/main/java/.../XdsGroupService.java, xds/src/main/java/.../XdsResourceManager.java, xds/src/test/java/com/linecorp/centraldogma/xds/**
Successful group, resource, endpoint, aggregator, listener, route, and cluster deletions now return and assert NO_CONTENT.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Editor as ResourceEditor
  participant Bar as EditorActionBar
  participant API as xdsApiSlice
  participant Service as xDS service

  Editor->>Bar: render YAML editor actions
  Editor->>API: submit YAML resource body
  API->>Service: PUT application/yaml
  Service-->>API: resource response
  API-->>Editor: updated resource state
Loading

Possibly related PRs

  • line/centraldogma#1229: Adds backend YAML entry and upsert handling used by the webapp YAML resource flow.
  • line/centraldogma#1321: Covers backend storage of xDS resources as .yaml, matching the webapp’s YAML-only client behavior.
  • line/centraldogma#1337: Relates to xDS resource deletion semantics and the HTTP 204 response change.

Suggested labels: improvement

Suggested reviewers: jrhee17, trustin, ikhoon

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 24.56% 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
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.
Title check ✅ Passed The title clearly summarizes the main change: moving the xDS web UI to the YAML-over-HTTP resource API.
Description check ✅ Passed The description is directly related and accurately states the UI now reads, edits, and saves xDS resources as YAML end-to-end.
✨ 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: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
webapp/src/dogma/features/xds/K8sAggregatorStatus.tsx (1)

29-51: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Parse failure is indistinguishable from a genuinely empty/synced result.

On jsYaml.load failure this returns { localities: 0, endpoints: 0 }, which the caller renders as "Synced · 0 localities · 0 endpoints" — misleading, since a parse failure is a different condition than "synced with zero endpoints."

🤖 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 `@webapp/src/dogma/features/xds/K8sAggregatorStatus.tsx` around lines 29 - 51,
The countEndpoints function must distinguish YAML parse failures from valid
empty results instead of returning zero counts for both. Update its return
contract and the caller’s rendering logic to represent parse failure explicitly,
while preserving zero counts for successfully parsed content with no endpoints.
🤖 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 `@webapp/src/dogma/features/xds/K8sAggregatorEditor.tsx`:
- Around line 174-190: The YAML parse failure handling must surface errors
instead of producing misleading empty success states. In
webapp/src/dogma/features/xds/K8sAggregatorEditor.tsx lines 174-190, update
parseToFormData and its call site to notify the user and prevent resetting the
form to emptyWatcher after jsYaml.load fails. In
webapp/src/dogma/features/xds/K8sAggregatorStatus.tsx lines 29-51, update
countEndpoints and its rendering path to propagate a distinct parse-failed state
and display an error instead of “Synced · 0 localities · 0 endpoints”.

In `@webapp/src/dogma/features/xds/xdsApiSlice.ts`:
- Around line 114-128: Restore legacy .json fallback handling across fetchYaml
and the related ID helper functions: when the YAML request cannot resolve the
resource, retry using the corresponding .json path before returning the error.
Preserve the knownPath optimization and ensure all affected helpers consistently
use the fallback behavior.

In `@webapp/src/dogma/features/xds/XdsTypes.ts`:
- Around line 60-62: Update resourceName to strip both legacy .json and existing
.yaml suffixes from path before constructing the groups/${group} resource name,
preserving the current behavior for paths without either suffix.

---

Outside diff comments:
In `@webapp/src/dogma/features/xds/K8sAggregatorStatus.tsx`:
- Around line 29-51: The countEndpoints function must distinguish YAML parse
failures from valid empty results instead of returning zero counts for both.
Update its return contract and the caller’s rendering logic to represent parse
failure explicitly, while preserving zero counts for successfully parsed content
with no endpoints.
🪄 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: 78f81656-dceb-4021-b0e3-248e86a37a1d

📥 Commits

Reviewing files that changed from the base of the PR and between 4244cb2 and 6392787.

⛔ Files ignored due to path filters (1)
  • webapp/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (27)
  • webapp/e2e/xds-resource-edit.spec.ts
  • webapp/package.json
  • webapp/src/dogma/common/components/JsonEditor.tsx
  • webapp/src/dogma/features/api/baseQuery.ts
  • webapp/src/dogma/features/services/ErrorMessageParser.ts
  • webapp/src/dogma/features/xds/EditorActionBar.tsx
  • webapp/src/dogma/features/xds/K8sAggregatorEditor.tsx
  • webapp/src/dogma/features/xds/K8sAggregatorStatus.tsx
  • webapp/src/dogma/features/xds/ResourceEditor.tsx
  • webapp/src/dogma/features/xds/XdsTypes.ts
  • webapp/src/dogma/features/xds/xdsApiSlice.ts
  • webapp/src/dogma/features/xds/xdsReferences.ts
  • webapp/tests/dogma/features/xds/K8sAggregatorEditor.test.tsx
  • webapp/tests/dogma/features/xds/ResourceEditor.test.tsx
  • xds/src/main/java/com/linecorp/centraldogma/xds/group/v1/XdsGroupService.java
  • xds/src/main/java/com/linecorp/centraldogma/xds/internal/XdsEndpointReadService.java
  • xds/src/main/java/com/linecorp/centraldogma/xds/internal/XdsResourceManager.java
  • xds/src/test/java/com/linecorp/centraldogma/xds/XdsTestServer.java
  • xds/src/test/java/com/linecorp/centraldogma/xds/cluster/v1/XdsClusterServiceTest.java
  • xds/src/test/java/com/linecorp/centraldogma/xds/endpoint/v1/XdsEndpointServiceTest.java
  • xds/src/test/java/com/linecorp/centraldogma/xds/group/v1/XdsGroupServiceTest.java
  • xds/src/test/java/com/linecorp/centraldogma/xds/internal/XdsGroupDeletePermissionTest.java
  • xds/src/test/java/com/linecorp/centraldogma/xds/internal/XdsLegacyJsonCompatibilityTest.java
  • xds/src/test/java/com/linecorp/centraldogma/xds/internal/XdsYamlCompatibilityTest.java
  • xds/src/test/java/com/linecorp/centraldogma/xds/k8s/v1/XdsKubernetesServiceTest.java
  • xds/src/test/java/com/linecorp/centraldogma/xds/listener/v1/XdsListenerServiceTest.java
  • xds/src/test/java/com/linecorp/centraldogma/xds/route/v1/XdsRouteServiceTest.java

Comment thread webapp/src/dogma/features/xds/K8sAggregatorEditor.tsx
Comment thread webapp/src/dogma/features/xds/xdsApiSlice.ts
Comment thread webapp/src/dogma/features/xds/XdsTypes.ts
@minwoox
minwoox marked this pull request as ready for review July 22, 2026 02:36
@minwoox
minwoox requested review from ikhoon and jrhee17 as code owners July 22, 2026 02:36

@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 5afa110 into line:main Jul 24, 2026
13 of 14 checks passed
@minwoox
minwoox deleted the xds_yaml_ui branch July 24, 2026 09:47
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.

3 participants