This directory contains the Angular 21 Single Page Application for the Pinpoint service. The application is built and packaged using Bazel.
The application is built using the standard Angular CLI (ng build) executed within a Bazel build action.
//pinpoint/webui:bundle target runs ng build using the js_run_binary rule.angular.json.tsconfig.app.json configured for ES2022 module resolution.node_modules.pkg.tar) using the pkg_tar rule. This tarball is used to inject the static files into the Pinpoint Web UI Docker container.The compiled frontend files are served by the Pinpoint Go web server located at //pinpoint/go/webui.
--resources_dir flag.#), the Go server must distinguish between actual static assets and application routes. It does this by checking if the requested file exists on disk:/main.js), the server returns it. This ensures the browser successfully downloads the compiled code required to run the application./new), the server returns index.html. The Angular application then initializes in the browser and navigates to the route.To build the frontend assets and execute the integrated Go web server locally from the root of the workspace:
bazelisk run //pinpoint/go/webui
The web server directly hosts the frontend application from the active Bazel runfiles tree. Open your browser to http://localhost:8000.
To develop the user interface with real-time updates, use the Angular CLI development server (ng serve). This server reloads the application automatically when you save changes to source files.
Because the frontend fetches job data from backend APIs, you need to run the Go server to handle API requests.
In terminal 1, run the Go web server on port 8000:
bazelisk run //pinpoint/go/webui
In terminal 2, navigate to the frontend directory and run the Angular development server on port 4200:
cd pinpoint/webui npx ng serve
Open your browser to http://localhost:4200.
proxy.local.json to route requests starting with /pinpoint and /api to the Go server on port 8000..ts or .html files update the browser immediately.When developing locally, the Google auth headers (like X-Webauth-User) are not present. To simulate a logged-in user (e.g. for testing the header element or profile popup), the Angular CLI dev-server proxy is configured in proxy.local.json to inject a fake user header:
"headers": { "Grpc-Metadata-X-Webauth-User": "test-user@google.com" }
test-user@google.com."Grpc-Metadata-X-Webauth-User" in pinpoint/webui/proxy.local.json and restart the dev server."headers" block or the "Grpc-Metadata-X-Webauth-User" entry from pinpoint/webui/proxy.local.json and restart the dev server.Note: if you modify test-user@google.com, revert it before merging.
Unit tests for the Web UI components are built and executed in a headless browser via Karma + Mocha under Bazel.
To run all Web UI tests:
bazelisk test //pinpoint/webui/...
To run a specific component's tests (e.g., the Header Component):
bazelisk test //pinpoint/webui/app/header:header.component_test
The Gateway TypeScript types and service interfaces are automatically generated from pinpoint/proto/v1/gateway.proto.
To re-generate the pinpoint/webui/app/gateway/gateway.ts definitions, run the following command from the root of the buildbot repository:
BUILD_WORKSPACE_DIRECTORY=$PWD go generate ./pinpoint/proto/v1/...