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

fix: download JRE for keytool dependency and allow generation of pfx keys #152

Merged
merged 21 commits into from
Mar 20, 2024

Conversation

leninmehedy
Copy link
Member

@leninmehedy leninmehedy commented Mar 11, 2024

Description

This pull request changes the following:

  • feat: allow fetching keytool dependency automatically for pfx keys
  • feat: allow node keys to generate pfx keys
  • doc: refresh README with latest console output
  • use semver package for version parsing instead of "reinventing the wheel".
  • Added more test coverage

It installs JRE at ~/.solo/bin/jre and keytool will be available at: ~/.solo/bin/jre/bin/keytool

Related Issues

TODO

  • Install JRE only when user wants to create pfx keys
  • Translate the bash script into javascript code so that keytool is invoked using ShellRunner.run(...)

@leninmehedy leninmehedy requested review from a team as code owners March 11, 2024 04:52
@leninmehedy leninmehedy changed the title feat: download JRE for keytool dependency and generate pfx keys feat: download JRE for keytool dependency and allow generation of pfx keys Mar 11, 2024
Copy link
Contributor

github-actions bot commented Mar 11, 2024

Unit Test Results

  1 files  ± 0   16 suites  +2   1m 7s ⏱️ +42s
109 tests +18  109 ✅ +18  0 💤 ±0  0 ❌ ±0 
134 runs  +36  134 ✅ +36  0 💤 ±0  0 ❌ ±0 

Results for commit 9234e60. ± Comparison against base commit 54efab3.

This pull request removes 9 and adds 27 tests. Note that renamed tests count towards both.
Helpers compareVersion should fail with major version lower than target ‑ Helpers compareVersion should fail with major version lower than target
Helpers compareVersion should fail with minor version lower than target ‑ Helpers compareVersion should fail with minor version lower than target
Helpers compareVersion should succeed with a later version ‑ Helpers compareVersion should succeed with a later version
Helpers compareVersion should succeed with major version higher than target ‑ Helpers compareVersion should succeed with major version higher than target
Helpers compareVersion should succeed with minor version higher than target ‑ Helpers compareVersion should succeed with minor version higher than target
Helpers compareVersion should succeed with patch higher than target ‑ Helpers compareVersion should succeed with patch higher than target
Helpers compareVersion should succeed with same version ‑ Helpers compareVersion should succeed with same version
Helpers should parse release tag into major, minor and patch numbers ‑ Helpers should parse release tag into major, minor and patch numbers
Helpers should throw error in parsing release tag ‑ Helpers should throw error in parsing release tag
HelmDependencyManager should return helm version ‑ HelmDependencyManager should return helm version
Helpers should be able to clone array ‑ Helpers should be able to clone array
Helpers should be able to determine root-image based on Hedera platform version ‑ Helpers should be able to determine root-image based on Hedera platform version
Helpers should be able to load version from package json ‑ Helpers should be able to load version from package json
Helpers should be able to parse node ID ‑ Helpers should be able to parse node ID
KeyManager should generate pfx keys ‑ KeyManager should generate pfx keys
Keytool should run keytool -certreq [darwin] ‑ Keytool should run keytool -certreq [darwin]
Keytool should run keytool -certreq [linux] ‑ Keytool should run keytool -certreq [linux]
Keytool should run keytool -certreq [windows] ‑ Keytool should run keytool -certreq [windows]
Keytool should run keytool -exportcert [darwin] ‑ Keytool should run keytool -exportcert [darwin]
…

♻️ This comment has been updated with latest results.

Copy link
Contributor

github-actions bot commented Mar 11, 2024

E2E Test Results

53 tests  +6   53 ✅ +6   6m 2s ⏱️ + 1m 35s
 7 suites ±0    0 💤 ±0 
 1 files   ±0    0 ❌ ±0 

Results for commit 9234e60. ± Comparison against base commit 54efab3.

