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: Capture the npm_package_version #3198

Merged
merged 3 commits into from
Oct 31, 2024
Merged

Conversation

ebadiere
Copy link
Collaborator

@ebadiere ebadiere commented Oct 31, 2024

Description:
The ConfigService was using an all caps version of the npm_package_version of the env var definition but in a node context the env var is lowercase: npm_package_version. Nothing was being returned from the web3_clientVersion method.

Related issue(s):

Fixes #3197

Notes for reviewer:
Simply changing the case of the env var definition in the GlobalConfig.ts class prevents updating conditional logic that already works. Adding the version number to the root package.json file allows it to be loaded by the ConfigService.ts which loads before the acceptance tests framework.

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

@ebadiere ebadiere requested a review from a team as a code owner October 31, 2024 17:01
@ebadiere ebadiere self-assigned this Oct 31, 2024
@ebadiere ebadiere added the bug Something isn't working label Oct 31, 2024
@ebadiere ebadiere added this to the 0.59.0 milestone Oct 31, 2024
Copy link

github-actions bot commented Oct 31, 2024

Test Results

 20 files   -  3  259 suites   - 34   33m 12s ⏱️ - 4m 24s
606 tests  -  2  598 ✅ + 7  4 💤 ±0  4 ❌  -  9 
696 runs   - 98  688 ✅  - 85  4 💤  - 2  4 ❌  - 11 

For more details on these failures, see this check.

Results for commit bbce9f6. ± Comparison against base commit dfcb7cf.

This pull request removes 4 and adds 2 tests. Note that renamed tests count towards both.
"before all" hook for "@release should execute "eth_getTransactionCount" primary" ‑ RPC Server Acceptance Tests Acceptance tests @api-batch-3 RPC Server Acceptance Tests eth_getTransactionCount "before all" hook for "@release should execute "eth_getTransactionCount" primary"
"before all" hook for "Function calling HederaTokenService.isToken(token)" ‑ RPC Server Acceptance Tests Acceptance tests @api-batch-3 RPC Server Acceptance Tests eth_call with contract that calls precompiles "before all" hook for "Function calling HederaTokenService.isToken(token)"
"before all" hook in "Debug API Test Suite" ‑ RPC Server Acceptance Tests Acceptance tests @api-batch-3 RPC Server Acceptance Tests Debug API Test Suite "before all" hook in "Debug API Test Suite"
"before each" hook for "should eventually exhaust the hbar limit for a BASIC user after multiple deployments of large contracts" ‑ RPC Server Acceptance Tests Acceptance tests @hbarlimiter HBAR Limiter Acceptance Tests HBAR Rate Limit Tests "before each" hook for "should eventually exhaust the hbar limit for a BASIC user after multiple deployments of large contracts"
"before all" hook for "should execute "eth_getCode" for hts token" ‑ RPC Server Acceptance Tests Acceptance tests @api-batch-2 RPC Server Acceptance Tests eth_getCode "before all" hook for "should execute "eth_getCode" for hts token"
"before each" hook for "should execute "eth_getStorageAt" request to get current state changes without passing block" ‑ RPC Server Acceptance Tests Acceptance tests @api-batch-2 RPC Server Acceptance Tests "before each" hook for "should execute "eth_getStorageAt" request to get current state changes without passing block"

♻️ This comment has been updated with latest results.

quiet-node
quiet-node previously approved these changes Oct 31, 2024
file to allow test framework to load the value in the
config service. Also some clean up.

Signed-off-by: ebadiere <[email protected]>
quiet-node
quiet-node previously approved these changes Oct 31, 2024
package.json Show resolved Hide resolved
Copy link
Collaborator

@natanasow natanasow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

natanasow
natanasow previously approved these changes Oct 31, 2024
@natanasow
Copy link
Collaborator

natanasow commented Oct 31, 2024

@ebadiere could you run npm install locally to fix the package-lock.json as well.

@ebadiere ebadiere dismissed stale reviews from natanasow and quiet-node via bbce9f6 October 31, 2024 18:27
Copy link

sonarcloud bot commented Oct 31, 2024

@ebadiere ebadiere merged commit 74a4a03 into main Oct 31, 2024
44 of 45 checks passed
@ebadiere ebadiere deleted the 3197-npm-version-missing branch October 31, 2024 19:26
Copy link

codecov bot commented Oct 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.39%. Comparing base (dfcb7cf) to head (bbce9f6).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3198      +/-   ##
==========================================
+ Coverage   83.10%   83.39%   +0.29%     
==========================================
  Files          69       66       -3     
  Lines        4444     4283     -161     
  Branches      873      835      -38     
==========================================
- Hits         3693     3572     -121     
+ Misses        487      471      -16     
+ Partials      264      240      -24     
Flag Coverage Δ
config-service 98.14% <ø> (ø)
relay 85.60% <ø> (ø)
server 83.52% <ø> (ø)
ws-server 36.87% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...ckages/config-service/src/services/globalConfig.ts 100.00% <ø> (ø)

... and 15 files with indirect coverage changes

ebadiere added a commit that referenced this pull request Oct 31, 2024
* fix: Capture the npm_package_version

Signed-off-by: ebadiere <[email protected]>

* fix:  Adding npm_package_version at the root package.json
file to allow test framework to load the value in the
config service. Also some clean up.

Signed-off-by: ebadiere <[email protected]>

* chore: Updated package-lock.json

Signed-off-by: ebadiere <[email protected]>

---------

Signed-off-by: ebadiere <[email protected]>
ebadiere added a commit that referenced this pull request Oct 31, 2024
* fix: Capture the npm_package_version (#3198)

* fix: Capture the npm_package_version

Signed-off-by: ebadiere <[email protected]>

* fix:  Adding npm_package_version at the root package.json
file to allow test framework to load the value in the
config service. Also some clean up.

Signed-off-by: ebadiere <[email protected]>

* chore: Updated package-lock.json

Signed-off-by: ebadiere <[email protected]>

---------

Signed-off-by: ebadiere <[email protected]>

* fix: Added the correct version to the root level
package.json and rebuilt the package-lock.json.

Signed-off-by: ebadiere <[email protected]>

---------

Signed-off-by: ebadiere <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

The version from the npm package is not getting read by the config service.
3 participants