fix: align embedded engine run labels#2014
Conversation
📝 WalkthroughWalkthroughThis pull request renames the run-option mechanism from Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
engine.go (1)
359-371: Public API change + deprecation alias LGTM.
WithLabels+ deprecatedWithTagsforwarder preserves backwards compatibility. Two small nits:
- Line 366 comment "adds labels to one run" for
WithTagsis fine but the Deprecated marker is the important part — the current wording is correct andgo doc-friendly (blank line beforeDeprecated:).- Consider calling out the target version for removal in the deprecation notice (e.g., "Deprecated: use WithLabels; WithTags will be removed in vX.Y.") so downstream users can plan.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@engine.go` around lines 359 - 371, Update the Deprecated doc for the WithTags forwarder to include a target removal version while preserving the blank line before the "Deprecated:" marker; specifically edit the comment above the WithTags function (which currently calls WithLabels) to read something like "Deprecated: use WithLabels; WithTags will be removed in vX.Y." so downstream users can plan, keeping the rest of the comment and the WithTags -> WithLabels implementation unchanged.internal/engine/run_test.go (1)
13-23: LGTM.Test exercises both the dedup (
env=prodkept once) and append (team=platformadded) paths. Usesstretchr/testify/requireper coding guidelines.Optional: a second case asserting ordering when overrides come before existing labels, or that
core.NewLabelsnormalizes equivalent forms (e.g.,env = prodvsenv=prod) would harden the contract.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@internal/engine/run_test.go` around lines 13 - 23, Add an additional unit test variant to harden TestApplyRunOverridesMergesLabels by asserting deterministic ordering and normalization: add a test of applyRunOverrides using RunOptions where overrides come before existing labels (e.g., Labels: []string{"team=platform", "env=prod"}) and another case where input uses spaced forms (e.g., "env = prod") to verify core.NewLabels normalization; reference the existing test function TestApplyRunOverridesMergesLabels and the applyRunOverrides and core.NewLabels symbols when adding these assertions.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@engine.go`:
- Around line 359-371: Update the Deprecated doc for the WithTags forwarder to
include a target removal version while preserving the blank line before the
"Deprecated:" marker; specifically edit the comment above the WithTags function
(which currently calls WithLabels) to read something like "Deprecated: use
WithLabels; WithTags will be removed in vX.Y." so downstream users can plan,
keeping the rest of the comment and the WithTags -> WithLabels implementation
unchanged.
In `@internal/engine/run_test.go`:
- Around line 13-23: Add an additional unit test variant to harden
TestApplyRunOverridesMergesLabels by asserting deterministic ordering and
normalization: add a test of applyRunOverrides using RunOptions where overrides
come before existing labels (e.g., Labels: []string{"team=platform",
"env=prod"}) and another case where input uses spaced forms (e.g., "env = prod")
to verify core.NewLabels normalization; reference the existing test function
TestApplyRunOverridesMergesLabels and the applyRunOverrides and core.NewLabels
symbols when adding these assertions.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: ca8beb58-32a5-4a11-848a-5e6cb2d22eed
📒 Files selected for processing (4)
engine.gointernal/engine/run.gointernal/engine/run_test.gointernal/engine/types.go
Merged features from upstream: - feat: add embedded Dagu API (dagucloud#2011) - feat: add edit-and-retry DAG runs (dagucloud#2010) - feat: add bulk DAG-run deletion in web UI (dagucloud#2009) - feat: add kubernetes secret provider (dagucloud#2006) - feat: make workspace selection global (dagucloud#2015) - feat: show cockpit run artifacts (dagucloud#2017) - feat: allow disabling DAG retry policy (dagucloud#2018) - feat: make DAG labels canonical, deprecate tags (dagucloud#2013) - feat: add workflow design workspace (dagucloud#2012) - feat: add step with/config alias (dagucloud#2021) - fix: allow runtime custom step inputs (dagucloud#2005) - fix: align embedded engine run labels (dagucloud#2014) - Various CI/test/docs improvements Conflict resolution: - Kept fork i18n files (ui/src/i18n/, LanguageSwitcher) - Merged i18n hooks with upstream structural changes in App.tsx, Layout.tsx, menu.tsx, DAGStatus.tsx, etc. - Adopted upstream labels-over-tags rename (TagCombobox -> LabelCombobox)
Summary
core.DAG.LabelsWithLabelsfor embedded runs while keepingWithTagsas a deprecated aliasexecutor.WithLabelsTesting
no go files to analyze, so GitHub CI should validate lint)Summary by CodeRabbit