Skip to content

Allow dots and forbid slashes in new xDS resource IDs - #1334

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

Allow dots and forbid slashes in new xDS resource IDs#1334
minwoox merged 3 commits into
line:mainfrom
minwoox:allow_dot

Conversation

@minwoox

@minwoox minwoox commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Motivation:

We have decided to allow dots in a xDS group name and resource ID. At the same time, slashes are disallowed in a resource ID.

Existing resources whose IDs contain slashes (created before this change) must continue to be updatable and deletable, so backward compatibility must be preserved for update/delete operations.

Modifications:

  • Allow dots and forbid slashes in an xDS group name and resource ID.

Result:

  • Dots are now allowed in xDS group names and resource IDs.
  • Slashes are rejected when creating new resources.

Motivation:

We have decided to allow dots in a xDS group name and resource ID.
At the same time, slashes are disallowed in a resource ID.

Existing resources whose IDs contain slashes (created before this
change) must continue to be updatable and deletable, so backward
compatibility must be preserved for update/delete operations.

Modifications:

- Allow dots and forbid slashes in an xDS group name and resource ID.

Result:

- Dots are now allowed in xDS group names and resource IDs.
- Slashes are rejected when creating new resources.
@minwoox minwoox added this to the 0.85.0 milestone Jul 14, 2026
@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The change updates XDS resource ID validation to allow dots and reject slashes for new resources. Legacy slash-containing names remain parseable for update and delete operations. Webapp forms and XDS tests now cover the revised rules.

Changes

XDS resource ID validation

