This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add tests & Service's Configuration has optional fields that shouldn't be optional #4842
Add tests & Service's Configuration has optional fields that shouldn't be optional #4842
Changes from 49 commits
ff20e5e
d0fc553
6683ebe
1b6a9e8
057d0fc
b1dc8ae
de4bd11
2b70a8a
562c8be
8218473
025b88f
f4290e2
f84cbc5
58521d1
8b618ac
76185d4
ce4bcbf
c0d27a5
0a6b34f
7ccbf6d
c6acedd
d488431
7a42b48
0b46330
faaf28d
0c0d979
4b12bfc
a780282
9546034
af8e3ff
462e7e1
6c072c2
9cef94b
df98c7d
9f25ef9
c3c23c7
9ee3e58
e42db52
3779128
65d5604
520480d
603b145
310e535
5e79434
d89b8fe
51cea65
daf8dbe
01003d3
a2b243a
4699a5b
1aa4ebb
c6eb086
8d5f16e
19cbc2d
0a39b8b
e6c3f2c
0143192
3a5a9d0
77a282d
7be6d6c
c5201de
b4aab6e
e961052
6d53bf4
96cd4ef
24a5475
c46a21b
06261d0
c502eb3
6a41c5b
2baa706
46a1ac8
3907e30
42b0cf9
b661624
1c48788
be53825
8841dfb
c61f433
399a7ca
7734c2b
861a854
1e54938
8a289e2
5780c90
eb49376
2173d22
c57fd85
df0522f
8e3118a
f11a6d5
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why aren't
init
andupdate_config
not done inside ofrun()
? Someone could just callrun()
without calling the other methods before and it would be incorrect.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because for cumulus we want to be able to modify the config before running the node.
We could have another "run" command that would do all 3 commands but we need to keep the existing 3.
Since a helper would simply call init & update_config & run, I thought it wouldn't be super helpful and I have not added it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😱 you didn't read the PR description
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code is law :P
Yeah it is okay for now. However it could happen that the user just calls
run()
(because nothing prevents them) and it will break.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this "pattern" is a let's repeat some code "pattern" :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be way less error prone than before.
Before: I had put opt.run.shared_params in the subcommand's init and it was a bug.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was panicking with a nice stacktrace in the console. I don't know why. It seems to me it's a normal user error so I changed it. No more stacktrace but the error message is still explicit enough imho.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think having some checks that the stuff we expect is happening, would be nice.
Like that
build-spec
is a valid json and contains some information.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree! I can do the valid JSON. But what information should I check?