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

feat(httpd): implement install and remove enpoints #157

Merged
merged 4 commits into from
Jul 11, 2023

Conversation

tareknaser
Copy link
Collaborator

This pull request adds two new endpoints:

  • coffee_install
  • coffee_remove

To test the new endpoints:

curl -X 'POST' \
  'http://localhost:8080/install' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "plugin": "summary"
}' 
curl -X 'POST' \
  'http://localhost:8080/remove' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "plugin": "summary"
}' 

@netlify
Copy link

netlify bot commented Jun 25, 2023

Deploy Preview for coffee-docs canceled.

Name Link
🔨 Latest commit 36bb8de
🔍 Latest deploy log https://app.netlify.com/sites/coffee-docs/deploys/64aca015c57b58000842e8da

Copy link
Contributor

@vincenzopalazzo vincenzopalazzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments but overall looks good

coffee_httpd/src/httpd/server.rs Outdated Show resolved Hide resolved
coffee_httpd/src/httpd/server.rs Outdated Show resolved Hide resolved
coffee_httpd/src/httpd/server.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@vincenzopalazzo vincenzopalazzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK the CI is happy and we are all happy too

I added a couple of suggestion below

coffee_httpd/src/httpd/server.rs Outdated Show resolved Hide resolved
coffee_httpd/src/httpd/server.rs Outdated Show resolved Hide resolved
coffee_httpd/src/httpd/server.rs Outdated Show resolved Hide resolved
coffee_httpd/src/httpd/server.rs Outdated Show resolved Hide resolved
coffee_httpd/src/httpd/utils.rs Outdated Show resolved Hide resolved
tests/Cargo.toml Outdated Show resolved Hide resolved
Copy link
Contributor

@vincenzopalazzo vincenzopalazzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok I made another pass to this, but we are close

coffee_httpd/src/main.rs Outdated Show resolved Hide resolved
coffee_lib/src/macros.rs Outdated Show resolved Hide resolved
coffee_lib/src/types/mod.rs Outdated Show resolved Hide resolved
coffee_testing/src/lib.rs Outdated Show resolved Hide resolved
coffee_testing/src/lib.rs Outdated Show resolved Hide resolved
coffee_lib/Cargo.toml Outdated Show resolved Hide resolved
coffee_httpd/src/main.rs Outdated Show resolved Hide resolved
coffee_lib/Cargo.toml Outdated Show resolved Hide resolved
coffee_lib/Cargo.toml Outdated Show resolved Hide resolved
coffee_lib/src/types/mod.rs Show resolved Hide resolved
coffee_lib/src/types/mod.rs Show resolved Hide resolved
Signed-off-by: Tarek <tareknaser360@gmail.com>
Signed-off-by: Tarek <tareknaser360@gmail.com>
Signed-off-by: Tarek <tareknaser360@gmail.com>
Signed-off-by: Tarek <tareknaser360@gmail.com>
@vincenzopalazzo vincenzopalazzo merged commit 049b475 into coffee-tools:master Jul 11, 2023
9 checks passed
@tareknaser tareknaser deleted the http branch July 11, 2023 00:33
vincenzopalazzo added a commit that referenced this pull request Jul 29, 2023
If you are installing coffee with make install you will receive
the following error

```
   Compiling git2 v0.16.1
   Compiling coffee_lib v0.1.0 (/home/vincent/Github/coffee/coffee/coffee_lib)
error[E0433]: failed to resolve: use of undeclared crate or module `paperclip`
 --> coffee_lib/src/types/mod.rs:5:9
  |
5 |     use paperclip::actix::Apiv2Schema;
  |         ^^^^^^^^^ use of undeclared crate or module `paperclip`

error: cannot determine resolution for the derive macro `Apiv2Schema`
 --> coffee_lib/src/types/mod.rs:8:34
  |
8 |     #[derive(Debug, Deserialize, Apiv2Schema, Serialize)]
  |                                  ^^^^^^^^^^^
  |
  = note: import resolution is stuck, try simplifying macro imports

error: cannot determine resolution for the derive macro `Apiv2Schema`
  --> coffee_lib/src/types/mod.rs:14:34
   |
14 |     #[derive(Debug, Deserialize, Apiv2Schema, Serialize)]
   |                                  ^^^^^^^^^^^
   |
   = note: import resolution is stuck, try simplifying macro imports

error: cannot determine resolution for the derive macro `Apiv2Schema`
  --> coffee_lib/src/types/mod.rs:19:34
   |
19 |     #[derive(Debug, Deserialize, Apiv2Schema, Serialize)]
   |                                  ^^^^^^^^^^^
   |
   = note: import resolution is stuck, try simplifying macro imports

error: cannot determine resolution for the derive macro `Apiv2Schema`
  --> coffee_lib/src/types/mod.rs:25:34
   |
25 |     #[derive(Debug, Deserialize, Apiv2Schema, Serialize)]
   |                                  ^^^^^^^^^^^
   |
   = note: import resolution is stuck, try simplifying macro imports

error: cannot determine resolution for the derive macro `Apiv2Schema`
  --> coffee_lib/src/types/mod.rs:30:34
   |
30 |     #[derive(Debug, Deserialize, Apiv2Schema, Serialize)]
   |                                  ^^^^^^^^^^^
   |
   = note: import resolution is stuck, try simplifying macro imports

For more information about this error, try `rustc --explain E0433`.
error: could not compile `coffee_lib` (lib) due to 6 previous errors
warning: build failed, waiting for other jobs to finish...
error: failed to compile `coffee v0.0.1-alpha.1 (/home/vincent/Github/coffee/coffee/coffee_cmd)`, intermediate artifacts can be found at `/home/vincent/Github/coffee/coffee/target`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

```

