feat: template success/failure conditions in verification specs from dispatch context#884
Conversation
…dispatch context
Applies Go template rendering to SuccessCondition and FailureCondition
fields in VerificationMetricSpec before verifications are created,
using the job's DispatchContext as template data. This allows conditions
like `result.json.name == "{{ .resource.name }}"` to reference release
target attributes at dispatch time.
Closes #876
Co-authored-by: Aditya Choudhari <adityachoudhari26@users.noreply.github.com>
|
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughAdded templating of verification metric spec conditions: reconciliation now templates each spec's Changes
Sequence Diagram(s)sequenceDiagram
participant Reconciler as Reconciler
participant Template as verification.TemplateSpecs
participant Dispatcher as Job Dispatcher / Setter
Reconciler->>Reconciler: merge & dedupe specs
Reconciler->>Template: TemplateSpecs(specs, dispatchCtx)
alt templating succeeds
Template-->>Reconciler: rendered specs
Reconciler->>Dispatcher: CreateVerifications(rendered specs)
else templating fails
Template-->>Reconciler: error
Reconciler-->>Reconciler: return early with error
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
resolves #876
Summary by CodeRabbit
New Features
Tests