Skip to content

Commit a1f0cc3

Browse files
authored
Merge branch 'main' into chore/allow-overriding-encoding-for-logger
2 parents 883cd89 + 1688cc9 commit a1f0cc3

File tree

58 files changed

+1007
-700
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+1007
-700
lines changed

.github/actions/deploy-setup/action.yml

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,38 +4,38 @@ inputs:
44
environment:
55
description: "Target environment for deployment, e.g. staging"
66
required: true
7-
infisical_client_id:
8-
description: "Infisical client ID for accessing secrets"
9-
required: true
10-
infisical_client_secret:
11-
description: "Infisical client secret for accessing secrets"
12-
required: true
137
install_gcloud:
148
description: "Whether to install the gcloud CLI (needed for gsutil/docker auth)"
159
required: false
1610
default: "false"
11+
infisical_machine_identity_id:
12+
description: "Infisical machine identity ID for accessing secrets"
13+
required: true
1714

1815
runs:
1916
using: "composite"
2017
steps:
21-
- uses: Infisical/secrets-action@v1.0.9
18+
- name: Pull infisical secrets into temporary file
19+
uses: Infisical/secrets-action@v1.0.15
2220
with:
23-
client-id: ${{ inputs.infisical_client_id }}
24-
client-secret: ${{ inputs.infisical_client_secret }}
25-
env-slug: ${{ inputs.environment }}
21+
method: "oidc"
22+
identity-id: ${{ inputs.infisical_machine_identity_id }}
2623
project-slug: "infra-deployment"
24+
env-slug: ${{ inputs.environment }}
2725
export-type: "file"
2826
file-output-path: "/.env.infisical"
2927

30-
- name: Load Environment Variables
28+
- name: Transform infisical secrets into make include file, load a few as environment variables
3129
id: load-env
30+
env:
31+
ENVIRONMENT: ${{ inputs.environment }}
3232
run: |
33-
echo ${{ inputs.environment }} > .last_used_env
34-
cat .env.infisical | sed "s/='\(.*\)'$/=\1/g" > .env.${{ inputs.environment }}
33+
echo "${ENVIRONMENT}" > .last_used_env
34+
cat .env.infisical | sed "s/='\(.*\)'$/=\1/g" > ".env.${ENVIRONMENT}"
3535
3636
# Load environment variables from .env
3737
set -a
38-
. .env.${{ inputs.environment }}
38+
. ".env.${ENVIRONMENT}"
3939
set +a
4040
4141
echo "GCP_REGION=${GCP_REGION}" >> $GITHUB_ENV
@@ -44,6 +44,15 @@ runs:
4444
echo "GH_WORKLOAD_IDENTITY_PROVIDER=${GH_WORKLOAD_IDENTITY_PROVIDER}" >> $GITHUB_ENV
4545
shell: bash
4646

47+
- name: Load environment variables from Infisical
48+
uses: Infisical/secrets-action@v1.0.15
49+
with:
50+
method: "oidc"
51+
identity-id: ${{ inputs.infisical_machine_identity_id }}
52+
project-slug: "infra-deployment-env"
53+
env-slug: ${{ inputs.environment }}
54+
export-type: "env"
55+
4756
- name: Setup Service Account
4857
uses: google-github-actions/auth@v2
4958
with:

.github/workflows/build-and-upload-job.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ jobs:
3131
deploy:
3232
name: Build and upload job to the ${{ inputs.environment }} environment
3333
runs-on: ci-builder
34+
environment: ${{ inputs.environment }}
3435
permissions:
3536
contents: read
3637
id-token: write
@@ -45,9 +46,8 @@ jobs:
4546
uses: ./.github/actions/deploy-setup
4647
with:
4748
environment: ${{ inputs.environment }}
48-
infisical_client_id: ${{ secrets.INFISICAL_CLIENT_ID }}
49-
infisical_client_secret: ${{ secrets.INFISICAL_CLIENT_SECRET }}
5049
install_gcloud: "true"
50+
infisical_machine_identity_id: ${{ vars.INFISICAL_MACHINE_IDENTITY_ID }}
5151

5252
- name: Set up Docker
5353
env:

.github/workflows/deploy-infra.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ jobs:
2929
deploy:
3030
name: Deploy Infra to the ${{ inputs.environment }} environment
3131
runs-on: ubuntu-22.04
32+
environment: ${{ inputs.environment }}
3233
permissions:
3334
contents: read
3435
id-token: write
@@ -43,9 +44,8 @@ jobs:
4344
uses: ./.github/actions/deploy-setup
4445
with:
4546
environment: ${{ inputs.environment }}
46-
infisical_client_id: ${{ secrets.INFISICAL_CLIENT_ID }}
47-
infisical_client_secret: ${{ secrets.INFISICAL_CLIENT_SECRET }}
4847
install_gcloud: "true"
48+
infisical_machine_identity_id: ${{ vars.INFISICAL_MACHINE_IDENTITY_ID }}
4949

