-
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
Changes from 6 commits
cf1703b
94095f1
c664c66
06f5f4f
d726c11
fce999b
a2fab1e
bd718b9
ddffe9f
d9a5d64
54314f6
2f47af7
1954db7
52e1b99
5863482
ba4a315
61f569a
070e6d7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. Idealy, you should also handle changing the httpd request to There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more.
Correct, but why you are not passing the It is easy, use the following code
Suggested change
|
||||||||
|
||||||||
handle_httpd_response!(result, "Plugin '{plugin}' installed successfully") | ||||||||
} | ||||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -30,6 +30,9 @@ pub trait Repository: Any { | |||||
/// recover the repository from the commit id. | ||||||
async fn recover(&mut self) -> Result<(), CoffeeError>; | ||||||
|
||||||
/// switch to the specified branch. | ||||||
async fn switch_branch(&mut self, branch_name: &str) -> Result<(), CoffeeError>; | ||||||
Comment on lines
+37
to
+38
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Does not maske sense have the |
||||||
|
||||||
/// return the name of the repository. | ||||||
fn name(&self) -> String; | ||||||
|
||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -112,7 +112,7 @@ pub async fn init_coffee_test_add_remote() { | |
.unwrap(); | ||
manager | ||
.coffee() | ||
.install("summary", true, true) | ||
.install("summary", true, true, None) | ||
.await | ||
.unwrap(); | ||
|
||
|
@@ -167,13 +167,13 @@ pub async fn test_add_remove_plugins() { | |
); | ||
|
||
// Install summary plugin | ||
let result = manager.coffee().install("summary", true, false).await; | ||
let result = manager.coffee().install("summary", true, false, None).await; | ||
assert!(result.is_ok(), "{:?}", result); | ||
|
||
// Install helpme plugin | ||
manager | ||
.coffee() | ||
.install("helpme", true, false) | ||
.install("helpme", true, false, None) | ||
.await | ||
.unwrap(); | ||
|
||
|
@@ -276,7 +276,7 @@ pub async fn test_errors_and_show() { | |
); | ||
|
||
// Install summary plugin | ||
let result = manager.coffee().install("summary", true, false).await; | ||
let result = manager.coffee().install("summary", true, false, None).await; | ||
assert!(result.is_ok(), "{:?}", result); | ||
|
||
// Get the README file for a plugin that is not installed | ||
|
@@ -285,7 +285,7 @@ pub async fn test_errors_and_show() { | |
assert!(val.starts_with("# Helpme plugin")); | ||
|
||
// Install a plugin that is not in the repository | ||
let result = manager.coffee().install("x", true, false).await; | ||
let result = manager.coffee().install("x", true, false, None).await; | ||
assert!(result.is_err(), "{:?}", result); | ||
|
||
// Remove helpme plugin | ||
|
@@ -353,7 +353,7 @@ pub async fn install_plugin_in_two_networks() -> anyhow::Result<()> { | |
// This should install summary plugin for regtest network | ||
manager | ||
.coffee() | ||
.install("summary", true, true) | ||
.install("summary", true, true, None) | ||
.await | ||
.unwrap(); | ||
// Ensure that summary is installed for regtest network | ||
|
@@ -393,7 +393,7 @@ pub async fn install_plugin_in_two_networks() -> anyhow::Result<()> { | |
// This should install summary plugin for testnet network | ||
manager | ||
.coffee() | ||
.install("summary", true, true) | ||
.install("summary", true, true, None) | ||
.await | ||
.unwrap(); | ||
// Ensure that summary is installed for testnet network | ||
|
@@ -428,13 +428,13 @@ pub async fn test_double_slash() { | |
.unwrap(); | ||
|
||
// Install summary plugin | ||
let result = manager.coffee().install("summary", true, false).await; | ||
let result = manager.coffee().install("summary", true, false, None).await; | ||
assert!(result.is_ok(), "{:?}", result); | ||
|
||
// Install helpme plugin | ||
manager | ||
.coffee() | ||
.install("helpme", true, false) | ||
.install("helpme", true, false, None) | ||
.await | ||
.unwrap(); | ||
|
||
|
@@ -493,7 +493,7 @@ pub async fn test_plugin_installation_path() { | |
// Install summary plugin for regtest network | ||
manager | ||
.coffee() | ||
.install("summary", true, false) | ||
.install("summary", true, false, None) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Try to write a test also where you specify the branch. |
||
.await | ||
.unwrap(); | ||
|
||
|
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