Layer / File(s) Summary
Resource ID pattern contract
xds/src/main/java/com/linecorp/centraldogma/xds/internal/XdsResourceManager.java
Current resource IDs reject slashes, while legacy patterns continue accepting slash-containing existing names.
Legacy resource-name parsing
xds/src/main/java/com/linecorp/centraldogma/xds/{cluster,endpoint,k8s,listener,route}/v1/*.java
Cluster, endpoint, aggregator, listener, and route name parsing uses the legacy resource ID pattern.

Webapp validation

Layer / File(s) Summary
Identifier validation and edit compatibility
webapp/src/dogma/features/xds/{K8sAggregatorEditor,NewGroup,ResourceEditor}.tsx, webapp/tests/dogma/features/xds/K8sAggregatorEditor.test.tsx
New IDs allow dots and reject slashes; existing slash-based aggregator IDs remain editable, with updated error messages and coverage.

Backend validation tests

Layer / File(s) Summary
Core XDS service validation tests
xds/src/test/java/com/linecorp/centraldogma/xds/{cluster,endpoint}/v1/*Test.java
Cluster and endpoint HTTP, gRPC, update, delete, and registration tests use dot-based identifiers and reject slash-containing new IDs.
Specialized XDS identifier tests
xds/src/test/java/com/linecorp/centraldogma/xds/{group,k8s,listener,route}/v1/*Test.java
Group, Kubernetes, listener, and route tests cover dotted IDs, derived names, migration paths, and slash rejection.

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

Suggested labels: new feature

Suggested reviewers: trustin, jrhee17, ikhoon

🚥 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
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 validation change for new xDS resource IDs.
Description check ✅ Passed The description matches the changeset and explains the dot allowance, slash rejection, and backward compatibility.
✨ 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: 5

🤖 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 454-463: The validation message alongside the registered
aggregatorId field does not reflect the corrected character-class range. Update
the text in the FormErrorMessage for aggregatorId so the hyphen appears at the
end of the character class, matching AGGREGATOR_ID_PATTERN while preserving the
stated slash restriction.

In `@webapp/src/dogma/features/xds/NewGroup.tsx`:
- Around line 92-93: Update the Group ID validation message near the NewGroup
form to use the corrected regular-expression character-class syntax, ensuring
the displayed pattern accurately matches the validator while preserving the
existing allowed-character description.

In `@webapp/src/dogma/features/xds/ResourceEditor.tsx`:
- Around line 98-107: Update the Invalid ID notification message in the
idIsInvalid branch to describe the safely formulated character class, placing
the hyphen as a literal rather than implying a range. Keep the stated
lowercase-start, lowercase/digit/underscore/dot/hyphen body, lowercase-or-digit
ending, and slash prohibition consistent with validation.
- Around line 134-139: Update the validation text in the ResourceEditor form’s
FormErrorMessage to accurately describe the safely formulated ID regular
expression, correcting the character-class range while preserving the existing
allowed-character and slash restriction guidance.

In
`@xds/src/main/java/com/linecorp/centraldogma/xds/internal/XdsResourceManager.java`:
- Around line 74-81: Move the hyphen to the end of both character classes in
XdsResourceManager’s RESOURCE_ID_PATTERN_STRING and
LEGACY_RESOURCE_ID_PATTERN_STRING. Apply the same corrected resource-ID regex in
K8sAggregatorEditor, NewGroup, and ResourceEditor, and update every associated
validation, notification, and form error message in the specified ranges to
display [a-z0-9_.-].
🪄 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: f4e5375e-0118-4ca5-891a-952f6f582194

📥 Commits

Reviewing files that changed from the base of the PR and between 2ecdca7 and eff1841.

📒 Files selected for processing (18)
  • webapp/src/dogma/features/xds/K8sAggregatorEditor.tsx
  • webapp/src/dogma/features/xds/NewGroup.tsx
  • webapp/src/dogma/features/xds/ResourceEditor.tsx
  • webapp/tests/dogma/features/xds/K8sAggregatorEditor.test.tsx
  • 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/internal/XdsResourceManager.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/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/endpoint/v1/XdsRegisterEndpointTest.java
  • xds/src/test/java/com/linecorp/centraldogma/xds/group/v1/XdsGroupServiceTest.java
  • xds/src/test/java/com/linecorp/centraldogma/xds/k8s/v1/AggregatingMultipleKubernetesTest.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/NewGroup.tsx Outdated
Comment thread webapp/src/dogma/features/xds/ResourceEditor.tsx
Comment thread webapp/src/dogma/features/xds/ResourceEditor.tsx
Comment thread xds/src/main/java/com/linecorp/centraldogma/xds/internal/XdsResourceManager.java Outdated

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

Caution

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

⚠️ Outside diff range comments (1)
xds/src/test/java/com/linecorp/centraldogma/xds/k8s/v1/XdsKubernetesServiceTest.java (1)

325-325: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Retain regression coverage for legacy slash-containing IDs.

These update and delete tests now use only dotted IDs, so they no longer verify the required backward compatibility for existing resources such as foo-k8s-cluster/2 and foo-k8s-cluster/3. Add dedicated cases that seed or otherwise load a legacy resource first, then PATCH/DELETE it using the slash-containing resource name; reverting these POST-based setups directly would incorrectly exercise the new-resource validation instead.

Also applies to: 366-366

🤖 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/test/java/com/linecorp/centraldogma/xds/k8s/v1/XdsKubernetesServiceTest.java`
at line 325, Restore dedicated regression cases in the update and delete tests
around the existing aggregatorId usages, first seeding or loading legacy
resources named foo-k8s-cluster/2 and foo-k8s-cluster/3, then PATCHing or
DELETEing those slash-containing names. Do not merely revert the POST setup,
since creation must continue testing new-resource validation while update and
delete verify backward compatibility.
🤖 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.

Outside diff comments:
In
`@xds/src/test/java/com/linecorp/centraldogma/xds/k8s/v1/XdsKubernetesServiceTest.java`:
- Line 325: Restore dedicated regression cases in the update and delete tests
around the existing aggregatorId usages, first seeding or loading legacy
resources named foo-k8s-cluster/2 and foo-k8s-cluster/3, then PATCHing or
DELETEing those slash-containing names. Do not merely revert the POST setup,
since creation must continue testing new-resource validation while update and
delete verify backward compatibility.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 3dfc0d1d-f354-48d7-a2a1-68aa94733249

📥 Commits

Reviewing files that changed from the base of the PR and between eff1841 and 7189749.

📒 Files selected for processing (9)
  • webapp/src/dogma/features/xds/K8sAggregatorEditor.tsx
  • webapp/src/dogma/features/xds/NewGroup.tsx
  • webapp/src/dogma/features/xds/ResourceEditor.tsx
  • xds/src/main/java/com/linecorp/centraldogma/xds/internal/XdsResourceManager.java
  • xds/src/main/java/com/linecorp/centraldogma/xds/k8s/v1/XdsKubernetesService.java
  • xds/src/test/java/com/linecorp/centraldogma/xds/endpoint/v1/XdsEndpointServiceTest.java
  • xds/src/test/java/com/linecorp/centraldogma/xds/endpoint/v1/XdsRegisterEndpointTest.java
  • xds/src/test/java/com/linecorp/centraldogma/xds/k8s/v1/AggregatingMultipleKubernetesTest.java
  • xds/src/test/java/com/linecorp/centraldogma/xds/k8s/v1/XdsKubernetesServiceTest.java
🚧 Files skipped from review as they are similar to previous changes (7)
  • webapp/src/dogma/features/xds/NewGroup.tsx
  • xds/src/main/java/com/linecorp/centraldogma/xds/k8s/v1/XdsKubernetesService.java
  • webapp/src/dogma/features/xds/K8sAggregatorEditor.tsx
  • xds/src/test/java/com/linecorp/centraldogma/xds/k8s/v1/AggregatingMultipleKubernetesTest.java
  • webapp/src/dogma/features/xds/ResourceEditor.tsx
  • xds/src/test/java/com/linecorp/centraldogma/xds/endpoint/v1/XdsRegisterEndpointTest.java
  • xds/src/test/java/com/linecorp/centraldogma/xds/endpoint/v1/XdsEndpointServiceTest.java

@minwoox
minwoox marked this pull request as ready for review July 14, 2026 03:35
@minwoox
minwoox requested review from ikhoon and jrhee17 as code owners July 14, 2026 03:35

@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 d5faf29 into line:main Jul 14, 2026
14 checks passed
@minwoox
minwoox deleted the allow_dot branch July 14, 2026 05:39
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