Repository navigation
feat: add dag enqueue action - #2163
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThis PR introduces asynchronous sub-DAG queueing via ChangesDAG Enqueue Feature
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 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 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
internal/core/spec/step_test.go (1)
60-62: ⚡ Quick winUse the executor type constant instead of the raw
"dag_enqueue"literal.Using
core.ExecutorTypeDAGEnqueuehere avoids drift if the canonical type name changes and keeps tests aligned with production constants.Suggested patch
- // dag/subworkflow/parallel/dag_enqueue: support SubDAG and WorkerSelector - for _, t := range []string{"dag", "subworkflow", "parallel", "dag_enqueue"} { + // dag/subworkflow/parallel/dag_enqueue: support SubDAG and WorkerSelector + for _, t := range []string{"dag", "subworkflow", "parallel", core.ExecutorTypeDAGEnqueue} {🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@internal/core/spec/step_test.go` around lines 60 - 62, Replace the hard-coded executor type string "dag_enqueue" with the canonical constant core.ExecutorTypeDAGEnqueue in the RegisterExecutorCapabilities loop; update the slice of executor types (used where RegisterExecutorCapabilities is called) to use core.ExecutorTypeDAGEnqueue so tests reference the production constant and avoid drift with core.RegisterExecutorCapabilities and core.ExecutorCapabilities.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@internal/service/frontend/api/v1/dagruns.go`:
- Around line 3292-3336: Mutation handlers that currently call
dagRunMgr.FindSubDAGRunStatus or dagRunStore.FindSubAttempt/FindAttempt directly
should use the same fallback resolution as reads: replace those direct calls
with the helper methods getReferencedDAGRunStatus(...) and
getReferencedDAGRunAttempt(...) (or replicate their logic) so queued child runs
without parent linkage resolve via findReferencedDAGName before failing; update
all mutation flows that perform approve/reject/push-back/update/resume to call
these helpers (or perform the same trim+findReferencedDAGName then fallback
lookup) and return the original subErr when neither lookup succeeds.
---
Nitpick comments:
In `@internal/core/spec/step_test.go`:
- Around line 60-62: Replace the hard-coded executor type string "dag_enqueue"
with the canonical constant core.ExecutorTypeDAGEnqueue in the
RegisterExecutorCapabilities loop; update the slice of executor types (used
where RegisterExecutorCapabilities is called) to use core.ExecutorTypeDAGEnqueue
so tests reference the production constant and avoid drift with
core.RegisterExecutorCapabilities and core.ExecutorCapabilities.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 3daad6e4-4d86-49e4-a466-82db6810e12c
📒 Files selected for processing (21)
internal/cmd/dry.gointernal/cmd/restart.gointernal/cmd/retry.gointernal/cmd/start.gointernal/cmn/schema/dag.schema.jsoninternal/core/exec/context.gointernal/core/parallel_test.gointernal/core/spec/step_test.gointernal/core/spec/step_types.gointernal/core/spec/step_v2.gointernal/core/spec/step_v2_test.gointernal/core/step.gointernal/core/validator.gointernal/core/validator_test.gointernal/runtime/agent/agent.gointernal/runtime/agent/agent_test.gointernal/runtime/builtin/dag/enqueue.gointernal/runtime/context.gointernal/service/frontend/api/v1/dagruns.gointernal/service/frontend/api/v1/dagruns_test.gointernal/test/helper.go
41fb6b1 to
6a67638
Compare
Summary
Add asynchronous child DAG enqueue support with
action: dag.enqueue.Changes
dag.enqueueaction normalization anddag_enqueueexecutor support.Related Issues
N/A
Checklist
Validation
go test -count=1 ./internal/core ./internal/core/spec ./internal/service/frontend/api/v1 ./internal/cmd ./internal/service/scheduler ./internal/runtime/agent ./internal/runtime/builtin/dagmake bingit diff --checkSummary by CodeRabbit
New Features
dag.enqueueaction to enqueue child DAG runs asynchronously with optional queue configuration and parameter overrides.Improvements