Contributing

Source code

Most of the code lives in //infra/infra/fxicfg. The directories are:

  • builtins/: starlark callables that are globally available (no loadstatement needed)
  • errs/: internal error handling utilities.
  • loaders/: packages the interpreter uses to load starlark modules.
  • starlark/: built-in or generated starlark code. Starlark sources in this directory are compiled into this binary.
  • state/: interpreter state, which tracks output generated by client programs.

Steps to add or update recipe protobuf APIs.

Whenever a new protobuf API is created for a recipe, or an existing API is updated, the new .proto file should be added to this tool by following the steps below. These should be done in the //infra/infra/fxcicfg directory:

  1. Put the .proto file in starlark/protos/recipes
  2. Update starlark/protos/gen.go with a line to generate Go for the .proto file
  3. Run go generate ./...
  4. Update loaders/protos.go with a line to allow importing the generated protobuf lib.

Make sure the proto definition has the following header, replacing ‘fuchsia’ with the appropriate string:

syntax = "proto3";

// "from PB.recipe_modules.infra.fuchsia import Fuchsia" (from recipes)
package recipe_modules.infra.fuchsia;

option go_package = "recipes";