Skip to content

2.7.0.1 jdk8#10

Open
Aias00 wants to merge 2 commits into
mainfrom
2.7.0.1-jdk8-release
Open

2.7.0.1 jdk8#10
Aias00 wants to merge 2 commits into
mainfrom
2.7.0.1-jdk8-release

Conversation

@Aias00

@Aias00 Aias00 commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Make sure that:

  • You have read the contribution guidelines.
  • You submit test cases (unit or integration tests) that back your changes.
  • Your local test passed ./mvnw clean install -Dmaven.javadoc.skip=true.

Aias00 added 2 commits August 16, 2025 08:02
The split client repository needs to carry MCP registration, beat registration, Spring Boot starters, and discovery registration without inheriting the main repository JDK upgrade constraints. This restores the client-side module surface on the JDK 8 release base, rebases dependencies onto Spring Boot 2/JDK 8 compatible lines, and expands CI coverage through JDK 25 after local compatibility verification.

Constraint: Client artifacts must remain JDK 8 compatible while validating JDK 17, 21, 23, and 25

Constraint: The split repository does not define the release Maven profile, so CI uses ./mvnw -B clean test

Rejected: Move the client back under the main repository | it would keep client compatibility tied to admin/bootstrap JDK upgrade timing

Rejected: Keep JDK 23 and 25 as local-only checks | CI would not catch future toolchain regressions

Confidence: medium

Scope-risk: broad

Directive: Do not upgrade client runtime dependencies without rerunning the JDK 8 compatibility build

Tested: ./mvnw -DskipTests compile

Tested: ./mvnw test

Tested: JAVA_HOME=/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home ./mvnw -B clean test

Tested: JAVA_HOME=/Users/aias/Library/Java/JavaVirtualMachines/corretto-17.0.13/Contents/Home ./mvnw -B clean test -Prelease

Tested: JAVA_HOME=/Users/aias/Library/Java/JavaVirtualMachines/openjdk-21.0.2/Contents/Home ./mvnw -B clean test -Prelease

Tested: JAVA_HOME=/Users/aias/Library/Java/JavaVirtualMachines/openjdk-25.0.2/Contents/Home ./mvnw -B clean test

Tested: JAVA_HOME=/tmp/shenyu-jdks/jdk-23.0.2+7/Contents/Home ./mvnw -B clean test

Not-tested: End-to-end registration against matching admin/bootstrap runtime
Copilot AI review requested due to automatic review settings June 8, 2026 10:32

Copilot AI 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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@dengliming dengliming requested a review from Copilot June 23, 2026 09:04

Copilot AI 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.

Pull request overview

Copilot reviewed 105 out of 105 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (8)

shenyu-registry-api/src/main/java/org/apache/shenyu/registry/api/config/RegisterConfig.java:1

  • equals is unsafe: it casts without an instanceof/class check and dereferences getRegisterType()/getServerLists() which can be null (default constructor sets them null), causing NullPointerException. Additionally, hashCode() depends on Properties iteration order, which may differ between two Properties instances that are equals() by content—this can violate the equals/hashCode contract. Make equals null-safe (Objects.equals), add type checks (this == obj, obj instanceof RegisterConfig), and compute hashCode in an order-independent way for props (e.g., sort entries by key before mixing into the hash, or hash a normalized map/entry set).
    shenyu-register-client-beat/src/main/java/org/apache/shenyu/register/client/beat/HeartbeatListener.java:1
  • Two issues here can break heartbeat reporting in production: (1) Caffeine CacheLoader must not return null—returning null can trigger InvalidCacheLoadException and prevent caching/refresh semantics from working as intended. Represent absence explicitly (e.g., cache Optional<String> or cache a sentinel like empty string) and handle it in sendHeartbeat. (2) Throwing a RuntimeException from the scheduled task can cancel future executions of scheduleAtFixedRate, stopping all heartbeats after one full-cycle failure; instead, log and continue so the next period retries.
    shenyu-register-client-beat/src/main/java/org/apache/shenyu/register/client/beat/HeartbeatListener.java:1
  • Two issues here can break heartbeat reporting in production: (1) Caffeine CacheLoader must not return null—returning null can trigger InvalidCacheLoadException and prevent caching/refresh semantics from working as intended. Represent absence explicitly (e.g., cache Optional<String> or cache a sentinel like empty string) and handle it in sendHeartbeat. (2) Throwing a RuntimeException from the scheduled task can cancel future executions of scheduleAtFixedRate, stopping all heartbeats after one full-cycle failure; instead, log and continue so the next period retries.
    shenyu-spring-boot-starter-client/shenyu-spring-boot-starter-client-springmvc/src/test/java/org/apache/shenyu/springboot/starter/client/springmvc/ShenyuSpringMvcClientConfigurationTest.java:1
  • There are two @BeforeEach methods both assigning applicationContextRunner. JUnit will run both before each test (order is not something to rely on), so the configuration used by each test becomes fragile/flaky and the first setup is effectively overwritten. Consider using separate ApplicationContextRunner instances inside each test, or switch to @Nested test classes with distinct @BeforeEach setups.
    shenyu-client-mcp/shenyu-client-mcp-common/src/main/java/org/apache/shenyu/client/mcp/generator/McpToolsRegisterDTOGenerator.java:1
  • parameters can be null when the OpenAPI operation has no parameters array. parameterFormatting(parameters) will then throw a NullPointerException. Guard by defaulting to an empty JsonArray when parameters is null (and consider similar guards for paths, path, and method lookups if the input can be incomplete).
    shenyu-registry-api/src/main/java/org/apache/shenyu/registry/api/entity/InstanceEntity.java:1
  • toString() returns a type label URIRegisterDTO{...} which doesn't match this class (InstanceEntity). This makes logs/debugging misleading. Update the prefix to InstanceEntity{...} (and consider including status/weight/uri if those are meaningful for diagnosis).
    shenyu-registry-api/src/main/java/org/apache/shenyu/registry/api/path/InstancePathConstants.java:1
  • DOT_SEPARATOR is declared but never used within this class (the full file is shown in the diff). Consider removing it to reduce dead code and avoid confusion.
    shenyu-spring-boot-starter-client/shenyu-spring-boot-starter-client-tars/src/test/java/org/apache/shenyu/springboot/starter/client/tars/ShenyuTarsClientConfigurationTest.java:1
  • The static Mockito mock is manually closed at the end of the test. If an assertion or context initialization throws, close() is skipped and the static mock can leak into other tests. Use try-with-resources (try (MockedStatic<RegisterUtils> mocked = mockStatic(...)) { ... }) to guarantee cleanup.

Comment on lines +81 to +88
InstanceEntity instance = new InstanceEntity();
instance.setStatus(currentInstanceUpstream.getStatus());
instance.setWeight(currentInstanceUpstream.getWeight());
URI uri = URI.create(currentInstanceUpstream.getProtocol() + currentInstanceUpstream.getUrl());
instance.setPort(uri.getPort());
instance.setHost(uri.getHost());
instance.setAppName(discoveryConfig.getProps().getProperty("name"));
discoveryService.persistInstance(instance);
Comment thread .github/workflows/ci.yml
Comment on lines +54 to 56
- uses: codecov/codecov-action@v4
with:
token: 2760af6a-3405-4882-9e61-04c5176fecfa
@Aias00 Aias00 changed the title 2.7.0.1 jdk8 release 2.7.0.1 jdk8 Jun 23, 2026
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.

2 participants