Skip to content

Commit a596e1c

Browse files
mhuckapavoljuhas
andauthored
Update triage party configuration (#8080)
This updates our Triage Party configuration in various ways. On the web page itself: * Update the title of the Triage Party page * Change the overall look and feel, particularly the color scheme * Remove some sections we rarely use and do other navigation cleanup * Remove the "reactions" column from the table * Remove some of the Triage Party tags used where they are redundant * Change the titles of all Triage Party tags to be more understandable * Make other changes here and there Internally, in the configuration files of `dev_tools/triage-party/`: * Refactor config files to follow current practices, for example to use Kustomize, a `config.yaml` file, and more * Put custom CSS code in a `custom.css` file * Add a favicon icon (using the Cirq logo) * Expand the README.md file to match the current scheme and add much more info to help future maintainers --------- Co-authored-by: Pavol Juhas <pavol.juhas@gmail.com>
1 parent 4738170 commit a596e1c

12 files changed

Lines changed: 775 additions & 239 deletions

File tree

dev_tools/triage-party/README.md

Lines changed: 128 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,146 @@
11
# Cirq Triage Party
22

3-
See the [triaging process](../../docs/dev/triage.md).
3+
[Triage Party](https://github.com/google/triage-party) is an issue and pull request triaging tool
4+
for GitHub. For more information about the triaging process used in the Cirq project, please refer
5+
to the [triage process documentation for Cirq](../../docs/dev/triage.md).
46

5-
## Configuration
7+
## Local testing
68

7-
For the dashboard you will have to edit the embedded YAML config in
8-
[configmap.yaml](kubernetes/02_deployment/configmap.yaml). Please refer to the
9-
[triage party
10-
docs](https://github.com/google/triage-party/blob/main/docs/config.md) for
11-
configuration details.
9+
It is possible to run an instance of Triage Party on your local host. This is useful for testing
10+
configuration changes.
1211

13-
## Secret
12+
1. Generate a personal access token on GitHub with read-only permissions for `public_repo`. (Please
13+
refer to the GitHub documentation for [personal access tokens] for information on how to do
14+
that.) The token will be a string of characters that begins with the letters `gho_`.
1415

15-
Triage party needs a Github token. This is a one-time setup (per cluster
16-
creation):
16+
2. Store this token string in the environment variable `GITHUB_TOKEN`:
1717

18-
```shell
19-
kubectl create secret generic triage-party-github-token -n triage-party --from-file=token=$HOME/.github-token
18+
```shell
19+
export GITHUB_TOKEN="yourtokenhere"
20+
```
21+
22+
3. Run Triage Party locally in a container using either Podman or Docker. The script
23+
`./run-local.sh` makes this convenient; it pulls an image for Triage Party from a container
24+
registry and runs it with the appropriate Cirq configuration files. (Note: this produces
25+
_a lot_ of output.)
26+
27+
```shell
28+
./run-local.sh
29+
```
30+
31+
After some time and many lines of logs printed, if all went well, the output should end with a line
32+
that looks more or less something like this:
33+
34+
```text
35+
I0601 21:40:01.954553 1 updater.go:250] update cycle #1 took 7.005642265s
2036
```
2137

22-
where `$HOME/.github-token` is a file containing the token.
38+
The exact numbers printed in the output are not important; what matters is that it did not end with
39+
an error message and did not return to the shell, but rather paused with `update cycle #1` as the
40+
final message. The Triage Party server will then be listening for web browser connections on port
41+
8080 on your local host. It will produce more output as it detects that files have changed.
42+
43+
[personal access tokens]: https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line
44+
45+
## Cloud configuration & Setup
46+
47+
The deployment of Cirq's Triage Party instance on a Google Cloud server is managed using Kubernetes,
48+
an open-source platform that automates the deployment, scaling, and management of containerized
49+
applications. Specifically, we use the tools Kustomize and Skaffold.
50+
51+
### 1. Application Configuration
52+
53+
To customize the Triage Party dashboard (e.g., modifying collections, rules, and members), edit the
54+
standalone YAML configuration file located at [kubernetes/02_deployment/config.yaml][config].
55+
This file is read by the program `kustomize` to generate the `triage-party-config` ConfigMap for
56+
Kubernetes.
57+
58+
Please refer to the official [Triage Party documentation] for details on the available configuration
59+
options.
60+
61+
[Triage Party documentation]: https://github.com/google/triage-party/blob/main/docs/config.md
62+
63+
### 2. Static Resources & Theming (CSS & Favicon)
64+
65+
Extra resources like custom styling and the site's favicon are also managed automatically via
66+
Kustomize:
67+
68+
- **Custom CSS**: Overrides to the default Triage Party look and feel are defined in
69+
[kubernetes/02_deployment/custom.css][custom_css] as a ConfigMap.
70+
71+
- **Favicon**: The favicon is bundled directly from the image file
72+
[kubernetes/02_deployment/cirq-icon-very-small.png][cirq_icon]. Kustomize reads this binary
73+
file and creates the `triage-party-favicon` ConfigMap automatically as defined in
74+
[kubernetes/kustomization.yaml][kustomization].
2375

24-
## Cloud Build based deployment
76+
There is no need to manually run `kubectl create configmap` commands for these resources.
2577

26-
On every push to main Triage Party is redeployed as defined by
27-
[cloudbuild-deploy.yaml](cloudbuild-deploy.yaml).
78+
[cirq_icon]: kubernetes/02_deployment/cirq-icon-very-small.png
79+
[config]: kubernetes/02_deployment/config.yaml
80+
[custom_css]: kubernetes/02_deployment/custom.css
81+
[kustomization]: kubernetes/kustomization.yaml
2882

29-
## Deploying Triage Party manually
83+
### 3. GitHub Token Secret (One-time Setup)
3084

31-
See [the cirq-infra documentation](../cirq-infra/README.md) for the required
32-
tools.
85+
Triage Party requires a GitHub personal access token so that it can query the GitHub API to get data
86+
about issues and pull requests. The token creation and assignment is a one-time setup. You must
87+
create a Kubernetes Secret containing a GitHub token. Follow these steps:
88+
89+
1. Obtain a new token from GitHub.
90+
91+
2. Set the environment variable `GITHUB_TOKEN` to the token to be used.
92+
93+
3. Run the following command in a terminal on your local host:
94+
95+
```shell
96+
# Authenticate to Google Cloud.
97+
gcloud auth login
98+
99+
# Provision your underlying Application Default Credentials (ADC).
100+
gcloud auth application-default login
101+
102+
# Authenticate your local terminal with the Kubernetes cluster running
103+
# on Google Kubernetes Engine (GKE) and save values in ~/.kube/config.
104+
gcloud container clusters get-credentials cirq-infra --zone us-central1-a
105+
106+
# Finally, create the secret inside the cluster.
107+
kubectl create secret generic triage-party-github-token \
108+
-n triage-party --from-literal=token="${GITHUB_TOKEN}"
109+
```
110+
111+
## Deployment
112+
113+
Google Cloud Build is Google Cloud Platform's (GCP) serverless CI/CD service. When code is pushed,
114+
Cloud Build automatically imports the changes, executes the build files, compiles the necessary
115+
containers, and safely applies them to the production environment without manual intervention.
116+
Please refer to the [cirq-infra documentation](../cirq-infra/README.md) to find out more about the
117+
software tools needed and how to install them.
118+
119+
### Google Cloud Build deployment
120+
121+
On every push to the `main` branch that involves files in `dev_tools/triage-party/`, the Cirq Triage
122+
Party instance is automatically redeployed using the steps defined in the file
123+
[cloudbuild-deploy.yaml](./cloudbuild-deploy.yaml). This is achieved thanks to a Cloud Build Trigger
124+
defined in the `cirq-infra` project in GCP. Thus, when changes to the Triage Party configuration are
125+
merged into the `main` branch on GitHub, the server instance will be updated automatically.
126+
127+
### Manual Deployment
128+
129+
It is possible to update the Triage Party deployment manually (e.g., for applying an immediate fix).
130+
This can be done using the command-line tool `skaffold`. Execute these commands from the top level
131+
of the Cirq repository:
33132
34133
```shell
134+
# Authenticate to Google Cloud.
135+
gcloud auth login
136+
137+
# Provision your underlying Application Default Credentials (ADC).
138+
gcloud auth application-default login
139+
140+
# Authenticate your local terminal with the remote Kubernetes cluster running
141+
# on Google Kubernetes Engine (GKE) and save values in ~/.kube/config.
35142
gcloud container clusters get-credentials cirq-infra --zone us-central1-a
143+
144+
# Bundle the config, generate ConfigMaps, and deploy.
36145
skaffold run --force -f=dev_tools/triage-party/skaffold.yaml
37146
```

dev_tools/triage-party/cloudbuild-deploy.yaml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
1+
# Copyright 2026 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# Summary: defines the steps that Google Cloud Build must execute to
16+
# deliver the containerized application manifests to the GKE cluster.
17+
118
steps:
219

3-
# get credentials from the GKE cluster
20+
# Get credentials from the GKE cluster.
421
- name: "gcr.io/k8s-skaffold/skaffold"
522
args:
623
- gcloud
@@ -10,7 +27,7 @@ steps:
1027
- cirq-infra
1128
- --zone=us-central1-a
1229

13-
# deploy container image to GKE
30+
# Deploy container image to GKE.
1431
- name: "gcr.io/k8s-skaffold/skaffold"
1532
args:
1633
- skaffold

dev_tools/triage-party/kubernetes/01_ns/namespace.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
1+
# Copyright 2026 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# Summary: defines the Kubernetes Namespace used to logically isolate the Triage
16+
# Party deployment from other applications.
17+
118
apiVersion: v1
19+
220
kind: Namespace
21+
322
metadata:
423
name: triage-party
524
labels:
4.93 KB
Loading

0 commit comments

Comments
 (0)