Task 2.1 COMPLETE ✅ JSONPath expression resolution system for workflow parameter binding: - jsonpath.go: Main resolver with methods: - NewJSONPathResolver(input, stepResults) - Create resolver - Resolve(expr) - Resolve single expression: ${input.repo}, ${Step.output.field} - ResolveString(str) - Resolve strings with multiple expressions - ResolvePaths(map) - Recursively resolve entire parameter maps - navigateObject(obj, parts) - Navigate through nested objects - resolveValue(value) - Resolve values recursively (strings, maps, slices) - ValidatePath(path) - Validate path syntax - GetAvailableSteps() - List available steps - GetInputFields() - List available input fields - Supported expressions: - ${input.repo} - Access input parameters - ${Clone.output.path} - Access step results - ${Analyze.output.metrics.quality.score} - Deep nesting - String interpolation: "Path: ${Clone.output.path}" - Works with maps, slices, and nested structures - jsonpath_test.go: 14 comprehensive tests - Single field resolution (input, steps) - Nested field access (deep nesting) - Non-template strings - Error handling (missing steps, missing fields) - String interpolation with multiple expressions - Map resolution (pure templates vs embedded expressions) - Nested maps and slices - String map support - Complex workflow scenarios - Empty input handling - All tests PASS ✅ (14/14 JSONPath tests) Total tests now: 55/55 PASS ✅ - 8 type tests - 14 knowledge base tests - 30 validator tests - 14 JSONPath tests Acceptance criteria met: ✅ Resolves ${input.*} expressions ✅ Resolves ${Step.output.*} expressions ✅ Handles deep nesting ✅ String interpolation works ✅ Recursive resolution (maps, slices) ✅ Error handling for missing paths ✅ Pure template vs embedded expressions ✅ Ready for activity selection (Task 2.2) Effort: 3 hours (estimated) Files: jsonpath.go (209 lines) jsonpath_test.go (423 lines) Phase 2 Progress: 1 of 5 tasks complete (20%)
71 lines
2.1 KiB
YAML
71 lines
2.1 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: poimen-worker
|
|
namespace: poimen
|
|
spec:
|
|
replicas: 2
|
|
selector:
|
|
matchLabels:
|
|
app: poimen-worker
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: poimen-worker
|
|
annotations:
|
|
git-commit: "38dd3f8d" # ✅ Updated on each push, triggers rolling restart
|
|
deployment-date: "2026-08-31"
|
|
spec:
|
|
containers:
|
|
- name: worker
|
|
image: golang:latest
|
|
imagePullPolicy: Always # ✅ Force pull latest image on pod startup
|
|
workingDir: /app
|
|
command: ["/bin/sh", "-c"]
|
|
args:
|
|
- |
|
|
set -e
|
|
echo "[$(date)] Starting poimen worker pod..."
|
|
apt-get update && apt-get install -y --no-install-recommends git
|
|
echo "[$(date)] Cloning latest code from git..."
|
|
git clone https://forgejo.riotpiao.com/rock/poimen-workflows.git /app
|
|
cd /app
|
|
echo "[$(date)] Latest commit: $(git rev-parse HEAD)"
|
|
echo "[$(date)] Downloading dependencies..."
|
|
go mod download
|
|
echo "[$(date)] Starting orchestrator worker..."
|
|
go run ./cmd/worker
|
|
env:
|
|
- name: TEMPORAL_NAMESPACE
|
|
valueFrom:
|
|
configMapKeyRef:
|
|
name: poimen-config
|
|
key: TEMPORAL_NAMESPACE
|
|
- name: TEMPORAL_HOSTPORT
|
|
valueFrom:
|
|
configMapKeyRef:
|
|
name: poimen-config
|
|
key: TEMPORAL_HOSTPORT
|
|
- name: ANTHROPIC_API_KEY
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: poimen-secrets
|
|
key: ANTHROPIC_API_KEY
|
|
- name: LOCAL_LLM_BASE_URL
|
|
value: "http://api-gateway.api:8080"
|
|
resources:
|
|
requests:
|
|
memory: "512Mi"
|
|
cpu: "500m"
|
|
limits:
|
|
memory: "2Gi"
|
|
cpu: "2000m"
|
|
livenessProbe:
|
|
exec:
|
|
command:
|
|
- /bin/sh
|
|
- -c
|
|
- ps aux | grep -q "go run ./cmd/worker" && echo ok || exit 1
|
|
initialDelaySeconds: 30
|
|
periodSeconds: 10
|