Skip to content

Commit 478c78c

Browse files
committed
fix: cancel session context on shutdown, TERO_ENV taskfile, env var renames
- Add sessionCancel context to stop uploader goroutine on org/account switch - Rework Taskfile with TERO_ENV (local|dev|prd) instead of per-env task suffixes - Rename TERO_WORKOS_API_KEY to WORKOS_API_KEY, TERO_WORKOS_CLIENT_ID to WORKOS_CLIENT_ID - Fix .gitignore: /admin only matches root binary, not cmd/admin/ - Reorder catalog table: Service before Status, disabled/inactive sort last
1 parent aec63d5 commit 478c78c

5 files changed

Lines changed: 53 additions & 4375 deletions

File tree

‎.gitignore‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ dist/
4242
docs/VISION.md
4343
.hermit/
4444
tmp/
45-
admin
45+
/admin

‎Taskfile.yml‎

Lines changed: 31 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ vars:
55
sh: nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo "4"
66
PARALLEL_COUNT:
77
sh: echo $(({{.CPU_COUNT}} * 2))
8+
TERO_ENV: '{{.TERO_ENV | default "local"}}'
9+
# Wrap commands with doppler for non-local environments.
10+
ENV_PREFIX:
11+
sh: |
12+
if [ "{{.TERO_ENV}}" = "local" ]; then
13+
echo ""
14+
else
15+
echo "doppler run -c {{.TERO_ENV}} --"
16+
fi
817
918
tasks:
1019
# ===========================================================================
@@ -25,12 +34,6 @@ tasks:
2534
cmds:
2635
- gh signoff
2736

28-
dev:
29-
desc: Generate code and build
30-
deps: [generate]
31-
cmds:
32-
- task: build
33-
3437
# ===========================================================================
3538
# Code generation
3639
# ===========================================================================
@@ -120,14 +123,14 @@ tasks:
120123
- gotestsum --format short-verbose -- -race -p {{.CPU_COUNT}} -parallel {{.PARALLEL_COUNT}} -skip "^TestIntegration_|^TestCorrectness_" ./...
121124

122125
test:integration:
123-
desc: Run integration tests (requires doppler)
126+
desc: Run integration tests (TERO_ENV=dev|prd)
124127
cmds:
125-
- doppler run -- gotestsum --format short-verbose -- -race -tags=integration -run "^TestIntegration_" ./...
128+
- '{{.ENV_PREFIX}} gotestsum --format short-verbose -- -race -tags=integration -run "^TestIntegration_" ./...'
126129

127130
test:correctness:
128-
desc: Run correctness tests (requires doppler)
131+
desc: Run correctness tests (TERO_ENV=dev|prd)
129132
cmds:
130-
- doppler run -- gotestsum --format short-verbose -- -v -tags=correctness -run "^TestCorrectness_" ./...
133+
- '{{.ENV_PREFIX}} gotestsum --format short-verbose -- -v -tags=correctness -run "^TestCorrectness_" ./...'
131134

132135
test:all:
133136
desc: Run all tests (unit + integration)
@@ -140,38 +143,44 @@ tasks:
140143
# ===========================================================================
141144

142145
run:
143-
desc: Run tero without building
146+
desc: Run tero (TERO_ENV=local|dev|prd)
144147
cmds:
145-
- go run ./cmd/tero {{.CLI_ARGS}}
148+
- "{{.ENV_PREFIX}} go run ./cmd/tero {{.CLI_ARGS}}"
149+
150+
dev:
151+
desc: Generate code and build
152+
deps: [generate]
153+
cmds:
154+
- task: build
146155

147156
auth:login:
148-
desc: Login to Tero (dev)
157+
desc: Login to Tero (TERO_ENV=local|dev|prd)
149158
cmds:
150-
- doppler run -- go run ./cmd/tero auth login
159+
- "{{.ENV_PREFIX}} go run ./cmd/tero auth login"
151160

152161
auth:token:
153-
desc: Print current access token
162+
desc: Print current access token (TERO_ENV=local|dev|prd)
154163
cmds:
155-
- doppler run -- go run ./cmd/tero auth token
164+
- "{{.ENV_PREFIX}} go run ./cmd/tero auth token"
156165

157166
auth:status:
158-
desc: Show auth status
167+
desc: Show auth status (TERO_ENV=local|dev|prd)
159168
cmds:
160-
- doppler run -- go run ./cmd/tero auth status
169+
- "{{.ENV_PREFIX}} go run ./cmd/tero auth status"
161170

162171
# ===========================================================================
163172
# Admin (internal tooling, not shipped)
164173
# ===========================================================================
165174

166175
admin:join-org:
167-
desc: Join a client organization (for support/debugging)
176+
desc: Join a client organization (TERO_ENV=dev|prd)
168177
cmds:
169-
- doppler run -- go run ./cmd/admin join-org {{.CLI_ARGS}}
178+
- "{{.ENV_PREFIX}} go run ./cmd/admin join-org {{.CLI_ARGS}}"
170179

171180
admin:leave-org:
172-
desc: Leave a client organization
181+
desc: Leave a client organization (TERO_ENV=dev|prd)
173182
cmds:
174-
- doppler run -- go run ./cmd/admin leave-org {{.CLI_ARGS}}
183+
- "{{.ENV_PREFIX}} go run ./cmd/admin leave-org {{.CLI_ARGS}}"
175184

176185
# ===========================================================================
177186
# Dependencies

0 commit comments

Comments
 (0)