# leaf >The code comments in this package are intended to be the most up-to-date detailed implementation documentation. This README only provides a high-level summary of this tool's behavior and how to use it. Builds only a leaf instead of the whole Bazel plant, based on your branch. A Go binary that drives our Bazel-based CI. ## Usage For complete usage information, run `bazel run hack/build/ci/leaf -- --help`. A `just` wrapper is provided for convenience: `just ci`. ## Behavior For the provided Git commit range: 0. Retrieves all changed files using `git diff` (`ci.getDiffFiles`) 0. Queries Bazel for each file in the diff. - If the Go dependency file has changed (`tools/deps/go.bzl`), that file's diff is parsed to determine which Go modules have changed. These Go modules are then added to the queries used to determine impacted test and build targets. 0. Queries Bazel for all targets which depend on the result of the file queries performed in the previous step. OR For the provided list of files: 0. Queries Bazel for all targets which depend on the set of provided files >Note: Committing the changed files and pushing them to a Git remote is out of scope for this tool and should be handled with a CI script or otherwise. ## Future Improvements - Provide a mechanism for components to declare their own name, so that it is not tied to the image name. This will be necessary when components begin to have more than one image. There are two possible ways to implement this that I am aware of: - A `.component` file in the root of the component. When `container_push` targets are identified, the CI tool can walk directories upwards until it finds one. If one isn't found, the image isn't related to a component and can be left out of the remainder of the build steps. - Use Bazel tags to identify component names on each `container_push` target.