Repository navigation
79 lines (76 loc) · 3.04 KB
/
Copy pathtelemetry-error-issues.yml
File metadata and controls
79 lines (76 loc) · 3.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Telemetry error issues
# Each day at 00:45 US Eastern, report the previous Eastern calendar day's
# error groups from the central telemetry log bucket as GitHub issues. 00:45
# is never skipped or repeated when the clocks change, and it avoids the
# delays GitHub has for schedules at the start of an hour.
on:
schedule:
- cron: "45 0 * * *"
timezone: "America/New_York"
workflow_dispatch:
inputs:
dry_run:
description: "Query and group errors without changing any issue"
type: boolean
default: true
report_date:
description: "Eastern calendar day to report, as YYYY-MM-DD (default: the previous day)"
type: string
default: ""
concurrency:
group: telemetry-error-issues
cancel-in-progress: false
jobs:
sync:
name: Sync telemetry error issues
if: github.repository == 'PolicyEngine/policyengine-api'
runs-on: ubuntu-latest
# Deployments to this environment are limited to master, which keeps other
# branches from authenticating as its service account.
environment: telemetry-error-issues
timeout-minutes: 15
permissions:
contents: read
issues: write
id-token: write
env:
# uv installs uv.lock on the Cloud Run image's Python, not the 3.14
# that .python-version selects.
UV_PYTHON: "3.12"
steps:
- name: Require master branch
if: github.ref != 'refs/heads/master'
run: exit 1
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
# The same uv version as the Cloud Run image and the release job.
- name: Set up uv
uses: astral-sh/setup-uv@v6
with:
version: "0.13.4"
- name: Authenticate to Google Cloud
id: auth
uses: google-github-actions/auth@v2
with:
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ vars.TELEMETRY_ERROR_ISSUES_SERVICE_ACCOUNT }}
token_format: access_token
create_credentials_file: false
- name: Sync telemetry error issues
env:
GOOGLE_OAUTH_ACCESS_TOKEN: ${{ steps.auth.outputs.access_token }}
GITHUB_TOKEN: ${{ github.token }}
TELEMETRY_ERROR_FINGERPRINT_KEY: ${{ secrets.TELEMETRY_ERROR_FINGERPRINT_KEY }}
OBSERVABILITY_PROJECT_ID: ${{ vars.OBSERVABILITY_PROJECT_ID }}
OBSERVABILITY_LOG_BUCKET: ${{ vars.OBSERVABILITY_LOG_BUCKET }}
OBSERVABILITY_LOG_BUCKET_LOCATION: ${{ vars.OBSERVABILITY_LOG_BUCKET_LOCATION }}
OBSERVABILITY_LOG_DATASET: ${{ vars.OBSERVABILITY_LOG_DATASET }}
OBSERVABILITY_LOG_VIEW: ${{ vars.OBSERVABILITY_LOG_VIEW }}
OBSERVABILITY_SERVICE_NAMESPACE: ${{ vars.OBSERVABILITY_SERVICE_NAMESPACE }}
DRY_RUN: ${{ github.event_name == 'workflow_dispatch' && inputs.dry_run }}
REPORT_DATE: ${{ inputs.report_date }}
run: bash .github/scripts/sync_telemetry_error_issues.sh