-
Notifications
You must be signed in to change notification settings - Fork 13
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(core): make a repository dir for each network #239
base: master
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for coffee-docs canceled.
|
7bace56
to
f145b1f
Compare
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 also have a concern. The code in this PR handles moving the global repository to be network specific but does it handle the information in coffee configuration as well?
So, if we run coffee nurse
and then see coffee remote list
for a network. is the output sane?
f145b1f
to
1272fa5
Compare
ok I pushed the review you suggested @tareknaser tomorrow I will take a look if this PR is completed, but I guess yes? I m not sure just when run the nurse command |
just a reminder that #239 (review) is still not resolved |
1272fa5
to
b1d3a6a
Compare
Ok I think we must complete this, I ran into some issues that are really embracing
Yes, why they should not be sane @tareknaser? I am missing something around your point? |
ok fixed a couple of bugs found with the nurse command. Now the nurse command will migrate the directory, and then restore the repositories to have a fresh copy of them 😄 Review are welcome |
With the current code I had to run two times the nurse command to have all fixed
Maybe this is a way to do stuff but not sure if it is so good from implementation view point |
It breaks the upgrade command
|
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.
Thanks for putting this together. I like coffee nurse --verify
output
I think the method to handle this nurse strategy should handle all the related logic so we don't need to modify patch_repository_locally_absent
for example
3eabfdf
to
1cc6eb5
Compare
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.
Thanks. This resolves the initial problem, but I believe there might still be a lurking bug.
Currently, remote repositories are still global in the coffee configuration, not specific to individual networks. To reproduce: coffee remote add lightningd https://github.com/lightningd/plugins.git coffee -n testnet remote add folgore https://github.com/coffee-tools/folgore.git coffee remote list coffee -n testnet remote list coffee install folgore # Shouldn't work coffee remote rm folgore coffee -n testnet remote list ExpectedOutput for Outputtareknasser@Tareks-MacBook ~ % coffee remote add lightningd https://github.com/lightningd/plugins.git
✓ Remote added!
tareknasser@Tareks-MacBook ~ % coffee -n testnet remote add folgore https://github.com/coffee-tools/folgore.git
✓ Remote added!
tareknasser@Tareks-MacBook ~ % coffee remote list
● List of repositories
╭──────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ ● Repository Alias URL N. Plugins Git HEAD Last Update │
├──────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ ● folgore https://github.com/coffee-tools/folgore 1 09189fb 20/03/2024 │
│ ● lightningd https://github.com/lightningd/plugins 19 fef7ded 12/04/2024 │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────╯
tareknasser@Tareks-MacBook ~ % coffee -n testnet remote list
● List of repositories
╭──────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ ● Repository Alias URL N. Plugins Git HEAD Last Update │
├──────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ ● lightningd https://github.com/lightningd/plugins 19 fef7ded 12/04/2024 │
│ ● folgore https://github.com/coffee-tools/folgore 1 09189fb 20/03/2024 │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────╯
tareknasser@Tareks-MacBook ~ % coffee install folgore
✓ Compiling and installing
✓ Plugin folgore Compiled and Installed
tareknasser@Tareks-MacBook ~ % coffee remote rm folgore
✓ Remote removed!
tareknasser@Tareks-MacBook ~ % coffee -n testnet remote list
● List of repositories
╭────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ ● Repository Alias URL N. Plugins Git HEAD Last Update │
├────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ ● lightningd https://github.com/lightningd/plugins 19 fef7ded 12/04/2024 │
╰────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
I think your case can be written in some integration testing that we have, so looking in doing it |
This is the more sane thing to do because each network can have a different repository version. Link: #234 Signed-off-by: Vincenzo Palazzo <[email protected]>
1cc6eb5
to
99633ee
Compare
Thanks for this amazing catch @tareknaser I decided to fix our tests and write your example case in our test suite, to run it, run just P.S: pushed the test in a single single commit, and I find also a bug inside the nurse strategy that was not checking if there was the root repositories dir. So now we should be ok |
a592812
to
4e838c0
Compare
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.
Thanks! Everything works as expected
I really like test_migrated_repository_to_local_one
as well
Glad to see this one through
|
||
#[async_trait] | ||
impl Handler for CoffeeRepositoryDirCleanUpStrategy { | ||
async fn can_be_applied( |
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.
Currently running coffee nurse
only detects that bitcoin
network has the defect.
Same goes for coffee -n testnet nurse
, it only detects that testnet
has the the defect.
This is an issue because nurse
removes the global repositories folder so running it the second time for another network won't find the global repositories folder.
The handler for CoffeeRepositoryDirCleanUpStrategy
should look for all networks directories and fix them all at once.
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 are right!
Adding a new case for the coffe nurse command to clean up the global repository directory and move it insied the network subdirectory. Signed-off-by: Vincenzo Palazzo <[email protected]>
Signed-off-by: Vincenzo Palazzo <[email protected]>
Signed-off-by: Vincenzo Palazzo <[email protected]>
Signed-off-by: Vincenzo Palazzo <[email protected]>
99e6ad2
to
4528011
Compare
Find a bug when I try to add two times the same repo but in different network
|
Good point. We need to modify |
Thanks for suggesting the fix, I will try to look at this tomorrow :) |
MH we should push this forward! |
This is the more sane thing to do because each network can have a different repository version.
Fixes: #234
Fixes #233