This commit fix the confitional compilation

Fixes: 57b218d
Link #157
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
vincenzopalazzo added a commit that referenced this pull request Jul 29, 2023
If you are installing coffee with make install you will receive
the following error

```
   Compiling git2 v0.16.1
   Compiling coffee_lib v0.1.0 (/home/vincent/Github/coffee/coffee/coffee_lib)
error[E0433]: failed to resolve: use of undeclared crate or module `paperclip`
 --> coffee_lib/src/types/mod.rs:5:9
  |
5 |     use paperclip::actix::Apiv2Schema;
  |         ^^^^^^^^^ use of undeclared crate or module `paperclip`

error: cannot determine resolution for the derive macro `Apiv2Schema`
 --> coffee_lib/src/types/mod.rs:8:34
  |
8 |     #[derive(Debug, Deserialize, Apiv2Schema, Serialize)]
  |                                  ^^^^^^^^^^^
  |
  = note: import resolution is stuck, try simplifying macro imports

error: cannot determine resolution for the derive macro `Apiv2Schema`
  --> coffee_lib/src/types/mod.rs:14:34
   |
14 |     #[derive(Debug, Deserialize, Apiv2Schema, Serialize)]
   |                                  ^^^^^^^^^^^
   |
   = note: import resolution is stuck, try simplifying macro imports

error: cannot determine resolution for the derive macro `Apiv2Schema`
  --> coffee_lib/src/types/mod.rs:19:34
   |
19 |     #[derive(Debug, Deserialize, Apiv2Schema, Serialize)]
   |                                  ^^^^^^^^^^^
   |
   = note: import resolution is stuck, try simplifying macro imports

error: cannot determine resolution for the derive macro `Apiv2Schema`
  --> coffee_lib/src/types/mod.rs:25:34
   |
25 |     #[derive(Debug, Deserialize, Apiv2Schema, Serialize)]
   |                                  ^^^^^^^^^^^
   |
   = note: import resolution is stuck, try simplifying macro imports

error: cannot determine resolution for the derive macro `Apiv2Schema`
  --> coffee_lib/src/types/mod.rs:30:34
   |
30 |     #[derive(Debug, Deserialize, Apiv2Schema, Serialize)]
   |                                  ^^^^^^^^^^^
   |
   = note: import resolution is stuck, try simplifying macro imports

For more information about this error, try `rustc --explain E0433`.
error: could not compile `coffee_lib` (lib) due to 6 previous errors
warning: build failed, waiting for other jobs to finish...
error: failed to compile `coffee v0.0.1-alpha.1 (/home/vincent/Github/coffee/coffee/coffee_cmd)`, intermediate artifacts can be found at `/home/vincent/Github/coffee/coffee/target`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

```

This commit fix the confitional compilation

Fixes: 57b218d
Link #157
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
vincenzopalazzo added a commit that referenced this pull request Jul 29, 2023
If you are installing coffee with make install you will receive
the following error