5050
- name: Run Terraform state migrations
5151
if: inputs.plan_only == 'false'

.github/workflows/deploy-job.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ jobs:
3232
deploy:
3333
name: Deploy job to the ${{ inputs.environment }} environment
3434
runs-on: ubuntu-22.04
35+
environment: ${{ inputs.environment }}
3536
permissions:
3637
contents: read
3738
id-token: write
@@ -46,8 +47,7 @@ jobs:
4647
uses: ./.github/actions/deploy-setup
4748
with:
4849
environment: ${{ inputs.environment }}
49-
infisical_client_id: ${{ secrets.INFISICAL_CLIENT_ID }}
50-
infisical_client_secret: ${{ secrets.INFISICAL_CLIENT_SECRET }}
50+
infisical_machine_identity_id: ${{ vars.INFISICAL_MACHINE_IDENTITY_ID }}
5151

5252
- name: Run Terraform state migrations
5353
if: inputs.plan_only == 'false'

.github/workflows/pr-tests-arm64.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ jobs:
4444
name: ARM64 tests for ${{ matrix.package }}
4545
runs-on: ubuntu-24.04-arm
4646
timeout-minutes: 30
47+
env:
48+
GIN_MODE: test
4749
strategy:
4850
matrix:
4951
include:

.github/workflows/pr-tests.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ jobs:
99
run-tests:
1010
name: Run tests for ${{ matrix.package }}
1111
runs-on: infra-tests
12+
env:
13+
GIN_MODE: test
1214
strategy:
1315
matrix:
1416
include:

.golangci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ linters:
9595
- pattern: '^retryablehttp\.NewRequest$'
9696
pkg: ^github\.com/hashicorp/go-retryablehttp$
9797
msg: "Use github.com/hashicorp/go-retryablehttp.NewRequestWithContext instead of retryablehttp.NewRequest"
98+
- pattern: 'gin\.SetMode'
99+
pkg: '^github\.com/gin-gonic/gin$'
100+
msg: "Do not use gin.SetMode(gin.TestMode) - it causes race conditions. GIN_MODE=test is set in CI workflows."
98101
analyze-types: true
99102

100103
depguard:

