-
Notifications
You must be signed in to change notification settings - Fork 3
Dynamic control API exposed via gRPC (#32) #33
Conversation
На данный момент у нас в proto спеке во всех эндпоинтах есть поле |
@evdokimovs the referred spec is just an example. The If you do not need these fields in the current implementation at all, then just do not declare them. |
Хорошо, спасибо. |
FCM
|
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.
Необходимо актуализировать ветку. И вешаю waiting до завершения 0.1.0 milestone.
Если сделать запрос ровно в момент выключения gRPC сервера, то вернется такая ошибка:
|
8f9956c
to
7432f56
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.
Там косячек с |
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.
FCM
Implement dynamic Control API exposed via gRPC (#33, #32)
- integrate gRPC Control API server
- imp 'Create', 'Delete', 'Get' methods of Control API
- add temporary client for manual tests of gRPC Control API
- create E2E tests for gRPC Control API
- add '[server.control.grpc]' section to configure Control API gRPC server
- rename '[server]' section of Client API HTTP server as '[server.client.http]'
- add 'server.client.http.public_url' option to configure public URL of Client API HTTP server
Additionally:
- expose configuration changes in 'medea-demo' Helm chart values and bump up its version to 0.2.0
- use tinyurl.com instead of tiny.cc in docs
- remove installing 'rustfmt' on CI as it now goes in default profile for rustup
- fix missing CMake installation in Dockerfile
- describe explicit env var names in configuration file
- provide global AppContext
- add module path and file line number to logs
- refactor types and attributes usage in 'conf' module and split tests by submodules
bind_port: 8080 | ||
client: | ||
http: | ||
public_url: ws://127.0.0.1:8080/ws |
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.
Changes to Helm chart, especially breaking ones, should go with chart's version bump.
proto/control-api/src/grpc/api.proto
Outdated
@@ -36,10 +36,10 @@ message CreateRequest { | |||
} | |||
} | |||
|
|||
// Request with many Elements IDs. | |||
// Request with many Elements Full IDs (FIDs) elements. |
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.
Please, be more careful with docs formulation.
proto/control-api/src/grpc/api.proto
Outdated
message CreateRequest { | ||
// ID of the Element to be created.. | ||
string id = 1; | ||
// Full ID (FID) of the Element in which will be created provided element. |
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.
When dealing with abbreviations, it's better to do vice versa: first goes abbreviation and then full words in parentheses.
FID (full ID)
Such approach leads people towards abbreviation use.
src/api/client/session.rs
Outdated
@@ -99,7 +99,7 @@ impl Actor for WsSession { | |||
/// Starts [`Heartbeat`] mechanism and sends [`RpcConnectionEstablished`] | |||
/// signal to the [`Room`]. | |||
fn started(&mut self, ctx: &mut Self::Context) { | |||
debug!("Started WsSession for member {}", self.member_id); | |||
debug!("Started WsSession for Member [id = {}]", self.member_id); |
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 do not need interpolation/formatting in logs when you're using structured logs already. Leverage the power of abstractions you're using.
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.
Consider to refactor it in a separate PR. All lines like the one above should be refactored in the following manner:
debug!("Started WsSession for Member"; "Member.id" => self.member_id);
This will serve good both for reading in console, indexing in logs aggregation databases and reducing ops per log line.
.travis.yml
Outdated
@@ -20,8 +20,6 @@ stages: | |||
|
|||
jobs: | |||
allow_failures: | |||
- rust: nightly | |||
stage: check |
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.
Yeah, rustfmt
now goes in a default
profile for rustup, however, it still can be missing in nightly builds.
|
||
/// Some error happened in [`Member`]. | ||
#[display(fmt = "{}", _0)] | ||
MemberError(MemberError), |
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 is unnecessary. Omitting attribute will result in the same trvivial implementation.
src/signalling/participants.rs
Outdated
/// | ||
/// Returns [`AuthorizationError::InvalidCredentials`] if [`Member`] | ||
/// Returns [`Err(AuthorizationError::InvalidCredentials)`] if [`Member`] |
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 doubt that will render in docs OK.
Dynamic control API exposed via gRPC
Resolves #32
Part of 0.2.0 Roadmap #27
Synopsis
Need implement dynamic control API exposed via gRPC. In this PR will be implemented only
Create
,Get
andDelete
methods.Apply
is not part of this PR and will be implemented in the future.Solution
Create
Get
Delete
Create
Get
Delete
Checklist
WIP:
prefixk::
labels appliedWIP:
prefix is removed