-
Notifications
You must be signed in to change notification settings - Fork 20
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: build event protocol local backend #30
Conversation
otherwise it runs the prettier check on commit messages and finds no files
Signed-off-by: Thulio Ferraz Assis <3149049+f0rmiga@users.noreply.github.com>
Signed-off-by: Thulio Ferraz Assis <3149049+f0rmiga@users.noreply.github.com>
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.
looks great
|
||
// Setup sets up the gRPC server. | ||
func (bb *besBackend) Setup(opts ...grpc.ServerOption) error { | ||
lis, err := bb.netListen("tcp", "127.0.0.1:0") |
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.
what does the :0
mean?
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.
In UNIX, it means the port will be determined by the OS. It's a way of getting a random available port. In CLIs like this, we don't know the environment it will be executed, therefore, we don't want to pick a static port.
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.
Also, there's a latency in releasing the resources used by the previous run. Asking for a port from the OS makes it much faster between the CLI executions.
Description
Adds a local gRPC service for the Build Event Protocol events. It listens on a random free port provided by the OS on localhost, which gets passed to the
bazel build
command.Test plan
Check the unit tests with subscribers and assert the test logic is correct.