Skip to content

Commit

Permalink
Merge pull request #401 from HathorNetwork/release-candidate
Browse files Browse the repository at this point in the history
Release v0.25.0
  • Loading branch information
r4mmer authored Feb 16, 2024
2 parents 62005a7 + 8c7cf78 commit 2f9663a
Show file tree
Hide file tree
Showing 38 changed files with 1,287 additions and 328 deletions.
23 changes: 14 additions & 9 deletions .github/workflows/apidocs-upload.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: apidocs
name: apidocs-upload

on:
push:
Expand All @@ -10,8 +10,6 @@ jobs:
# First check if this version is a valid public release
check-version:
runs-on: ubuntu-22.04
permissions:
id-token: write # This is required for requesting the JWT
outputs:
release_status_output: ${{ steps.release_version.outputs.version_status_output }}

Expand All @@ -22,7 +20,8 @@ jobs:
run: |
if [[ "${{ github.ref }}" = refs/tags/* ]]; then
version="${ref#refs/tags/}"
version="${GITHUB_REF#refs/tags/}"
echo "version=$version"

# Pattern that accepts "v1.0.0" , "v2.4.6".
if [[ "$version" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
Expand All @@ -43,10 +42,16 @@ jobs:
# Initiate upload only if the version is valid
upload-apidocs:
runs-on: ubuntu-22.04
permissions:
id-token: write # This is required for requesting the JWT
needs: check-version
env:
release_status: ${{ needs.test_version.outputs.release_status_output }}
if: ${{ env.release_status == 'isRelease' || env.release_status == 'isReleaseCandidate' }}
if: >-
${{
needs.check-version.outputs.release_status_output == 'isRelease' ||
needs.check-version.outputs.release_status_output == 'isReleaseCandidate'
}}
timeout-minutes: 10

strategy:
Expand Down Expand Up @@ -84,15 +89,15 @@ jobs:
# https://github.com/aws-actions/configure-aws-credentials/releases/tag/v4.0.1
uses: aws-actions/configure-aws-credentials@010d0da01d0b5a38af31e9c3470dbfdabdecca3a
with:
aws-assume-role: ${{ secrets.AWS_HEADLESS_UPLOAD_ROLE }}
role-to-assume: ${{ secrets.AWS_HEADLESS_UPLOAD_ROLE }}
aws-region: us-east-1

# Copy the document to S3
- name: Upload apidocs.json to S3
run: |
if [[ "${{ env.release_status }}" == "isReleaseCandidate" ]]; then
aws s3 cp index.html s3://${{ secrets.AWS_APIDOCS_BUCKET_NAME_DEV }}
else
if [[ "${{ env.release_status }}" == "isRelease" ]]; then
aws s3 cp index.html s3://${{ secrets.AWS_APIDOCS_BUCKET_NAME_PROD }}
else
aws s3 cp index.html s3://${{ secrets.AWS_APIDOCS_BUCKET_NAME_DEV }}
fi
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ __pycache__/
coverage
coverage-integration

.vscode
.DS_Store

tmp/
Expand Down
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v16
13 changes: 0 additions & 13 deletions RELEASING.md

This file was deleted.

3 changes: 3 additions & 0 deletions __tests__/__fixtures__/feature-fixture.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ const constants = {

SWAP_SERVICE_MAINNET_BASE_URL: 'https://atomic-swap-service.mainnet.mock/',
SWAP_SERVICE_TESTNET_BASE_URL: 'https://atomic-swap-service.testnet.mock/',

DEFAULT_PASSWORD: '123',
DEFAULT_PIN: '123',
};

// Allow change config at runtime
Expand Down
3 changes: 3 additions & 0 deletions __tests__/__fixtures__/settings-fixture.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ const defaultConfig = {
network: 'testnet',
server: 'http://fakehost:8083/v1a/',
txMiningUrl: 'http://fake.txmining:8084/',
hsmHost: 'fake-hsm-host',
hsmUsername: 'hathor-test',
hsmPassword: 'hathor-pass',
seeds: {
stub_seed:
'upon tennis increase embark dismiss diamond monitor face magnet jungle scout salute rural master shoulder cry juice jeans radar present close meat antenna mind',
Expand Down
72 changes: 56 additions & 16 deletions __tests__/healthcheck.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,42 +61,51 @@ describe('healthcheck api', () => {

expect(response.body).toStrictEqual({
status: 'pass',
description: 'Wallet-headless health',
description: 'Health status of hathor-wallet-headless',
httpStatusCode: 200,
checks: {
'Wallet health_wallet': [
{
componentName: 'Wallet health_wallet',
componentId: 'health_wallet',
componentType: 'internal',
status: 'pass',
output: 'Wallet is ready',
time: expect.any(String),
affectsServiceHealth: true,
},
],
'Wallet another_health_wallet': [
{
componentName: 'Wallet another_health_wallet',
componentId: 'another_health_wallet',
componentType: 'internal',
status: 'pass',
output: 'Wallet is ready',
time: expect.any(String),
affectsServiceHealth: true,
},
],
'Fullnode http://fakehost:8083/v1a/': [
{
componentName: 'Fullnode http://fakehost:8083/v1a/',
componentType: 'fullnode',
componentId: 'http://fakehost:8083/v1a/',
componentType: 'http',
status: 'pass',
output: 'Fullnode is responding',
time: expect.any(String),
affectsServiceHealth: true,
},
],
'TxMiningService http://fake.txmining:8084/': [
{
componentName: 'TxMiningService http://fake.txmining:8084/',
componentType: 'service',
componentId: 'http://fake.txmining:8084/',
componentType: 'http',
status: 'pass',
output: 'Tx Mining Service is healthy',
time: expect.any(String),
affectsServiceHealth: true,
},
],
}
Expand All @@ -118,33 +127,40 @@ describe('healthcheck api', () => {

expect(response.body).toStrictEqual({
status: 'fail',
description: 'Wallet-headless health',
description: 'Health status of hathor-wallet-headless',
httpStatusCode: 503,
checks: {
'Wallet health_wallet': [
{
componentName: 'Wallet health_wallet',
componentId: 'health_wallet',
componentType: 'internal',
status: 'fail',
output: 'Wallet is not ready. Current state: Syncing',
time: expect.any(String),
affectsServiceHealth: true,
},
],
'Fullnode http://fakehost:8083/v1a/': [
{
componentName: 'Fullnode http://fakehost:8083/v1a/',
componentType: 'fullnode',
componentId: 'http://fakehost:8083/v1a/',
componentType: 'http',
status: 'pass',
output: 'Fullnode is responding',
time: expect.any(String),
affectsServiceHealth: true,
},
],
'TxMiningService http://fake.txmining:8084/': [
{
componentName: 'TxMiningService http://fake.txmining:8084/',
componentType: 'service',
componentId: 'http://fake.txmining:8084/',
componentType: 'http',
status: 'pass',
output: 'Tx Mining Service is healthy',
time: expect.any(String),
affectsServiceHealth: true,
},
],
}
Expand All @@ -164,33 +180,40 @@ describe('healthcheck api', () => {

expect(response.body).toStrictEqual({
status: 'fail',
description: 'Wallet-headless health',
description: 'Health status of hathor-wallet-headless',
httpStatusCode: 503,
checks: {
'Wallet health_wallet': [
{
componentName: 'Wallet health_wallet',
componentId: 'health_wallet',
componentType: 'internal',
status: 'pass',
output: 'Wallet is ready',
time: expect.any(String),
affectsServiceHealth: true,
},
],
'Fullnode http://fakehost:8083/v1a/': [
{
componentName: 'Fullnode http://fakehost:8083/v1a/',
componentType: 'fullnode',
componentId: 'http://fakehost:8083/v1a/',
componentType: 'http',
status: 'fail',
output: 'Fullnode reported as unhealthy: {"status":"fail"}',
time: expect.any(String),
affectsServiceHealth: true,
},
],
'TxMiningService http://fake.txmining:8084/': [
{
componentName: 'TxMiningService http://fake.txmining:8084/',
componentType: 'service',
componentId: 'http://fake.txmining:8084/',
componentType: 'http',
status: 'pass',
output: 'Tx Mining Service is healthy',
time: expect.any(String),
affectsServiceHealth: true,
},
],
}
Expand All @@ -210,33 +233,40 @@ describe('healthcheck api', () => {

expect(response.body).toStrictEqual({
status: 'fail',
description: 'Wallet-headless health',
description: 'Health status of hathor-wallet-headless',
httpStatusCode: 503,
checks: {
'Wallet health_wallet': [
{
componentName: 'Wallet health_wallet',
componentId: 'health_wallet',
componentType: 'internal',
status: 'pass',
output: 'Wallet is ready',
time: expect.any(String),
affectsServiceHealth: true,
},
],
'Fullnode http://fakehost:8083/v1a/': [
{
componentName: 'Fullnode http://fakehost:8083/v1a/',
componentType: 'fullnode',
componentId: 'http://fakehost:8083/v1a/',
componentType: 'http',
status: 'pass',
output: 'Fullnode is responding',
time: expect.any(String),
affectsServiceHealth: true,
},
],
'TxMiningService http://fake.txmining:8084/': [
{
componentName: 'TxMiningService http://fake.txmining:8084/',
componentType: 'service',
componentId: 'http://fake.txmining:8084/',
componentType: 'http',
status: 'fail',
output: 'Tx Mining Service reported as unhealthy: {"status":"fail"}',
time: expect.any(String),
affectsServiceHealth: true,
},
],
}
Expand All @@ -251,24 +281,29 @@ describe('healthcheck api', () => {

expect(response.body).toStrictEqual({
status: 'pass',
description: 'Wallet-headless health',
description: 'Health status of hathor-wallet-headless',
httpStatusCode: 200,
checks: {
'Wallet health_wallet': [
{
componentName: 'Wallet health_wallet',
componentId: 'health_wallet',
componentType: 'internal',
status: 'pass',
output: 'Wallet is ready',
time: expect.any(String),
affectsServiceHealth: true,
},
],
'TxMiningService http://fake.txmining:8084/': [
{
componentName: 'TxMiningService http://fake.txmining:8084/',
componentType: 'service',
componentId: 'http://fake.txmining:8084/',
componentType: 'http',
status: 'pass',
output: 'Tx Mining Service is healthy',
time: expect.any(String),
affectsServiceHealth: true,
},
],
}
Expand All @@ -283,24 +318,29 @@ describe('healthcheck api', () => {

expect(response.body).toStrictEqual({
status: 'pass',
description: 'Wallet-headless health',
description: 'Health status of hathor-wallet-headless',
httpStatusCode: 200,
checks: {
'Wallet health_wallet': [
{
componentName: 'Wallet health_wallet',
componentId: 'health_wallet',
componentType: 'internal',
status: 'pass',
output: 'Wallet is ready',
time: expect.any(String),
affectsServiceHealth: true,
},
],
'Fullnode http://fakehost:8083/v1a/': [
{
componentName: 'Fullnode http://fakehost:8083/v1a/',
componentType: 'fullnode',
componentId: 'http://fakehost:8083/v1a/',
componentType: 'http',
status: 'pass',
output: 'Fullnode is responding',
time: expect.any(String),
affectsServiceHealth: true,
},
],
}
Expand Down
Loading

0 comments on commit 2f9663a

Please sign in to comment.