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

Expose node component management #6769

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

janezpodhostnik
Copy link
Contributor

I wanted to use the framework for composing a node that we have in the gateway without duplicating a lot of the code onflow/flow-evm-gateway#682

The changes I needed were:

  • FlowNodeImp has *NodeConfig which I did not want to use so I pulled out a sub component NodeImp that does not have that. This forced me to change some log lines. All the info is still there, but it is in the fields instead of the message.
  • moving the ctx, cancel := context.WithCancel(context.Background()) from Run to run is not strictly necessary, but it was a bit confusing so I refactored it (I can potentially put this in a separate PR)
  • Next thing I needed was the handleComponent from FlowNodeBuilder so I changed it into a function that accepts components and a component builder + the input AddWorkersFromComponents. On Flow nodes the input is *NodeConfig, but with making ReadyDoneFactory generic the input can be anything.
  • Last change is strictly not related, and I can put it in a separate PR: I changed the metrics server into a component so that the context can be injected at the start of the metrics server.

@codecov-commenter
Copy link

codecov-commenter commented Nov 27, 2024

Codecov Report

Attention: Patch coverage is 62.03704% with 41 lines in your changes missing coverage. Please review.

Project coverage is 41.23%. Comparing base (8a3055c) to head (bacae24).

Files with missing lines Patch % Lines
module/metrics/server.go 0.00% 38 Missing ⚠️
cmd/scaffold.go 95.34% 2 Missing ⚠️
cmd/node_builder.go 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6769      +/-   ##
==========================================
- Coverage   41.26%   41.23%   -0.03%     
==========================================
  Files        2061     2061              
  Lines      182702   182736      +34     
==========================================
- Hits        75384    75355      -29     
- Misses     101010   101075      +65     
+ Partials     6308     6306       -2     
Flag Coverage Δ
unittests 41.23% <62.03%> (-0.03%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

Successfully merging this pull request may close these issues.

2 participants