Skip to content
Open
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
14 changes: 7 additions & 7 deletions .github/workflows/aurora_performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,25 @@ jobs:

steps:
- name: Clone repository
uses: actions/checkout@v4
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
with:
fetch-depth: 50

- name: "Set up JDK 8"
uses: actions/setup-java@v3
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
with:
distribution: "corretto"
java-version: 8
- name: Set up Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: "20.x"
node-version: "22.x"
- name: Install dependencies
run: npm install --no-save

- name: Configure AWS Credentials
id: creds
uses: aws-actions/configure-aws-credentials@v4
uses: aws-actions/configure-aws-credentials@e7f100cf4c008499ea8adda475de1042d6975c7b # v6
with:
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/${{ secrets.AWS_DEPLOY_ROLE }}
role-session-name: nodejs_aurora_perf_tests
Expand All @@ -59,7 +59,7 @@ jobs:
- name: "Get Github Action IP"
if: always()
id: ip
uses: haythem/public-ip@v1.3
uses: haythem/public-ip@bdddd92c198b0955f0b494a8ebeac529754262ff # v1.3

- name: "Remove Github Action IP"
if: always()
Expand All @@ -73,7 +73,7 @@ jobs:

- name: Archive Performance results
if: always()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: ${{ matrix.db }}-performance-results
path: ./tests/integration/container/reports
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependabot_auto_merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1
uses: dependabot/fetch-metadata@25dd0e34f4fe68f24cc83900b1fe3fe149efef98 # v2
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Approve PR
Expand Down
32 changes: 18 additions & 14 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
push:
branches:
- main
- chore/remove-aliases
paths-ignore:
- '**/*.md'
- '**/*.jpg'
Expand Down Expand Up @@ -63,24 +64,24 @@ jobs:

steps:
- name: 'Clone repository'
uses: actions/checkout@v4
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
- name: "Set up JDK 8"
uses: actions/setup-java@v3
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
with:
distribution: "corretto"
java-version: 8
- name: Set up Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: "20.x"
node-version: "22.x"
- name: Install dependencies
run: npm install --no-save

- name: Configure AWS Credentials
id: creds
uses: aws-actions/configure-aws-credentials@v4
uses: aws-actions/configure-aws-credentials@e7f100cf4c008499ea8adda475de1042d6975c7b # v6
with:
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/${{ secrets.AWS_DEPLOY_ROLE }}
role-session-name: nodejs_int_default_tests
Expand All @@ -102,7 +103,7 @@ jobs:
- name: "Get Github Action IP"
if: always()
id: ip
uses: haythem/public-ip@v1.3
uses: haythem/public-ip@bdddd92c198b0955f0b494a8ebeac529754262ff # v1.3

- name: "Remove Github Action IP"
if: always()
Expand All @@ -116,7 +117,7 @@ jobs:

- name: Archive results
if: always()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: integration-report-default-${{ matrix.dbEngine }}
path: ./tests/integration/container/reports
Expand All @@ -126,29 +127,32 @@ jobs:
name: Run Integration Tests (Latest)
runs-on: ubuntu-latest
needs: run-integration-tests-default
if: |
always() &&
needs.run-integration-tests-default.result == 'success'
strategy:
fail-fast: false
matrix:
dbEngine: ["aurora-mysql", "aurora-postgres" ]

steps:
- name: Clone repository
uses: actions/checkout@v4
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- name: "Set up JDK 8"
uses: actions/setup-java@v3
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
with:
distribution: "corretto"
java-version: 8
- name: Set up Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: "20.x"
node-version: "22.x"
- name: Install dependencies
run: npm install --no-save

- name: Configure AWS Credentials
id: creds
uses: aws-actions/configure-aws-credentials@v4
uses: aws-actions/configure-aws-credentials@e7f100cf4c008499ea8adda475de1042d6975c7b # v6
with:
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/${{ secrets.AWS_DEPLOY_ROLE }}
role-session-name: nodejs_int_latest_tests
Expand All @@ -170,7 +174,7 @@ jobs:
- name: "Get Github Action IP"
if: always()
id: ip
uses: haythem/public-ip@v1.3
uses: haythem/public-ip@bdddd92c198b0955f0b494a8ebeac529754262ff # v1.3

- name: "Remove Github Action IP"
if: always()
Expand All @@ -184,7 +188,7 @@ jobs:

