Skip to content

Commit 038184b

Browse files
committed
Update envs urls and auth examples in skill
1 parent dfeb2a6 commit 038184b

2 files changed

Lines changed: 23 additions & 49 deletions

File tree

plugins/debug-tc-logs/skills/debug-tc-logs/SKILL.md

Lines changed: 22 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ The `taskcluster` CLI is a first-class debugging tool for inspecting task state,
5656
TASKCLUSTER_ROOT_URL=https://community-tc.services.mozilla.com taskcluster ...
5757

5858
# staging
59-
TASKCLUSTER_ROOT_URL=https://stage.taskcluster.net taskcluster ...
59+
TASKCLUSTER_ROOT_URL=https://stage.taskcluster.nonprod.cloudops.mozgcp.net taskcluster ...
6060
```
6161

6262
### Key Commands
@@ -121,14 +121,14 @@ By default only public API calls work (task status, definitions, public artifact
121121

122122
## 3. Environment Mapping
123123

124-
| Environment | GCP Project | Cluster Name | Key File |
125-
|---|---|---|---|
126-
| community-tc | `moz-fx-taskcluster-prod-4b87` | `taskcluster-communitytc-v1` | `tc-prod.json` |
127-
| fx-ci | `moz-fx-taskcluster-prod-4b87` | `taskcluster-firefoxcitc-v1` | `tc-prod.json` |
128-
| staging | `moz-fx-taskclust-nonprod-9302` | `taskcluster-nonprod-v1` | `tc-nonprod.json` |
129-
| dev | `taskcluster-dev` | `taskcluster-dev` | `tc-dev.json` |
124+
| Environment | GCP Project | Cluster | Namespace | Key File |
125+
|---|---|---|---|---|
126+
| community-tc | `moz-fx-webservices-high-prod` | `webservices-high-prod` | `taskcluster-communitytc` | `tc-prod.json` |
127+
| fx-ci | `moz-fx-webservices-high-prod` | `webservices-high-prod` | `taskcluster-prod` | `tc-prod.json` |
128+
| staging | `moz-fx-webservices-high-nonpro` | `webservices-high-nonprod` | `taskcluster-stage` | `tc-staging.json` |
129+
| dev | `taskcluster-dev` | `taskcluster-dev` | | — (ADC) |
130130

131-
Note: community-tc and fx-ci share the same GCP project and key file but have different cluster names. The `tc-logview` config handles this automatically — use `-e fx-ci` or `-e community-tc`.
131+
Note: community-tc and fx-ci share the same GCP project **and** cluster (`webservices-high-prod`); they differ only by `namespace`. The `tc-logview` config handles this — use `-e fx-ci` or `-e community-tc`. Each also has a `-scoped` variant (`fx-ci-scoped`, `community-tc-scoped`, `staging-scoped`) that reads a per-namespace tenant log view via the `tc-logview-reader` service account; use those with token-based auth (see §11).
132132

133133
## 4. Environment Resolution
134134

@@ -139,8 +139,8 @@ Determine the environment from context using this priority:
139139
3. **TC root URL in message**:
140140
- `community-tc.services.mozilla.com` → community-tc
141141
- `firefox-ci-tc.services.mozilla.com` → fx-ci
142-
- `stage.taskcluster.net` → staging
143-
- `taskcluster-dev.net` → dev
142+
- `stage.taskcluster.nonprod.cloudops.mozgcp.net` → staging
143+
- `tc.dev.taskcluster.mozgcp.net` → dev
144144
4. **workerPoolId prefix**: pool IDs like `proj-*` are typically community-tc; `gecko-*`/`mobile-*` are fx-ci
145145
5. **If ambiguous**: Ask the user which environment
146146

@@ -332,56 +332,30 @@ Map the user's problem to the right playbook, then read and follow it. Each play
332332

333333
## 11. Auth Setup
334334

335-
When key files are missing, guide the user through setup. Keys go in `~/.config/tc-logview/keys/` (update `key_path` in `~/.config/tc-logview/config.yaml` to match).
335+
`tc-logview` accepts credentials three ways, in priority order: `TC_LOGVIEW_ACCESS_TOKEN` (a pre-issued bearer token) > `key_path` (service account JSON key) > ADC. Run `tc-logview auth` to print the exact command for an environment.
336336

337-
### For `moz-fx-taskcluster-prod-4b87` (community-tc, fx-ci):
338-
```bash
339-
mkdir -p ~/.config/tc-logview/keys
337+
### Preferred: impersonated short-lived token (recommended for agents/containers)
340338

