Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .claude/skills/xds-dev/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
name: xds-dev
description: Build and test all xDS-related modules. Useful during xDS development to verify changes compile and pass tests across the full xDS module set.
---

# xDS Development

Build and test commands for all xDS-related modules.

## Commands

### Test all xDS modules

```
./gradlew --parallel -Pretry=true :xds:test :xds-api:test :xds-validator:test :it:xds-client:test :it:xds-controlplane-api:test :it:xds-no-validation:test :it:xds-istio:test
```
Comment on lines +14 to +16
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.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add a language tag to the fenced code block.

The code fence is missing a language specifier, which triggers MD040 and can reduce syntax highlighting/tooling quality.

Suggested fix
-```
+```bash
 ./gradlew --parallel -Pretry=true :xds:test :xds-api:test :xds-validator:test :it:xds-client:test :it:xds-controlplane-api:test :it:xds-no-validation:test :it:xds-istio:test
</details>

<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

```suggestion

🧰 Tools
🪛 markdownlint-cli2 (0.22.1)

[warning] 14-14: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 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 @.claude/skills/xds-dev/SKILL.md around lines 14 - 16, Update the fenced code
block containing the gradlew command so it includes a language tag (e.g., add
"bash" after the opening ```), e.g., change the block that wraps "./gradlew
--parallel -Pretry=true :xds:test :xds-api:test ..." to start with "```bash" to
satisfy MD040 and enable proper syntax highlighting.

Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
/*
* Copyright 2026 LY Corporation
*
* LY Corporation licenses this file to you under the Apache License,
* version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at:
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/

package com.linecorp.armeria.xds.client.endpoint;

import static org.assertj.core.api.Assertions.assertThat;

import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Stream;

import org.junit.jupiter.api.extension.RegisterExtension;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;

import com.linecorp.armeria.client.BlockingWebClient;
import com.linecorp.armeria.client.WebClient;
import com.linecorp.armeria.common.HttpResponse;
import com.linecorp.armeria.common.SessionProtocol;
import com.linecorp.armeria.server.ServerBuilder;
import com.linecorp.armeria.testing.junit5.server.ServerExtension;
import com.linecorp.armeria.xds.XdsBootstrap;
import com.linecorp.armeria.xds.it.XdsResourceReader;

import io.envoyproxy.envoy.config.bootstrap.v3.Bootstrap;

class HttpProtocolOptionsTest {

@RegisterExtension
static ServerExtension server = new ServerExtension() {
@Override
protected void configure(ServerBuilder sb) {
sb.http(0);
sb.service("/", (ctx, req) -> HttpResponse.of("OK"));
}
};

// language=YAML
private static final String BOOTSTRAP_TEMPLATE =
"""
static_resources:
listeners:
- name: my-listener
api_listener:
api_listener:
"@type": type.googleapis.com/envoy.extensions.filters.network.\
http_connection_manager.v3.HttpConnectionManager
stat_prefix: http
route_config:
name: local_route
virtual_hosts:
- name: local_service
domains: [ "*" ]
routes:
- match:
prefix: /
route:
cluster: my-cluster
http_filters:
- name: envoy.filters.http.router
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.\
http.router.v3.Router
clusters:
- name: my-cluster
type: STATIC
load_assignment:
cluster_name: my-cluster
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: 127.0.0.1
port_value: %d
typed_extension_protocol_options:
envoy.extensions.upstreams.http.v3.HttpProtocolOptions:
"@type": type.googleapis.com/envoy.extensions.upstreams.\
http.v3.HttpProtocolOptions
%s
""";

static Stream<Arguments> sessionProtocolSelection() {
return Stream.of(
Arguments.of("explicit_http_config:\n http2_protocol_options: {}",
SessionProtocol.H2C),
Arguments.of("explicit_http_config:\n http_protocol_options: {}",
SessionProtocol.H1C),
Arguments.of("auto_config: {}", SessionProtocol.HTTP)
);
}

@ParameterizedTest
@MethodSource
void sessionProtocolSelection(String protocolConfig,
SessionProtocol expectedProtocol) {
final String yaml = BOOTSTRAP_TEMPLATE.formatted(
server.httpPort(), protocolConfig.indent(20).strip());
final Bootstrap bootstrap = XdsResourceReader.fromYaml(yaml, Bootstrap.class);
final AtomicReference<SessionProtocol> protocolRef = new AtomicReference<>();
try (XdsBootstrap xdsBootstrap = XdsBootstrap.of(bootstrap);
XdsHttpPreprocessor preprocessor =
XdsHttpPreprocessor.ofListener("my-listener", xdsBootstrap)) {
final BlockingWebClient client =
WebClient.builder(preprocessor)
.decorator((delegate, ctx, req) -> {
protocolRef.set(ctx.sessionProtocol());
return delegate.execute(ctx, req);
})
.build()
.blocking();
client.get("/");
assertThat(protocolRef.get()).isEqualTo(expectedProtocol);
}
}
}
Loading
Loading