Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: removed caching of ConfigManager and its flags #713

Merged
merged 28 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
98e1e9f
removed caching of configmanager, expect a lot of test cases that nee…
jeromy-cannon Oct 18, 2024
4da1d9f
enhance update readme to fail when any of the solo calls fail
jeromy-cannon Oct 18, 2024
2a51cfc
throw error when prompt is ran in non-interactive mode
jeromy-cannon Oct 18, 2024
cb8fd4f
test to see if we are tty
jeromy-cannon Oct 18, 2024
47df8c8
test something
jeromy-cannon Oct 18, 2024
206e1c9
test something else
jeromy-cannon Oct 18, 2024
09a92f1
test something else
jeromy-cannon Oct 18, 2024
106ff43
fix script
jeromy-cannon Oct 18, 2024
01d5148
try something else?
jeromy-cannon Oct 18, 2024
12bc10f
try something else?
jeromy-cannon Oct 18, 2024
aa3aa07
try something else?
jeromy-cannon Oct 18, 2024
a4b9eae
try something else?
jeromy-cannon Oct 18, 2024
40cccc0
try something else?
jeromy-cannon Oct 18, 2024
16c4c27
try something else?
jeromy-cannon Oct 18, 2024
3caf37b
try something else?
jeromy-cannon Oct 18, 2024
ff7efd7
try something else?
jeromy-cannon Oct 18, 2024
76711fb
remove duplicates reported in linter warnings
jeromy-cannon Oct 19, 2024
a2e8546
add all needed argvs
jeromy-cannon Oct 19, 2024
952895a
fix warnings and errors
jeromy-cannon Oct 19, 2024
555b75e
update readme
jeromy-cannon Oct 19, 2024
7702112
check version was showing as not used, but it was due to a miss confi…
jeromy-cannon Oct 19, 2024
31e5ed1
missing some values and defaults
jeromy-cannon Oct 19, 2024
2eb5a34
removed duplicate relay call
jeromy-cannon Oct 19, 2024
5eb142c
go ahead and update readme with it ran locally
jeromy-cannon Oct 19, 2024
4412a2b
rename to follow our convention
jeromy-cannon Oct 20, 2024
50b2f00
provide more info when mocha or chai fails
jeromy-cannon Oct 20, 2024
ea68382
fix keymanager test
jeromy-cannon Oct 20, 2024
efede45
don't need async and done
jeromy-cannon Oct 20, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/autogen/src/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export function main () {
const templateDir = path.join(outputDir, 'templates')
const configFile = path.join(templateDir, 'config.yaml')
const configData = fs.readFileSync(configFile, 'utf8')
const config = /** @type {Config} **/ yaml.load(configData)
const config = /** @type {Config} **/ yaml.load(configData, {})

// generate the workflows with changes
buildWorkflows(outputDir, templateDir, config)
Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/script/update_md.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/bin/bash
set -xeo pipefail
export SOLO_CLUSTER_NAME=solo
export SOLO_NAMESPACE=solo
export SOLO_CLUSTER_SETUP_NAMESPACE=solo-cluster

echo "Perform the following kind and solo commands and save output to environment variables"

kind create cluster -n "${SOLO_CLUSTER_NAME}" 2>&1 | tee create-cluster.log
export KIND_CREATE_CLUSTER_OUTPUT=$( cat create-cluster.log | tee test.log )

Check notice on line 10 in .github/workflows/script/update_md.sh

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

.github/workflows/script/update_md.sh#L10

Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead.

solo init | tee init.log
export SOLO_INIT_OUTPUT=$( cat init.log | tee test.log )

Check notice on line 13 in .github/workflows/script/update_md.sh

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

.github/workflows/script/update_md.sh#L13

Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead.

solo node keys --gossip-keys --tls-keys -i node1,node2,node3 | tee keys.log
export SOLO_NODE_KEY_PEM_OUTPUT=$( cat keys.log | tee test.log )

Check notice on line 16 in .github/workflows/script/update_md.sh

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

.github/workflows/script/update_md.sh#L16

Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead.

solo cluster setup -s "${SOLO_CLUSTER_SETUP_NAMESPACE}" | tee cluster-setup.log
export SOLO_CLUSTER_SETUP_OUTPUT=$( cat cluster-setup.log | tee test.log )

Check notice on line 19 in .github/workflows/script/update_md.sh

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

.github/workflows/script/update_md.sh#L19

Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead.

solo network deploy -i node1,node2,node3 -n "${SOLO_NAMESPACE}" | tee network-deploy.log
export SOLO_NETWORK_DEPLOY_OUTPUT=$( cat network-deploy.log | tee test.log )

Check notice on line 22 in .github/workflows/script/update_md.sh

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

.github/workflows/script/update_md.sh#L22

Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead.

solo node setup -i node1,node2,node3 -n "${SOLO_NAMESPACE}" | tee node-setup.log
export SOLO_NODE_SETUP_OUTPUT=$( cat node-setup.log | tee test.log )

Check notice on line 25 in .github/workflows/script/update_md.sh

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

.github/workflows/script/update_md.sh#L25

Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead.

solo node start -i node1,node2,node3 -n "${SOLO_NAMESPACE}" | tee node-start.log
export SOLO_NODE_START_OUTPUT=$( cat node-start.log | tee test.log )

Check notice on line 28 in .github/workflows/script/update_md.sh

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

.github/workflows/script/update_md.sh#L28

Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead.

solo mirror-node deploy -n "${SOLO_NAMESPACE}" | tee mirror-node-deploy.log
export SOLO_MIRROR_NODE_DEPLOY_OUTPUT=$( cat mirror-node-deploy.log | tee test.log )

Check notice on line 31 in .github/workflows/script/update_md.sh

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

.github/workflows/script/update_md.sh#L31

Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead.

solo relay deploy -i node1 -n "${SOLO_NAMESPACE}" | tee relay-deploy.log
export SOLO_RELAY_DEPLOY_OUTPUT=$( cat relay-deploy.log | tee test.log )

Check notice on line 34 in .github/workflows/script/update_md.sh

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

.github/workflows/script/update_md.sh#L34

Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead.

echo "Generate README.md"

envsubst '$KIND_CREATE_CLUSTER_OUTPUT,$SOLO_INIT_OUTPUT,$SOLO_NODE_KEY_PEM_OUTPUT,$SOLO_CLUSTER_SETUP_OUTPUT, \

Check notice on line 38 in .github/workflows/script/update_md.sh

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

.github/workflows/script/update_md.sh#L38

Expressions don't expand in single quotes, use double quotes for that.
$SOLO_NETWORK_DEPLOY_OUTPUT,$SOLO_NODE_SETUP_OUTPUT,$SOLO_NODE_START_OUTPUT,$SOLO_MIRROR_NODE_DEPLOY_OUTPUT,\
$SOLO_RELAY_DEPLOY_OUTPUT'\
< README.md.template > README.md

echo "Remove color codes and lines showing intermediate progress"

sed -i 's/\[32m//g' README.md
sed -i 's/\[33m//g' README.md
sed -i 's/\[39m//g' README.md
egrep -v '↓|❯|•' README.md > README.md.tmp && mv README.md.tmp README.md
set +x
46 changes: 4 additions & 42 deletions .github/workflows/zxc-update-readme.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,55 +110,17 @@ jobs:

- name: Update README.md
run: |
set -x
set -xeo pipefail
npm install
npm run build
npm install -g @hashgraph/solo
npm link

echo "VERSION=${{ inputs.version }}"
[[ -n "${{ inputs.version }}" ]] && npm version ${{ inputs.version }} -f --no-git-tag-version
which solo

export SOLO_CLUSTER_NAME=solo
export SOLO_NAMESPACE=solo
export SOLO_CLUSTER_SETUP_NAMESPACE=solo-cluster

echo "Perform the following kind and solo commands and save output to environment variables"

export KIND_CREATE_CLUSTER_OUTPUT=$( kind create cluster -n "${SOLO_CLUSTER_NAME}" 2>&1 | tee test.log )

export SOLO_INIT_OUTPUT=$( solo init -i node1,node2,node3 -n "${SOLO_NAMESPACE}" -s \
"${SOLO_CLUSTER_SETUP_NAMESPACE}" | tee test.log )

export SOLO_NODE_KEY_PEM_OUTPUT=$( solo node keys --gossip-keys --tls-keys | tee test.log )

export SOLO_CLUSTER_SETUP_OUTPUT=$( solo cluster setup | tee test.log )

export SOLO_NETWORK_DEPLOY_OUTPUT=$( solo network deploy | tee test.log )

export SOLO_NODE_SETUP_OUTPUT=$( solo node setup | tee test.log )

export SOLO_NODE_START_OUTPUT=$( solo node start | tee test.log )

export SOLO_MIRROR_NODE_DEPLOY_OUTPUT=$( solo mirror-node deploy | tee test.log )

export SOLO_RELAY_DEPLAY_OUTPUT=$( solo relay deploy -i node1,node2 | tee test.log )

export SOLO_RELAY_DEPLOY_OUTPUT=$( solo relay deploy | tee test.log )
echo "Generate README.md"

envsubst '$KIND_CREATE_CLUSTER_OUTPUT,$SOLO_INIT_OUTPUT,$SOLO_NODE_KEY_PEM_OUTPUT,$SOLO_CLUSTER_SETUP_OUTPUT, \
$SOLO_NETWORK_DEPLOY_OUTPUT,$SOLO_NODE_SETUP_OUTPUT,$SOLO_NODE_START_OUTPUT,$SOLO_MIRROR_NODE_DEPLOY_OUTPUT,\
$SOLO_RELAY_DEPLAY_OUTPUT,$SOLO_RELAY_DEPLOY_OUTPUT'\
< README.md.template > README.md

echo "Remove color codes and lines showing intermediate progress"

sed -i 's/\[32m//g' README.md
sed -i 's/\[33m//g' README.md
sed -i 's/\[39m//g' README.md
egrep -v '↓|❯|•' README.md > README.md.tmp && mv README.md.tmp README.md
node -p -e "Boolean(process.stdout.isTTY)"
chmod 755 ./.github/workflows/script/update_md.sh
./.github/workflows/script/update_md.sh </dev/null | cat
set +x

- name: Check README.md Changes
Expand Down
45 changes: 1 addition & 44 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@
hs_err_pid*
replay_pid*

### NotepadPP template
# Notepad++ backups #
*.bak

### VisualStudioCode template
.vscode/*
!.vscode/settings.json
Expand Down Expand Up @@ -121,11 +117,9 @@ local.properties
#.project

### Backup template
*.bak
*.gho
*.ori
*.orig
*.tmp

### PuTTY template
# Private key
Expand Down Expand Up @@ -157,32 +151,6 @@ $RECYCLE.BIN/
# Windows shortcuts
*.lnk

### Kotlin template
# Compiled class file
*.class

# Log file
*.log

# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
replay_pid*

### OpenSSL template
# OpenSSL-related files best not committed

Expand Down Expand Up @@ -252,9 +220,6 @@ bh_unicode_properties.cache
# https://packagecontrol.io/packages/sublime-github
GitHub.sublime-settings

### MicrosoftOffice template
*.tmp

# Word temporary
~$*.doc*

Expand Down Expand Up @@ -424,7 +389,7 @@ Sessionx.vim

# Temporary
.netrwhist
*~

# Auto-generated tag files
tags
# Persistent undo
Expand All @@ -434,9 +399,6 @@ tags
# It's better to unpack these files and commit the raw source because
# git has its own built in compression methods.
*.7z
*.jar
*.rar
*.zip
*.gz
*.gzip
*.tgz
Expand All @@ -445,7 +407,6 @@ tags
*.bz2
*.xz
*.lzma
*.cab
*.xar

# Packing-only formats
Expand All @@ -459,13 +420,9 @@ tags
*.egg
*.deb
*.rpm
*.msi
*.msm
*.msp
*.txz

### Patch template
*.orig
*.rej

### macOS template
Expand Down
Loading
Loading