go.chromium.org/luci@v0.0.0-20240309015107-7cdc2e660f33/milo/ui/guides/add_new_host.md (about) 1 # Adding a new host to LUCI UI 2 3 LUCI UI provides a minimal number of services itself, for most services the UI directly calls another host from the users browser. 4 5 Although the URLs for these hosts could be hardcoded, for simplicity of configuration between local, dev and prod environments, these host URLs are configured. 6 7 Thus, if you want to add a new host, you should add it to the existing configuration and use it from there, rather than hardcoding it somewhere else. 8 9 ## Files in luci/milo to modify 10 11 In each of these files, simply look for an existing host (such as Luci Bisection) and copy with appropriate modifications. 12 13 All paths are relative to the luci/milo directory. 14 15 * `proto/config/settings.proto` is the definition of the config format. 16 * `ui/src/@types/globals.d.ts` defines the types used for typescript compilation. 17 * `frontend/config_js_file.go` is an RPC handler that serves the config to the browser. 18 * `ui/vite.config.ts` imports the config from environment variables into the local dev server. 19 * `ui/src/testing_tools/setup_after_env.ts` imports the config from environment variables into the test environment. 20 * `ui/.env.development` defines the default values for the environment variables in the local development environment. This file is committed and shared by all developers. 21 * `ui/.env.development.local` overrides the values defined in `ui/.env.development`. This file is gitignored. Useful for pointing requests to a custom host. 22 23 ## Service configuration 24 25 You will also need to modify the LUCI UI service configuration in a separate CL (as the configuration is in a separate repository). 26 27 The code changes to luci/milo files must be committed and rolled out to the environment (dev and/or prod) you are changing the config for **before** you submit the CL to change the config. 28 29 You need to modify one of the following two files to add the configuration. They are both instances of the `settings.proto` file from the luci/milo directory. 30 31 * Dev - `data/config/configs/luci-milo-dev/settings.cfg` 32 * Prod - `data/config/configs/luci-milo/settings.cfg` 33 34 [Example CL](https://chrome-internal-review.googlesource.com/c/infradata/config/+/6909955/2/configs/luci-milo/settings.cfg)