-
-
Notifications
You must be signed in to change notification settings - Fork 215
feat(spec): add continue-on shorthand #1454
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughContinueOn now accepts either a shorthand string ("skipped" or "failed") or a detailed object; step definition Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (3)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
🧰 Additional context used📓 Path-based instructions (1)**/*.go📄 CodeRabbit inference engine (AGENTS.md)
Files:
🧬 Code graph analysis (1)internal/core/spec/builder.go (2)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (1)
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (3)
schemas/dag.schema.json (1)
656-716: continueOn union matches runtime, but schema is stricter on string casingThe
oneOfunion and nestedexitCode/outputshapes line up with the new builder behavior, but the enum branch only allows lowercase"skipped"/"failed"whilebuildContinueOnaccepts case‑insensitive values (e.g."SKIPPED"is tested). If case‑insensitive input is intended, consider either:
- Expanding the enum (or using a pattern) to reflect that, or
- Tightening the builder to require the canonical lowercase values.
This avoids schema vs runtime discrepancies for validators.
internal/core/spec/builder_test.go (1)
1281-1353: Solid coverage for new continueOn formsThese tests nicely exercise the shorthand string values (including case‑insensitive handling), invalid strings, and the object form with
exitCodeandmarkSuccess, and they fit well into the existing subtest structure. If you want to tighten coverage further, you could add cases for:
exitCodeas a single string (e.g."1") and mixed invalid types, andoutputas both string and array.Not strictly necessary for this change set.
internal/core/spec/builder.go (1)
1308-1346: Add TrimSpace to continueOn string parsing and consider map[any]any handling for YAML robustnessThe
buildContinueOnimplementation is correct; two small improvements align it with patterns used elsewhere in the builder:
- Normalize whitespace in shorthand strings
Throughout builder.go, string values are normalized with
strings.TrimSpace()before processing (e.g., Group, Description, Type, Queue, Name, ID, Script, etc.). The shorthandcontinueOnparser should do the same so that" skipped "or"failed "work as expected:case string: // Shorthand syntax: "skipped" or "failed" - switch strings.ToLower(v) { + switch strings.ToLower(strings.TrimSpace(v)) { case "skipped": step.ContinueOn.Skipped = true case "failed": step.ContinueOn.Failure = true
- Handle map[any]any for YAML robustness
The
buildRegistryAuthsfunction handles bothmap[string]anyandmap[any]anyto accommodate YAML's type preservation. Although gopkg.in/yaml.v3 defaults tomap[string]interface{}for string-keyed mappings, edge cases and version variations can producemap[any]any. Adding a fallback case here (converting keys to strings before processing) would makecontinueOnmore defensive and consistent with other handlers in the builder.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
internal/core/spec/builder.go(1 hunks)internal/core/spec/builder_test.go(1 hunks)internal/core/spec/definition.go(1 hunks)internal/core/spec/errors.go(1 hunks)schemas/dag.schema.json(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.go
📄 CodeRabbit inference engine (AGENTS.md)
**/*.go: Backend entrypoint incmd/orchestrates the scheduler and CLI; runtime, persistence, and service layers sit underinternal/*(for exampleinternal/runtime,internal/persistence)
Keep Go filesgofmt/goimportsclean; use tabs, PascalCase for exported symbols (SchedulerClient), lowerCamelCase for locals, andErr...names for package-level errors
Repository linting relies ongolangci-lint; prefer idiomatic Go patterns, minimal global state, and structured logging helpers ininternal/common
Files:
internal/core/spec/builder_test.gointernal/core/spec/errors.gointernal/core/spec/builder.gointernal/core/spec/definition.go
**/*_test.go
📄 CodeRabbit inference engine (AGENTS.md)
**/*_test.go: Co-locate Go tests as*_test.go; favour table-driven cases and cover failure paths
Usestretchr/testify/requireand shared fixtures frominternal/testinstead of duplicating mocks
Files:
internal/core/spec/builder_test.go
🧠 Learnings (1)
📚 Learning: 2025-12-04T10:34:17.051Z
Learnt from: CR
Repo: dagu-org/dagu PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-04T10:34:17.051Z
Learning: Applies to **/*_test.go : Co-locate Go tests as `*_test.go`; favour table-driven cases and cover failure paths
Applied to files:
internal/core/spec/builder_test.go
🧬 Code graph analysis (3)
internal/core/spec/builder_test.go (2)
internal/core/spec/loader.go (1)
LoadYAML(150-163)internal/core/step.go (1)
ContinueOn(226-232)
internal/core/spec/builder.go (2)
internal/core/step.go (1)
ContinueOn(226-232)internal/core/spec/errors.go (4)
ErrContinueOnInvalidStringValue(19-19)ErrContinueOnExitCodeMustBeIntOrArray(16-16)ErrContinueOnOutputMustBeStringOrArray(17-17)ErrContinueOnMustBeStringOrMap(18-18)
internal/core/spec/definition.go (1)
internal/core/step.go (1)
ContinueOn(226-232)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Test on ubuntu-latest
🔇 Additional comments (2)
internal/core/spec/definition.go (1)
135-136: ContinueOn field typing and docs align with new shorthand/object supportUsing
anyhere and documenting the string vs object forms matches the updated builder logic and JSON schema; no issues from this change alone.internal/core/spec/errors.go (1)
16-19: continueOn error constants and messages look consistentThe updated messages and the two new error vars cleanly cover invalid string values and non-string/non-object types for
continueOn, and match howbuildContinueOnreports validation errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
internal/core/spec/builder.go(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.go
📄 CodeRabbit inference engine (AGENTS.md)
**/*.go: Backend entrypoint incmd/orchestrates the scheduler and CLI; runtime, persistence, and service layers sit underinternal/*(for exampleinternal/runtime,internal/persistence)
Keep Go filesgofmt/goimportsclean; use tabs, PascalCase for exported symbols (SchedulerClient), lowerCamelCase for locals, andErr...names for package-level errors
Repository linting relies ongolangci-lint; prefer idiomatic Go patterns, minimal global state, and structured logging helpers ininternal/common
Files:
internal/core/spec/builder.go
🧬 Code graph analysis (1)
internal/core/spec/builder.go (2)
internal/core/step.go (1)
ContinueOn(226-232)internal/core/spec/errors.go (4)
ErrContinueOnInvalidStringValue(19-19)ErrContinueOnExitCodeMustBeIntOrArray(16-16)ErrContinueOnOutputMustBeStringOrArray(17-17)ErrContinueOnMustBeStringOrMap(18-18)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Test on ubuntu-latest
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1454 +/- ##
==========================================
+ Coverage 59.86% 59.93% +0.06%
==========================================
Files 188 188
Lines 21167 21191 +24
==========================================
+ Hits 12671 12700 +29
+ Misses 7180 7175 -5
Partials 1316 1316
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
Summary by CodeRabbit
New Features
Bug Fixes
Tests
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.