Tango OSS (Target Analyzer in Go) provides APIs for fetching and comparing target graphs and services. It is a standalone library that can be used and executed independently of the monorepo.
- Bazel 8.4.1 (automatically managed via
tools/bazel) - protoc (for proto generation only)
- direnv (optional, for loading
.envrc)
The project includes a Makefile for common tasks:
# Build all targets
make build
# Run all tests
make test
# Build and test
make build && make test
# Show all available commands
make help# Run the Tango server (port 8081)
make run-server
# In another terminal, run client with custom parameters
make run-client-get-graph REMOTE=https://github.com/uber/tango.git METHOD=get-target-graph BASE_SHA=HEAD
make run-client-changed-targets REMOTE=https://github.com/uber/tango.git BASE_SHA=872881fd~1 NEW_BASE_SHA=872881fdFor a complete list of available commands, run make help.
The project is self-contained and uses tools/bazel wrapper to automatically download and manage Bazel.
Optional: Set up direnv
# Install direnv (macOS)
brew install direnv
# Add to your shell (bash/zsh)
echo 'eval "$(direnv hook bash)"' >> ~/.bashrc # or ~/.zshrc
# Allow .envrc in the project
direnv allowOnce set up, you can build the project:
make build
# or directly with the bazel wrapper
./tools/bazel build //...You can either
- use any IDE that support native golang toolchain
- or use gopackagesdriver for bazel based IDE
- Add all direct GO dependencies explicitly to the MODULE.bazel.
- Update BUILD files by running
make gazelle(orbazel run //:gazelle) - If an external dependency is added, run
bazel mod tidyto add the dependency to the repo
Install protoc locally: https://github.com/protocolbuffers/protobuf?tab=readme-ov-file#protobuf-compiler-installation
Install required protoc plugins:
go install github.com/gogo/protobuf/protoc-gen-gogoslick@latest
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
go install go.uber.org/yarpc/encoding/protobuf/protoc-gen-yarpc-go@latestGenerate protobuf files (generates gogoslick, grpc, and yarpc):
make proto
# To regenerate from scratch
make clean-proto && make protoThis generates:
tangopb/tango.pb.go- Protocol buffer messages (gogoslick)tangopb/tango_grpc.pb.go- gRPC service definitionstangopb/tango.pb.yarpc.go- YARPC service definitions
Note: Generated proto files are checked into version control. The clean-proto command is normally not needed unless you want to regenerate from scratch.
To install mockgen, run go install go.uber.org/mock/mockgen@latest.
To regenerate mocks for a package run
mockgen -destination=<source file> <package path> <Interface><Interface>
# Run in the current package
mockgen -destination=<source file> . <Interface><Interface>
# Example
mockgen -package=tangopbmock -self_package=tangopbmock -destination=tangopbmock/tangopbmock.go . TangoServiceGetChangedServicesYARPCServer,TangoServiceGetChangedTargetGraphYARPCServer,TangoServiceGetChangedTargetsYARPCServer,TangoServiceGetTargetGraphYARPCServer
Run
git tag <version>
git commit -m "release a new version"
git push origin <version>Run make help to see all available commands:
Build & Test:
make build- Build all targetsmake test- Run all testsmake gazelle- Update BUILD.bazel filesmake clean- Clean generated files and binaries
Protobuf:
make proto- Generate protobuf files (gogoslick, grpc, yarpc)make clean-proto- Clean generated proto files
Run Server & Client:
make run-server- Run the Tango server (port 8081)make run-client-get-graph- Run get-target-graph via the Tango clientmake run-client-changed-targets- Run get-changed-targets from Client
Other:
make version- Show Bazel versionmake help- Show this help message
Client Parameters: You can customize the client behavior with various parameters
Example:
bazel run //example/client:client -- -h
bazel run //example/client:client -- -addr 127.0.0.1:8081 -method get-changed-targets -remote https://github.com/uber/tango.git -base-sha 47f5e72 -new-base-sha 47f5e72~This project uses GitHub Actions for continuous integration. The workflow automatically:
- Resolve dependencies
- Builds all targets
- Runs all tests
- Reports test failures with detailed logs
The workflow runs on:
- All pushes to the
mainbranch - All pull requests (opened, reopened, or synchronized)
This project is licensed under the Apache 2.0 License.