iac/modules/job-api/main.tf

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
locals {
2+
default_job_env_vars = {
3+
GIN_MODE : "release"
4+
}
5+
6+
job_env_vars = merge(local.default_job_env_vars, var.job_env_vars)
7+
}
8+
19
resource "nomad_job" "api" {
210
jobspec = templatefile("${path.module}/jobs/api.hcl", {
311
update_stanza = var.update_stanza
@@ -40,6 +48,6 @@ resource "nomad_job" "api" {
4048
db_migrator_docker_image = var.db_migrator_docker_image
4149
launch_darkly_api_key = trimspace(var.launch_darkly_api_key)
4250
default_persistent_volume_type = var.default_persistent_volume_type
43-
job_env_vars = var.job_env_vars
51+
job_env_vars = local.job_env_vars
4452
})
4553
}

packages/api/go.mod

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ require (
2727
github.com/getkin/kin-openapi v0.133.0
2828
github.com/gin-contrib/cors v1.7.6
2929
github.com/gin-contrib/size v1.0.2
30-
github.com/gin-gonic/gin v1.10.1
30+
github.com/gin-gonic/gin v1.12.0
3131
github.com/go-redis/redis_rate/v10 v10.0.1
3232
github.com/gogo/status v1.1.1
3333
github.com/golang-jwt/jwt/v5 v5.3.1
@@ -45,15 +45,14 @@ require (
4545
github.com/posthog/posthog-go v0.0.0-20230801140217-d607812dee69
4646
github.com/redis/go-redis/v9 v9.17.3
4747
github.com/stretchr/testify v1.11.1
48-
go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin v0.57.0
4948
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.65.0
50-
go.opentelemetry.io/otel v1.41.0
49+
go.opentelemetry.io/otel v1.43.0
5150
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.39.0
52-
go.opentelemetry.io/otel/metric v1.41.0
53-
go.opentelemetry.io/otel/sdk/metric v1.41.0
54-
go.opentelemetry.io/otel/trace v1.41.0
51+
go.opentelemetry.io/otel/metric v1.43.0
52+
go.opentelemetry.io/otel/sdk/metric v1.43.0
53+
go.opentelemetry.io/otel/trace v1.43.0
5554
go.uber.org/zap v1.27.1
56-
golang.org/x/net v0.50.0
55+
golang.org/x/net v0.52.0
5756
golang.org/x/sync v0.20.0
5857
google.golang.org/grpc v1.79.3
5958
google.golang.org/protobuf v1.36.11
@@ -104,14 +103,15 @@ require (
104103
github.com/bep/golibsass v1.2.0 // indirect
105104
github.com/bits-and-blooms/bitset v1.22.0 // indirect
106105
github.com/bits-and-blooms/bloom/v3 v3.7.0 // indirect
107-
github.com/bytedance/sonic v1.13.3 // indirect
108-
github.com/bytedance/sonic/loader v0.2.4 // indirect
106+
github.com/bytedance/gopkg v0.1.4 // indirect
107+
github.com/bytedance/sonic v1.15.0 // indirect
108+
github.com/bytedance/sonic/loader v0.5.1 // indirect
109109
github.com/c2h5oh/datasize v0.0.0-20231215233829-aa82cc1e6500 // indirect
110110
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
111111
github.com/cenkalti/backoff/v5 v5.0.3 // indirect
112112
github.com/cespare/xxhash/v2 v2.3.0 // indirect
113113
github.com/cli/safeexec v1.0.1 // indirect
114-
github.com/cloudwego/base64x v0.1.5 // indirect
114+
github.com/cloudwego/base64x v0.1.6 // indirect
115115
github.com/containerd/errdefs v1.0.0 // indirect
116116
github.com/containerd/errdefs/pkg v0.3.0 // indirect
117117
github.com/containerd/log v0.1.0 // indirect
@@ -139,9 +139,9 @@ require (
139139
github.com/fatih/color v1.18.0 // indirect
140140
github.com/felixge/httpsnoop v1.0.4 // indirect
141141
github.com/fsnotify/fsnotify v1.9.0 // indirect
142-
github.com/gabriel-vasile/mimetype v1.4.9 // indirect
142+
github.com/gabriel-vasile/mimetype v1.4.13 // indirect
143143
github.com/gaissmai/extnetip v0.3.3 // indirect
144-
github.com/gin-contrib/sse v1.1.0 // indirect
144+
github.com/gin-contrib/sse v1.1.1 // indirect
145145
github.com/go-faster/city v1.0.1 // indirect
146146
github.com/go-faster/errors v0.7.1 // indirect
147147
github.com/go-kit/log v0.2.1 // indirect
@@ -171,10 +171,11 @@ require (
171171
github.com/go-openapi/validate v0.25.1 // indirect
172172
github.com/go-playground/locales v0.14.1 // indirect
173173
github.com/go-playground/universal-translator v0.18.1 // indirect
174-
github.com/go-playground/validator/v10 v10.26.0 // indirect
174+
github.com/go-playground/validator/v10 v10.30.2 // indirect
175175
github.com/go-viper/mapstructure/v2 v2.5.0 // indirect
176176
github.com/gobwas/glob v0.2.3 // indirect
177-
github.com/goccy/go-json v0.10.5 // indirect
177+
github.com/goccy/go-json v0.10.6 // indirect
178+
github.com/goccy/go-yaml v1.19.2 // indirect
178179
github.com/gogo/googleapis v1.4.1 // indirect
179180
github.com/gogo/protobuf v1.3.2 // indirect
180181
github.com/gohugoio/hugo v0.139.4 // indirect
@@ -226,7 +227,7 @@ require (
226227
github.com/julienschmidt/httprouter v1.3.0 // indirect
227228
github.com/kamstrup/intmap v0.5.1 // indirect
228229
github.com/klauspost/compress v1.18.2 // indirect
229-
github.com/klauspost/cpuid/v2 v2.2.11 // indirect
230+
github.com/klauspost/cpuid/v2 v2.3.0 // indirect
230231
github.com/knadh/koanf/maps v0.1.2 // indirect
231232
github.com/knadh/koanf/providers/confmap v1.0.0 // indirect
232233
github.com/knadh/koanf/v2 v2.3.2 // indirect
@@ -286,7 +287,7 @@ require (
286287
github.com/patrickmn/go-cache v2.1.0+incompatible // indirect
287288
github.com/paulmach/orb v0.11.1 // indirect
288289
github.com/pelletier/go-toml v1.9.5 // indirect
289-
github.com/pelletier/go-toml/v2 v2.2.4 // indirect
290+
github.com/pelletier/go-toml/v2 v2.3.0 // indirect
290291
github.com/perimeterx/marshmallow v1.1.5 // indirect
291292
github.com/pierrec/lz4/v4 v4.1.22 // indirect
292293
github.com/pires/go-proxyproto v0.7.0 // indirect
@@ -305,6 +306,8 @@ require (
305306
github.com/prometheus/prometheus v0.309.1 // indirect
306307
github.com/prometheus/sigv4 v0.3.0 // indirect
307308
github.com/puzpuzpuz/xsync/v3 v3.5.1 // indirect
309+
github.com/quic-go/qpack v0.6.0 // indirect
310+
github.com/quic-go/quic-go v0.59.0 // indirect
308311
github.com/redis/go-redis/extra/rediscmd/v9 v9.17.3 // indirect
309312
github.com/redis/go-redis/extra/redisotel/v9 v9.17.3 // indirect
310313
github.com/rs/zerolog v1.34.0 // indirect
@@ -330,14 +333,15 @@ require (
330333
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
331334
github.com/uber/jaeger-client-go v2.30.0+incompatible // indirect
332335
github.com/uber/jaeger-lib v2.4.1+incompatible // indirect
333-
github.com/ugorji/go/codec v1.3.0 // indirect
336+
github.com/ugorji/go/codec v1.3.1 // indirect
334337
github.com/vmware-labs/yaml-jsonpath v0.3.2 // indirect
335338
github.com/woodsbury/decimal128 v1.3.0 // indirect
336339
github.com/yusufpapurcu/wmi v1.2.4 // indirect
337340
go.etcd.io/etcd/api/v3 v3.6.6 // indirect
338341
go.etcd.io/etcd/client/pkg/v3 v3.5.10 // indirect
339342
go.etcd.io/etcd/client/v3 v3.5.10 // indirect
340343
go.mongodb.org/mongo-driver v1.17.6 // indirect
344+
go.mongodb.org/mongo-driver/v2 v2.5.0 // indirect
341345
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
342346
go.opentelemetry.io/collector/component v1.48.0 // indirect
343347
go.opentelemetry.io/collector/confmap v1.48.0 // indirect
@@ -351,6 +355,7 @@ require (
351355
go.opentelemetry.io/contrib/bridges/otelzap v0.14.0 // indirect
352356
go.opentelemetry.io/contrib/bridges/prometheus v0.61.0 // indirect
353357
go.opentelemetry.io/contrib/exporters/autoexport v0.61.0 // indirect
358+
go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin v0.68.0 // indirect
354359
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.64.0 // indirect
355360
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.64.0 // indirect
356361
go.opentelemetry.io/contrib/instrumentation/runtime v0.66.0 // indirect
@@ -366,9 +371,9 @@ require (
366371
go.opentelemetry.io/otel/exporters/prometheus v0.58.0 // indirect
367372
go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.15.0 // indirect
368373
go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.39.0 // indirect
369-
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.39.0 // indirect
374+
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.43.0 // indirect
370375
go.opentelemetry.io/otel/log v0.15.0 // indirect
371-
go.opentelemetry.io/otel/sdk v1.41.0 // indirect
376+
go.opentelemetry.io/otel/sdk v1.43.0 // indirect
372377
go.opentelemetry.io/otel/sdk/log v0.15.0 // indirect
373378
go.opentelemetry.io/proto/otlp v1.9.0 // indirect
374379
go.uber.org/atomic v1.11.0 // indirect
@@ -377,13 +382,13 @@ require (
377382
go.yaml.in/yaml/v2 v2.4.3 // indirect
378383
go.yaml.in/yaml/v3 v3.0.4 // indirect
379384
go4.org/netipx v0.0.0-20230125063823-8449b0a6169f // indirect
380-
golang.org/x/arch v0.18.0 // indirect
381-
golang.org/x/crypto v0.48.0 // indirect
385+
golang.org/x/arch v0.25.0 // indirect
386+
golang.org/x/crypto v0.49.0 // indirect
382387
golang.org/x/exp v0.0.0-20260212183809-81e46e3db34a // indirect
383388
golang.org/x/image v0.38.0 // indirect
384389
golang.org/x/mod v0.33.0 // indirect
385390
golang.org/x/oauth2 v0.34.0 // indirect
386-
golang.org/x/sys v0.41.0 // indirect
391+
golang.org/x/sys v0.42.0 // indirect
387392
golang.org/x/text v0.35.0 // indirect
388393
golang.org/x/time v0.14.0 // indirect
389394
golang.org/x/tools v0.42.0 // indirect

0 commit comments

Comments
 (0)