-
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: branch support in installation #224
Conversation
✅ Deploy Preview for coffee-docs canceled.
|
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 do not see the code that does really this, but as a first set up code
fix: arg macro
349dbb9
to
cf1703b
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.
Some API upgrade is missing inside the test, make check
should help to to upgrade
coffee_1 | Compiling tests v0.1.0 (/workdir/tests)
coffee_1 | error[E0061]: this method takes 4 arguments but 3 arguments were supplied
coffee_1 | --> tests/src/coffee_integration_tests.rs:115:10
coffee_1 | |
coffee_1 | 115 | .install("summary", true, true)
coffee_1 | | ^^^^^^^----------------------- an argument of type `Option<std::string::String>` is missing
coffee_1 | |
coffee_1 | note: method defined here
coffee_1 | --> /workdir/coffee_lib/src/plugin_manager.rs:14:14
coffee_1 | |
coffee_1 | 14 | async fn install(
coffee_1 | | ^^^^^^^
coffee_1 | help: provide the argument
coffee_1 | |
coffee_1 | 115 | .install("summary", true, true, /* Option<std::string::String> */)
coffee_1 | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
coffee_1 |
coffee_1 | error[E0061]: this method takes 4 arguments but 3 arguments were supplied
coffee_1 | --> tests/src/coffee_integration_tests.rs:170:35
coffee_1 | |
coffee_1 | 170 | let result = manager.coffee().install("summary", true, false).await;
coffee_1 | | ^^^^^^^------------------------ an argument of type `Option<std::string::String>` is missing
coffee_1 | |
coffee_1 | note: method defined here
coffee_1 | --> /workdir/coffee_lib/src/plugin_manager.rs:14:14
coffee_1 | |
coffee_1 | 14 | async fn install(
coffee_1 | | ^^^^^^^
coffee_1 | help: provide the argument
coffee_1 | |
coffee_1 | 170 | let result = manager.coffee().install("summary", true, false, /* Option<std::string::String> */).await;
coffee_1 | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
coffee_1 |
coffee_1 | error[E0061]: this method takes 4 arguments but 3 arguments were supplied
coffee_1 | --> tests/src/coffee_integration_tests.rs:176:10
coffee_1 | |
coffee_1 | 176 | .install("helpme", true, false)
coffee_1 | | ^^^^^^^----------------------- an argument of type `Option<std::string::String>` is missing
coffee_1 | |
coffee_1 | note: method defined here
coffee_1 | --> /workdir/coffee_lib/src/plugin_manager.rs:14:14
coffee_1 | |
coffee_1 | 14 | async fn install(
coffee_1 | | ^^^^^^^
coffee_1 | help: provide the argument
coffee_1 | |
coffee_1 | 176 | .install("helpme", true, false, /* Option<std::string::String> */)
coffee_1 | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
coffee_1 |
coffee_1 | error[E0061]: this method takes 4 arguments but 3 arguments were supplied
coffee_1 | --> tests/src/coffee_integration_tests.rs:279:35
coffee_1 | |
coffee_1 | 279 | let result = manager.coffee().install("summary", true, false).await;
coffee_1 | | ^^^^^^^------------------------ an argument of type `Option<std::string::String>` is missing
coffee_1 | |
coffee_1 | note: method defined here
coffee_1 | --> /workdir/coffee_lib/src/plugin_manager.rs:14:14
coffee_1 | |
coffee_1 | 14 | async fn install(
coffee_1 | | ^^^^^^^
coffee_1 | help: provide the argument
coffee_1 | |
coffee_1 | 279 | let result = manager.coffee().install("summary", true, false, /* Option<std::string::String> */).await;
coffee_1 | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
coffee_1 |
coffee_1 | error[E0061]: this method takes 4 arguments but 3 arguments were supplied
coffee_1 | --> tests/src/coffee_integration_tests.rs:288:35
coffee_1 | |
coffee_1 | 288 | let result = manager.coffee().install("x", true, false).await;
coffee_1 | | ^^^^^^^------------------ an argument of type `Option<std::string::String>` is missing
coffee_1 | |
coffee_1 | note: method defined here
coffee_1 | --> /workdir/coffee_lib/src/plugin_manager.rs:14:14
coffee_1 | |
coffee_1 | 14 | async fn install(
coffee_1 | | ^^^^^^^
coffee_1 | help: provide the argument
coffee_1 | |
coffee_1 | 288 | let result = manager.coffee().install("x", true, false, /* Option<std::string::String> */).await;
coffee_1 | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
coffee_1 |
coffee_1 | error[E0061]: this method takes 4 arguments but 3 arguments were supplied
coffee_1 | --> tests/src/coffee_integration_tests.rs:356:10
coffee_1 | |
coffee_1 | 356 | .install("summary", true, true)
coffee_1 | | ^^^^^^^----------------------- an argument of type `Option<std::string::String>` is missing
coffee_1 | |
coffee_1 | note: method defined here
coffee_1 | --> /workdir/coffee_lib/src/plugin_manager.rs:14:14
coffee_1 | |
coffee_1 | 14 | async fn install(
coffee_1 | | ^^^^^^^
coffee_1 | help: provide the argument
coffee_1 | |
coffee_1 | 356 | .install("summary", true, true, /* Option<std::string::String> */)
coffee_1 | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
coffee_1 |
coffee_1 | error[E0061]: this method takes 4 arguments but 3 arguments were supplied
coffee_1 | --> tests/src/coffee_integration_tests.rs:396:10
coffee_1 | |
coffee_1 | 396 | .install("summary", true, true)
coffee_1 | | ^^^^^^^----------------------- an argument of type `Option<std::string::String>` is missing
coffee_1 | |
coffee_1 | note: method defined here
coffee_1 | --> /workdir/coffee_lib/src/plugin_manager.rs:14:14
coffee_1 | |
coffee_1 | 14 | async fn install(
coffee_1 | | ^^^^^^^
coffee_1 | help: provide the argument
coffee_1 | |
coffee_1 | 396 | .install("summary", true, true, /* Option<std::string::String> */)
coffee_1 | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
coffee_1 |
coffee_1 | error[E0061]: this method takes 4 arguments but 3 arguments were supplied
coffee_1 | --> tests/src/coffee_integration_tests.rs:431:35
coffee_1 | |
coffee_1 | 431 | let result = manager.coffee().install("summary", true, false).await;
coffee_1 | | ^^^^^^^------------------------ an argument of type `Option<std::string::String>` is missing
coffee_1 | |
coffee_1 | note: method defined here
coffee_1 | --> /workdir/coffee_lib/src/plugin_manager.rs:14:14
coffee_1 | |
coffee_1 | 14 | async fn install(
coffee_1 | | ^^^^^^^
coffee_1 | help: provide the argument
coffee_1 | |
coffee_1 | 431 | let result = manager.coffee().install("summary", true, false, /* Option<std::string::String> */).await;
coffee_1 | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
coffee_1 |
coffee_1 | error[E0061]: this method takes 4 arguments but 3 arguments were supplied
coffee_1 | --> tests/src/coffee_integration_tests.rs:437:10
coffee_1 | |
coffee_1 | 437 | .install("helpme", true, false)
coffee_1 | | ^^^^^^^----------------------- an argument of type `Option<std::string::String>` is missing
coffee_1 | |
coffee_1 | note: method defined here
coffee_1 | --> /workdir/coffee_lib/src/plugin_manager.rs:14:14
coffee_1 | |
coffee_1 | 14 | async fn install(
coffee_1 | | ^^^^^^^
coffee_1 | help: provide the argument
coffee_1 | |
coffee_1 | 437 | .install("helpme", true, false, /* Option<std::string::String> */)
coffee_1 | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
coffee_1 |
coffee_1 | error[E0061]: this method takes 4 arguments but 3 arguments were supplied
coffee_1 | --> tests/src/coffee_integration_tests.rs:496:10
coffee_1 | |
coffee_1 | 496 | .install("summary", true, false)
coffee_1 | | ^^^^^^^------------------------ an argument of type `Option<std::string::String>` is missing
coffee_1 | |
coffee_1 | note: method defined here
coffee_1 | --> /workdir/coffee_lib/src/plugin_manager.rs:14:14
coffee_1 | |
coffee_1 | 14 | async fn install(
coffee_1 | | ^^^^^^^
coffee_1 | help: provide the argument
coffee_1 | |
coffee_1 | 496 | .install("summary", true, false, /* Option<std::string::String> */)
coffee_1 | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
coffee_1 |
coffee_1 | For more information about this error, try `rustc --explain E0061`.
coffee_1 | error: could not compile `tests` (lib test) due to 10 previous errors
coffee_1 | make: *** [Makefile:35: integration] Error 101
I don't see any issue with For your reference-
|
Sorry It is my bad I give you the wrong information, this is the command that the CI runs https://github.com/coffee-tools/coffee/blob/master/docker/entrypoint.sh#L2 |
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.
Great progress! I've left some comments. Keep up the good work!
coffee_core/src/coffee.rs
Outdated
@@ -247,6 +247,7 @@ impl PluginManager for CoffeeManager { | |||
plugin: &str, | |||
verbose: bool, | |||
try_dynamic: bool, | |||
_branch: Option<String>, |
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 value isn't used anywhere
coffee_httpd/src/httpd/server.rs
Outdated
@@ -91,7 +91,7 @@ async fn coffee_install( | |||
let try_dynamic = body.try_dynamic; | |||
|
|||
let mut coffee = data.coffee.lock().await; | |||
let result = coffee.install(plugin, false, try_dynamic).await; | |||
let result = coffee.install(plugin, false, try_dynamic, None).await; |
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.
Idealy, you should also handle changing the httpd request to coffee.install()
method
You can add the field to Install
struct in coffee_lib/src/types/mod.rs
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.
Maybe you meant this, but I am not sure if this is correct- d726c11
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.
Maybe you meant this, but I am not sure if this is correct- d726c11
Correct, but why you are not passing the branch
variable down the function call? I am really confused
It is easy, use the following code
let result = coffee.install(plugin, false, try_dynamic, None).await; | |
let branch = body.branch; | |
let result = coffee.install(plugin, false, try_dynamic, branch).await; |
cda659d
to
c664c66
Compare
adding this to the milestone, but would love to have a summary of the status of this before starting review it |
@vincenzopalazzo |
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.
Left some review, but the sentiments is the one of few months ago
looks like the real code it is missing :/ and this PR is just moving coding around
coffee_httpd/src/httpd/server.rs
Outdated
@@ -91,7 +91,7 @@ async fn coffee_install( | |||
let try_dynamic = body.try_dynamic; | |||
|
|||
let mut coffee = data.coffee.lock().await; | |||
let result = coffee.install(plugin, false, try_dynamic).await; | |||
let result = coffee.install(plugin, false, try_dynamic, None).await; |
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.
Maybe you meant this, but I am not sure if this is correct- d726c11
Correct, but why you are not passing the branch
variable down the function call? I am really confused
It is easy, use the following code
let result = coffee.install(plugin, false, try_dynamic, None).await; | |
let branch = body.branch; | |
let result = coffee.install(plugin, false, try_dynamic, branch).await; |
/// switch to the specified branch. | ||
async fn switch_branch(&mut self, branch_name: &str) -> Result<(), CoffeeError>; |
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.
/// switch to the specified branch. | |
async fn switch_branch(&mut self, branch_name: &str) -> Result<(), CoffeeError>; |
Does not maske sense have the switch_branch
inside the repository interface, it can be just an util. For example look at the repository.upgrade
code
.install("summary", true, false) | ||
.install("summary", true, false, None) |
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.
Try to write a test also where you specify the branch.
Enables users to specify a branch during plugin installation in Coffee. This PR is a work in progress and not yet completed.
Reference- #205