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: interceptors system #86

Merged
merged 1 commit into from
Dec 13, 2021
Merged

feat: interceptors system #86

merged 1 commit into from
Dec 13, 2021

Conversation

f0rmiga
Copy link
Contributor

@f0rmiga f0rmiga commented Dec 11, 2021

Adds a system similar to the one seen on gRPC that is able to intercept the command executions and inject arbitrary values into the context.

It makes the separation of concerns and the implementation of extra functionality simpler for the commands.

Currently, we use 2 interceptors:

  • The one that verifies whether a command is being run inside a Bazel workspace, injecting the workspace root into the context.
  • The one that starts and injects a BES backend for the build command.

For more details, see the Example test for the interceptors Run function.

Signed-off-by: Thulio Ferraz Assis <thulio@aspect.dev>
@f0rmiga f0rmiga requested review from alexeagle and JesseTatasciore and removed request for alexeagle December 11, 2021 21:48
Copy link
Member

@JesseTatasciore JesseTatasciore left a comment

Choose a reason for hiding this comment

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

My golang and CLI knowledge is still pretty basic but it looks okay to me

@f0rmiga f0rmiga merged commit e7b1aeb into main Dec 13, 2021
@f0rmiga f0rmiga deleted the interceptors branch December 13, 2021 18:06
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