This pull request removes 10 and adds 16 tests. Note that renamed tests count towards both.
AccountCommand Bootstrap network for test should cleanup previous deployment ‑ AccountCommand Bootstrap network for test should cleanup previous deployment
AccountCommand Bootstrap network for test should succeed with network deploy ‑ AccountCommand Bootstrap network for test should succeed with network deploy
AccountCommand Bootstrap network for test should succeed with node setup command ‑ AccountCommand Bootstrap network for test should succeed with node setup command
AccountCommand Bootstrap network for test should succeed with node start command ‑ AccountCommand Bootstrap network for test should succeed with node start command
NodeCommand Bootstrap network for test should cleanup previous deployment ‑ NodeCommand Bootstrap network for test should cleanup previous deployment
NodeCommand Bootstrap network for test should succeed with network deploy ‑ NodeCommand Bootstrap network for test should succeed with network deploy
NodeCommand Bootstrap network for test should succeed with node setup command ‑ NodeCommand Bootstrap network for test should succeed with node setup command
NodeCommand Bootstrap network for test should succeed with node start command ‑ NodeCommand Bootstrap network for test should succeed with node start command
NodeCommand Node should start successfully [release v0.47.0-alpha.0, keyFormat: pem] Account creation should succeed ‑ NodeCommand Node should start successfully [release v0.47.0-alpha.0, keyFormat: pem] Account creation should succeed
NodeCommand Node should start successfully [release v0.47.0-alpha.0, keyFormat: pem] Balance query should succeed ‑ NodeCommand Node should start successfully [release v0.47.0-alpha.0, keyFormat: pem] Balance query should succeed
AccountCommand Bootstrap network for test [release v0.47.0-alpha.0, keyFormat: pem] should cleanup previous deployment ‑ AccountCommand Bootstrap network for test [release v0.47.0-alpha.0, keyFormat: pem] should cleanup previous deployment
AccountCommand Bootstrap network for test [release v0.47.0-alpha.0, keyFormat: pem] should succeed with network deploy ‑ AccountCommand Bootstrap network for test [release v0.47.0-alpha.0, keyFormat: pem] should succeed with network deploy
AccountCommand Bootstrap network for test [release v0.47.0-alpha.0, keyFormat: pem] should succeed with node setup command ‑ AccountCommand Bootstrap network for test [release v0.47.0-alpha.0, keyFormat: pem] should succeed with node setup command
AccountCommand Bootstrap network for test [release v0.47.0-alpha.0, keyFormat: pem] should succeed with node start command ‑ AccountCommand Bootstrap network for test [release v0.47.0-alpha.0, keyFormat: pem] should succeed with node start command
NodeCommand Bootstrap network for test [release v0.47.0-alpha.0, keyFormat: pem] should cleanup previous deployment ‑ NodeCommand Bootstrap network for test [release v0.47.0-alpha.0, keyFormat: pem] should cleanup previous deployment
NodeCommand Bootstrap network for test [release v0.47.0-alpha.0, keyFormat: pem] should succeed with network deploy ‑ NodeCommand Bootstrap network for test [release v0.47.0-alpha.0, keyFormat: pem] should succeed with network deploy
NodeCommand Bootstrap network for test [release v0.47.0-alpha.0, keyFormat: pem] should succeed with node setup command ‑ NodeCommand Bootstrap network for test [release v0.47.0-alpha.0, keyFormat: pem] should succeed with node setup command
NodeCommand Bootstrap network for test [release v0.47.0-alpha.0, keyFormat: pem] should succeed with node start command ‑ NodeCommand Bootstrap network for test [release v0.47.0-alpha.0, keyFormat: pem] should succeed with node start command
NodeCommand Bootstrap network for test [release v0.47.0-alpha.0, keyFormat: pfx] should cleanup previous deployment ‑ NodeCommand Bootstrap network for test [release v0.47.0-alpha.0, keyFormat: pfx] should cleanup previous deployment
NodeCommand Bootstrap network for test [release v0.47.0-alpha.0, keyFormat: pfx] should succeed with network deploy ‑ NodeCommand Bootstrap network for test [release v0.47.0-alpha.0, keyFormat: pfx] should succeed with network deploy
…

♻️ This comment has been updated with latest results.

jeromy-cannon
jeromy-cannon previously approved these changes Mar 11, 2024
Copy link

codecov bot commented Mar 11, 2024

Codecov Report

Attention: Patch coverage is 89.79592% with 35 lines in your changes are missing coverage. Please review.

Project coverage is 69.13%. Comparing base (54efab3) to head (9234e60).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #152      +/-   ##
==========================================
+ Coverage   65.88%   69.13%   +3.24%     
==========================================
  Files          30       32       +2     
  Lines        2864     3068     +204     
  Branches      488      473      -15     
==========================================
+ Hits         1887     2121     +234     
+ Misses        977      947      -30     
Files Coverage Δ
src/core/constants.mjs 93.24% <100.00%> (+0.48%) ⬆️
src/core/helm.mjs 90.90% <100.00%> (+0.43%) ⬆️
src/core/helpers.mjs 97.29% <100.00%> (+7.71%) ⬆️
src/core/keytool.mjs 100.00% <100.00%> (ø)
src/core/templates.mjs 77.94% <100.00%> (+1.01%) ⬆️
test/test_util.js 87.14% <100.00%> (+0.18%) ⬆️
version.mjs 100.00% <100.00%> (ø)
...re/dependency_managers/helm_dependency_manager.mjs 91.52% <92.30%> (+0.45%) ⬆️
src/core/key_manager.mjs 90.95% <97.77%> (+1.84%) ⬆️
src/core/package_downloader.mjs 92.30% <86.66%> (-0.47%) ⬇️
... and 2 more