- name: Archive results
if: always()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: integration-report-latest-${{ matrix.dbEngine }}
path: ./tests/integration/container/reports
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ jobs:
run-checks-and-unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- name: Set up Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: "20.x"
node-version: "22.x"
- name: Install dependencies
run: npm install --no-save
- name: Run eslint - linting
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ jobs:
packages: write
steps:
- name: "Clone Repository"
uses: actions/checkout@v4
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- name: "Set up Node.js"
uses: actions/setup-node@v4
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: "20.x"
node-version: "22.x"
registry-url: "https://registry.npmjs.org"
- name: "Install dependencies"
run: npm install --no-save
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release_draft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: "Clone Repository"
uses: actions/checkout@v4
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- name: "Set up Node.js"
uses: actions/setup-node@v4
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: "20.x"
node-version: "22.x"
- name: "Install dependencies"
run: npm install --no-save
- name: "Run eslint - linting"
Expand All @@ -46,7 +46,7 @@ jobs:
touch RELEASE_DETAILS.md
echo "$RELEASE_DETAILS" > RELEASE_DETAILS.md
- name: "Upload to Draft Release"
uses: ncipollo/release-action@v1
uses: ncipollo/release-action@339a81892b84b4eeb0f6e744e4574d79d0d9b8dd # v1
with:
draft: true
name: "AWS Advanced NodeJS Wrapper - v${{ env.RELEASE_VERSION }}"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/remove-old-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

steps:
- name: Remove Old Artifacts
uses: c-hive/gha-remove-artifacts@v1
uses: c-hive/gha-remove-artifacts@44fc7acaf1b3d0987da0e8d4707a989d80e9554b # v1
with:
age: "1 week"
skip-tags: true
14 changes: 7 additions & 7 deletions .github/workflows/run-autoscaling-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,21 @@ jobs:
dbEngine: [ "mysql", "postgres" ]
steps:
- name: Clone repository
uses: actions/checkout@v4
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
with:
fetch-depth: 50
- name: "Set up JDK 8"
uses: actions/setup-java@v3
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
with:
distribution: "corretto"
java-version: 8
- name: Set up Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: "20.x"
node-version: "22.x"
- name: Configure AWS credentials
id: creds
uses: aws-actions/configure-aws-credentials@v4
uses: aws-actions/configure-aws-credentials@e7f100cf4c008499ea8adda475de1042d6975c7b # v6
with:
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/${{ secrets.AWS_DEPLOY_ROLE }}
role-session-name: nodejs_autoscaling_tests
Expand All @@ -56,7 +56,7 @@ jobs:
- name: "Get Github Action IP"
if: always()
id: ip
uses: haythem/public-ip@v1.3
uses: haythem/public-ip@bdddd92c198b0955f0b494a8ebeac529754262ff # v1.3
- name: "Remove Github Action IP"
if: always()
run: |
Expand All @@ -68,7 +68,7 @@ jobs:
2>&1 > /dev/null;
- name: Archive results
if: always()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: autoscaling-report
path: ./tests/integration/container/reports
Expand Down
39 changes: 2 additions & 37 deletions common/lib/host_info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,13 @@ export class HostInfo {
public static readonly NO_PORT: number = -1;
public static readonly DEFAULT_WEIGHT: number = 100;

readonly host: string;
readonly host: string; // full domain name
readonly port: number;
role: HostRole;
readonly weight: number; // Greater or equal 0. Lesser the weight, the healthier host.
readonly lastUpdateTime: number;
availability: HostAvailability;
aliases: Set<string> = new Set<string>();
allAliases: Set<string> = new Set<string>();
hostId: string;
hostId: string; // id; could be a host name, host domain name, or a unique string
hostAvailabilityStrategy: HostAvailabilityStrategy;

constructor(
Expand All @@ -57,46 +55,13 @@ export class HostInfo {
this.weight = weight;
this.lastUpdateTime = lastUpdateTime;
this.hostAvailabilityStrategy = hostAvailabilityStrategy;
this.allAliases.add(this.asAlias).add(this.host);
this.hostId = hostId;
}

isPortSpecified(): boolean {
return this.port != HostInfo.NO_PORT;
}

addAlias(...alias: string[]) {
if (!alias || alias.length < 1) {
return;
}

alias.forEach((x) => {
this.aliases.add(x);
this.allAliases.add(x);
});
}

removeAlias(aliases: string[]) {
if (!aliases || aliases.length < 1) {
return;
}

aliases.forEach((x) => {
this.aliases.delete(x);
this.allAliases.delete(x);
});
}

resetAliases() {
this.aliases.clear();
this.allAliases.clear();
this.allAliases.add(this.asAlias);
}

get asAlias() {
return this.isPortSpecified() ? `${this.host}:${this.port}` : this.host;
}

get url() {
let url = this.hostAndPort;
if (!url.endsWith("/")) {
Expand Down
1 change: 0 additions & 1 deletion common/lib/host_list_provider/topology_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ export abstract class TopologyUtils {
.withLastUpdateTime(lastUpdateTime)
.withHostId(finalInstanceId)
.build();
host.addAlias(finalEndpoint);
return host;
}

Expand Down
Loading
Loading