feat:support default instance circuit breaker rule.

pull/1507/head
Haotian Zhang 7 months ago
parent 38b9e4cd49
commit e1e6ee5ebe

@ -23,11 +23,3 @@ closes #
- [ ] Add information of this PR to CHANGELOG.md in root of project.
- [ ] Add documentation in javadoc or comment below the PR if necessary.
## Checklist (Optional)
- [ ] Will pull request to branch of 2023.
- [ ] Will pull request to branch of 2022.
- [ ] Will pull request to branch of 2021.
- [ ] Will pull request to branch of 2020.
- [ ] Will pull request to branch of hoxton.

@ -0,0 +1,34 @@
name: Codecov with JDK 17
on:
push:
branches:
- 2024
- 2023
- 2022
pull_request:
branches:
- 2024
- 2023
- 2022
jobs:
codecov:
runs-on: ubuntu-latest
steps:
- name: Checkout codes
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
- name: Test with Maven
run: mvn clean test -B -U -Psonatype
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: ${{ github.workspace }}/target/site/jacoco/jacoco.xml

@ -1,18 +1,14 @@
name: Codecov
name: Codecov with JDK 8
on:
push:
branches:
- 2023
- 2022
- 2021
- 2020
- hoxton
- greenwich
pull_request:
branches:
- 2023
- 2022
- 2021
- 2020
- hoxton
@ -25,11 +21,11 @@ jobs:
steps:
- name: Checkout codes
uses: actions/checkout@v4
- name: Set up JDK 17
- name: Set up JDK 8
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
java-version: 8
- name: Test with Maven
run: mvn clean test -B -U -Psonatype
- name: Upload coverage to Codecov

@ -1,15 +1,14 @@
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Test with Junit (JDK17)
name: Junit Test with JDK from 17 to 21
on:
push:
branches:
- 2024
- 2023
- 2022
pull_request:
branches:
- 2024
- 2023
- 2022
@ -17,7 +16,7 @@ jobs:
build:
strategy:
matrix:
java: [ 17 ]
java: [ 17, 21 ]
os: [ 'windows-latest', 'ubuntu-latest' ]
runs-on: ${{ matrix.os }}

@ -1,27 +1,24 @@
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Test with Junit
name: Junit Test with JDK from 8 to 21
on:
push:
branches:
- hoxton
- 2021
- 2020
- hoxton
- greenwich
pull_request:
branches:
- hoxton
- 2021
- 2020
- hoxton
- greenwich
jobs:
junit:
strategy:
matrix:
java: [ 8, 11, 17 ]
java: [ 8, 11, 17, 21 ]
os: [ 'windows-latest', 'ubuntu-latest' ]
runs-on: ${{ matrix.os }}

@ -3,6 +3,7 @@ name: License checker
on:
push:
branches:
- 2024
- 2023
- 2022
- 2021
@ -11,6 +12,7 @@ on:
- greenwich
pull_request:
branches:
- 2024
- 2023
- 2022
- 2021

@ -1,14 +1,11 @@
name: Snapshot
name: Snapshot with JDK 17
on:
push:
branches:
- 2024
- 2023
- 2022
- 2021
- 2020
- hoxton
- greenwich
jobs:
check-snapshot:

@ -0,0 +1,48 @@
name: Snapshot with JDK 8
on:
push:
branches:
- 2021
- 2020
- hoxton
- greenwich
jobs:
check-snapshot:
runs-on: ubuntu-latest
outputs:
IS_SNAPSHOT: ${{ steps.set_output_1.outputs.IS_SNAPSHOT }}
steps:
- name: Checkout codes
uses: actions/checkout@v4
- name: Check deploy type
id: set_output_1
run: |
line="$(grep SNAPSHOT pom.xml || true)"
echo $line
if [ -n "$line" ]; then
echo "IS_SNAPSHOT=true" >> $GITHUB_OUTPUT
else
echo "IS_SNAPSHOT=false" >> $GITHUB_OUTPUT
fi
snapshot:
runs-on: ubuntu-latest
needs: check-snapshot
if: ${{ needs.check-snapshot.outputs.IS_SNAPSHOT == 'true' }}
steps:
- name: Checkout codes
uses: actions/checkout@v4
- name: Set up JDK 8
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'temurin'
server-id: nexus-snapshots
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Publish package
run: mvn clean deploy -B -U -Psonatype
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}

@ -51,3 +51,4 @@
- [feat: support gateway context, feign eager-load support default value.](https://github.com/Tencent/spring-cloud-tencent/pull/1504)
- [feat:use polaris-all for shading third-party dependencies.](https://github.com/Tencent/spring-cloud-tencent/pull/1505)
- [feat:support default instance circuit breaker rule.](https://github.com/Tencent/spring-cloud-tencent/pull/1506)
- [docs:update JDK version configuration in GitHub Actions.](https://github.com/Tencent/spring-cloud-tencent/pull/1507)

@ -28,6 +28,7 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;
@ -42,6 +43,7 @@ import static com.tencent.cloud.common.constant.ContextConstant.UTF_8;
*
* @author Haotian Zhang
*/
@RefreshScope
@RestController
@RequestMapping("/quickstart/callee")
public class QuickstartCalleeController {

@ -27,6 +27,7 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
@ -43,6 +44,7 @@ import static com.tencent.cloud.common.constant.ContextConstant.UTF_8;
*
* @author Haotian Zhang
*/
@RefreshScope
@RestController
@RequestMapping("/quickstart/callee")
public class QuickstartCalleeController {

@ -50,6 +50,12 @@ spring:
- Path=/QuickstartCallerService/**
filters:
- StripPrefix=1
- id: QuickstartCalleeService
uri: lb://QuickstartCalleeService
predicates:
- Path=/QuickstartCalleeService/**
filters:
- StripPrefix=1
logging:
file:
name: /sct-demo-logs/${spring.application.name}/root.log

Loading…
Cancel
Save