Impacted file tree graph

Copy link

codacy-production bot commented Mar 11, 2024

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+3.44% (target: -1.00%) 90.04%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (54efab3) 2406 1594 66.25%
Head commit (9234e60) 2567 (+161) 1789 (+195) 69.69% (+3.44%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#152) 281 253 90.04%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

You may notice some variations in coverage metrics with the latest Coverage engine update. For more details, visit the documentation

JeffreyDallas
JeffreyDallas previously approved these changes Mar 12, 2024
@leninmehedy leninmehedy changed the title feat: download JRE for keytool dependency and allow generation of pfx keys fix: download JRE for keytool dependency and allow generation of pfx keys Mar 12, 2024
@leninmehedy leninmehedy marked this pull request as draft March 15, 2024 10:43
Signed-off-by: Lenin Mehedy <lenin.mehedy@swirldslabs.com>
Signed-off-by: Lenin Mehedy <lenin.mehedy@swirldslabs.com>
Signed-off-by: Lenin Mehedy <lenin.mehedy@swirldslabs.com>
Signed-off-by: Lenin Mehedy <lenin.mehedy@swirldslabs.com>
Signed-off-by: Lenin Mehedy <lenin.mehedy@swirldslabs.com>
Signed-off-by: Lenin Mehedy <lenin.mehedy@swirldslabs.com>
Signed-off-by: Lenin Mehedy <lenin.mehedy@swirldslabs.com>
Signed-off-by: Lenin Mehedy <lenin.mehedy@swirldslabs.com>
Signed-off-by: Lenin Mehedy <lenin.mehedy@swirldslabs.com>
Signed-off-by: Lenin Mehedy <lenin.mehedy@swirldslabs.com>
Signed-off-by: Lenin Mehedy <lenin.mehedy@swirldslabs.com>
Signed-off-by: Lenin Mehedy <lenin.mehedy@swirldslabs.com>
Signed-off-by: Lenin Mehedy <lenin.mehedy@swirldslabs.com>
Signed-off-by: Lenin Mehedy <lenin.mehedy@swirldslabs.com>
Signed-off-by: Lenin Mehedy <lenin.mehedy@swirldslabs.com>
Signed-off-by: Lenin Mehedy <lenin.mehedy@swirldslabs.com>
Signed-off-by: Lenin Mehedy <lenin.mehedy@swirldslabs.com>
Signed-off-by: Lenin Mehedy <lenin.mehedy@swirldslabs.com>
jeromy-cannon
jeromy-cannon previously approved these changes Mar 18, 2024
Signed-off-by: Lenin Mehedy <lenin.mehedy@swirldslabs.com>

# Conflicts:
#	package-lock.json
#	package.json
#	src/commands/node.mjs
#	src/core/constants.mjs
#	src/core/helm.mjs
#	test/e2e/commands/01_node.test.mjs
Signed-off-by: Lenin Mehedy <lenin.mehedy@swirldslabs.com>
Signed-off-by: Lenin Mehedy <lenin.mehedy@swirldslabs.com>
@leninmehedy leninmehedy merged commit 1d3dcf4 into main Mar 20, 2024
19 checks passed
@leninmehedy leninmehedy deleted the 114-install-jre branch March 20, 2024 23:12
swirlds-automation added a commit that referenced this pull request Mar 22, 2024
## [0.22.1](v0.22.0...v0.22.1) (2024-03-22)

### Bug Fixes

* download JRE for keytool dependency and allow generation of pfx keys ([#152](#152)) ([1d3dcf4](1d3dcf4))
* refactor account initialization and mirror node setup from node command ([#159](#159)) ([b1d1e2d](b1d1e2d))
* solo should use a fixed FST chart version ([#139](#139)) ([b0d5f8b](b0d5f8b))
* update HAProxy UP check to use HAProxy Data Plane API ([#173](#173)) ([a27d1d2](a27d1d2))
* use FST chart version v0.23.0 ([#170](#170)) ([54efab3](54efab3))
@swirlds-automation
Copy link
Contributor

🎉 This PR is included in version 0.22.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Download JRE if user needs to generate PFX keys
4 participants