```
   Compiling git2 v0.16.1
   Compiling coffee_lib v0.1.0 (/home/vincent/Github/coffee/coffee/coffee_lib)
error[E0433]: failed to resolve: use of undeclared crate or module `paperclip`
 --> coffee_lib/src/types/mod.rs:5:9
  |
5 |     use paperclip::actix::Apiv2Schema;
  |         ^^^^^^^^^ use of undeclared crate or module `paperclip`

error: cannot determine resolution for the derive macro `Apiv2Schema`
 --> coffee_lib/src/types/mod.rs:8:34
  |
8 |     #[derive(Debug, Deserialize, Apiv2Schema, Serialize)]
  |                                  ^^^^^^^^^^^
  |
  = note: import resolution is stuck, try simplifying macro imports

error: cannot determine resolution for the derive macro `Apiv2Schema`
  --> coffee_lib/src/types/mod.rs:14:34
   |
14 |     #[derive(Debug, Deserialize, Apiv2Schema, Serialize)]
   |                                  ^^^^^^^^^^^
   |
   = note: import resolution is stuck, try simplifying macro imports

error: cannot determine resolution for the derive macro `Apiv2Schema`
  --> coffee_lib/src/types/mod.rs:19:34
   |
19 |     #[derive(Debug, Deserialize, Apiv2Schema, Serialize)]
   |                                  ^^^^^^^^^^^
   |
   = note: import resolution is stuck, try simplifying macro imports

error: cannot determine resolution for the derive macro `Apiv2Schema`
  --> coffee_lib/src/types/mod.rs:25:34
   |
25 |     #[derive(Debug, Deserialize, Apiv2Schema, Serialize)]
   |                                  ^^^^^^^^^^^
   |
   = note: import resolution is stuck, try simplifying macro imports

error: cannot determine resolution for the derive macro `Apiv2Schema`
  --> coffee_lib/src/types/mod.rs:30:34
   |
30 |     #[derive(Debug, Deserialize, Apiv2Schema, Serialize)]
   |                                  ^^^^^^^^^^^
   |
   = note: import resolution is stuck, try simplifying macro imports

For more information about this error, try `rustc --explain E0433`.
error: could not compile `coffee_lib` (lib) due to 6 previous errors
warning: build failed, waiting for other jobs to finish...
error: failed to compile `coffee v0.0.1-alpha.1 (/home/vincent/Github/coffee/coffee/coffee_cmd)`, intermediate artifacts can be found at `/home/vincent/Github/coffee/coffee/target`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

```

This commit fix the confitional compilation

Fixes: 57b218d
Link #157
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
vincenzopalazzo added a commit that referenced this pull request Jul 29, 2023
If you are installing coffee with make install you will receive
the following error

```
   Compiling git2 v0.16.1
   Compiling coffee_lib v0.1.0 (/home/vincent/Github/coffee/coffee/coffee_lib)
error[E0433]: failed to resolve: use of undeclared crate or module `paperclip`
 --> coffee_lib/src/types/mod.rs:5:9
  |
5 |     use paperclip::actix::Apiv2Schema;
  |         ^^^^^^^^^ use of undeclared crate or module `paperclip`

error: cannot determine resolution for the derive macro `Apiv2Schema`
 --> coffee_lib/src/types/mod.rs:8:34
  |
8 |     #[derive(Debug, Deserialize, Apiv2Schema, Serialize)]
  |                                  ^^^^^^^^^^^
  |
  = note: import resolution is stuck, try simplifying macro imports

error: cannot determine resolution for the derive macro `Apiv2Schema`
  --> coffee_lib/src/types/mod.rs:14:34
   |
14 |     #[derive(Debug, Deserialize, Apiv2Schema, Serialize)]
   |                                  ^^^^^^^^^^^
   |
   = note: import resolution is stuck, try simplifying macro imports

error: cannot determine resolution for the derive macro `Apiv2Schema`
  --> coffee_lib/src/types/mod.rs:19:34
   |
19 |     #[derive(Debug, Deserialize, Apiv2Schema, Serialize)]
   |                                  ^^^^^^^^^^^
   |
   = note: import resolution is stuck, try simplifying macro imports

error: cannot determine resolution for the derive macro `Apiv2Schema`
  --> coffee_lib/src/types/mod.rs:25:34
   |
25 |     #[derive(Debug, Deserialize, Apiv2Schema, Serialize)]
   |                                  ^^^^^^^^^^^
   |
   = note: import resolution is stuck, try simplifying macro imports

error: cannot determine resolution for the derive macro `Apiv2Schema`
  --> coffee_lib/src/types/mod.rs:30:34
   |
30 |     #[derive(Debug, Deserialize, Apiv2Schema, Serialize)]
   |                                  ^^^^^^^^^^^
   |
   = note: import resolution is stuck, try simplifying macro imports

For more information about this error, try `rustc --explain E0433`.
error: could not compile `coffee_lib` (lib) due to 6 previous errors
warning: build failed, waiting for other jobs to finish...
error: failed to compile `coffee v0.0.1-alpha.1 (/home/vincent/Github/coffee/coffee/coffee_cmd)`, intermediate artifacts can be found at `/home/vincent/Github/coffee/coffee/target`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

```

This commit fix the confitional compilation

Fixes: 57b218d
Link #157
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
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