341-
# Create service account (one-time)
342-
gcloud iam service-accounts create tc-log-reader \
343-
--project=moz-fx-taskcluster-prod-4b87 \
344-
--display-name="TC Log Reader"
339+
A low-privilege reader service account already exists — `tc-logview-reader@moz-fx-taskcluster-prod.iam.gserviceaccount.com` — granted `roles/logging.viewAccessor` on the per-namespace tenant log views. Members of `workgroup:taskcluster/admins` may impersonate it. Mint a ~1h token on the host and pass only that token in; `tc-logview` never mints or refreshes tokens itself:
345340

346-
# Grant logging read access
347-
gcloud projects add-iam-policy-binding moz-fx-taskcluster-prod-4b87 \
348-
--member="serviceAccount:tc-log-reader@moz-fx-taskcluster-prod-4b87.iam.gserviceaccount.com" \
349-
--role="roles/logging.viewer"
341+
```bash
342+
TOKEN=$(gcloud auth print-access-token \
343+
--impersonate-service-account=tc-logview-reader@moz-fx-taskcluster-prod.iam.gserviceaccount.com)
350344

351-
# Create key file
352-
gcloud iam service-accounts keys create ~/.config/tc-logview/keys/tc-prod.json \
353-
--iam-account=tc-log-reader@moz-fx-taskcluster-prod-4b87.iam.gserviceaccount.com
345+
TC_LOGVIEW_ACCESS_TOKEN=$TOKEN tc-logview query -e fx-ci-scoped --type monitor.error --since 1h
354346
```
355347

356-
### For `moz-fx-taskclust-nonprod-9302` (staging):
357-
```bash
358-
gcloud iam service-accounts create tc-log-reader \
359-
--project=moz-fx-taskclust-nonprod-9302 \
360-
--display-name="TC Log Reader"
348+
Use the `-scoped` environments (`fx-ci-scoped`, `community-tc-scoped`, `staging-scoped`) with this token — the reader SA can read only those tenant log views. `TC_LOGVIEW_ACCESS_TOKEN` overrides whatever `config.yaml` says.
361349

362-
gcloud projects add-iam-policy-binding moz-fx-taskclust-nonprod-9302 \
363-
--member="serviceAccount:tc-log-reader@moz-fx-taskclust-nonprod-9302.iam.gserviceaccount.com" \
364-
--role="roles/logging.viewer"
350+
### Alternative: ADC
365351

366-
gcloud iam service-accounts keys create ~/.config/tc-logview/keys/tc-nonprod.json \
367-
--iam-account=tc-log-reader@moz-fx-taskclust-nonprod-9302.iam.gserviceaccount.com
368-
```
352+
For `dev` (and any environment with `key_path` omitted), authenticate with Application Default Credentials:
369353

370-
### For `taskcluster-dev` (dev):
371354
```bash
372-
gcloud iam service-accounts create tc-log-reader \
373-
--project=taskcluster-dev \
374-
--display-name="TC Log Reader"
375-
376-
gcloud projects add-iam-policy-binding taskcluster-dev \
377-
--member="serviceAccount:tc-log-reader@taskcluster-dev.iam.gserviceaccount.com" \
378-
--role="roles/logging.viewer"
379-
380-
gcloud iam service-accounts keys create ~/.config/tc-logview/keys/tc-dev.json \
381-
--iam-account=tc-log-reader@taskcluster-dev.iam.gserviceaccount.com
355+
gcloud auth application-default login
382356
```
383357

384-
After placing the key, update `~/.config/tc-logview/config.yaml` with the correct `key_path` for that environment, then run `tc-logview sync`.
358+
After changing credentials, run `tc-logview sync`.
385359

386360
## 12. Anti-Patterns
387361

plugins/debug-tc-logs/skills/debug-tc-logs/examples/task-failure-debugging.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Investigation playbook when given a task ID or task URL.
77
Parse `tasks/<taskId>` from TC URLs:
88
- `https://firefox-ci-tc.services.mozilla.com/tasks/IKBB-zASS_uNES7KC8MJpg` → taskId=`IKBB-zASS_uNES7KC8MJpg`, env=fx-ci
99
- `https://community-tc.services.mozilla.com/tasks/...` → env=community-tc
10-
- `https://stage.taskcluster.net/tasks/...` → env=staging
10+
- `https://stage.taskcluster.nonprod.cloudops.mozgcp.net/tasks/...` → env=staging
1111

1212
## 2. Get task status and definition
1313

0 commit comments

Comments
 (0)