Repository navigation
test: add workflow spec blackbox coverage - #2282
Conversation
📝 WalkthroughWalkthroughAdds eight numbered data-plane specification documents, an implementation guide, and a spec README. Implements AST-based YAML structure validation in the ChangesSpec corpus, validate implementation, and black-box tests
Service monitor test fixes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
🚥 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 |
There was a problem hiding this comment.
Actionable comments posted: 5
🤖 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 @.github/workflows/blackbox-tests.yml:
- Around line 46-47: The "Check out code" step using actions/checkout is missing
the persist-credentials configuration, which could leave the workflow token in
git config for subsequent steps. Add the persist-credentials: false option to
the checkout action to explicitly disable credential persistence and improve
security by ensuring the workflow token is not retained after the checkout step
completes.
In `@internal/cmd/validate.go`:
- Around line 80-83: In the validation block where validateWorkflowFile is
called with dag.Location, the formatValidationErrors call on the error return
statement is using args[0] instead of dag.Location. Replace args[0] with
dag.Location in the formatValidationErrors function call to ensure the error
message displays the correct file path that was actually validated rather than
the command-line argument which may differ for discovered project targets.
In `@specs/004-step-reference.md`:
- Line 30: The regex pattern `[a-z][a-z0-9_]*` for the step id validation does
not properly enforce snake_case rules because it permits consecutive underscores
and trailing underscores. Replace this regex with a pattern that enforces true
snake_case by requiring lowercase letters or digits after each underscore and
preventing multiple consecutive underscores or trailing underscores at the end
of the identifier.
In `@specs/005-field-evaluation.md`:
- Line 141: The acceptance criterion at line 141 contradicts the behavior
section by stating that $() inside params[].eval should be preserved rather than
executed. Since the spec identifies params[].eval as the command-substitution
surface, $() must be executed there, not left untouched. Update line 141 to
specify that a black-box fixture verifies $() in params[].eval is executed by
Dagu, aligning the acceptance criterion with both the behavior description and
the provided examples.
In `@tests/runner_test.go`:
- Around line 95-143: The five assertion helper methods (ExpectExitCode,
ExpectStdout, ExpectStderr, ExpectStderrContains, and ExpectStderrNotContains)
in the Result type are using manual t.Fatalf checks instead of stretchr/testify
assertions. Replace the manual comparison in ExpectExitCode with require.Equal
for the exit code, use require.Equal in ExpectStdout for stdout comparison, use
require.Equal in ExpectStderr for stderr comparison, use require.Contains in
ExpectStderrContains to check for substring presence in the loop, and use
require.NotContains in ExpectStderrNotContains to check for substring absence in
the loop. Make sure to import the stretchr/testify/require package at the top of
the file if not already present.
🪄 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: 50de00c6-5bad-438f-a404-ff517ef73eaf
📒 Files selected for processing (27)
.github/workflows/blackbox-tests.ymlinternal/cmd/validate.gointernal/service/chatbridge/monitor_external_test.gointernal/service/telegram/monitor_test.gospecs/001-project.mdspecs/002-yaml-schema.mdspecs/003-value-resolution.mdspecs/004-step-reference.mdspecs/005-field-evaluation.mdspecs/006-dynamic-evaluation.mdspecs/007-step-outputs.mdspecs/008-step-run.mdspecs/IMPLEMENTATION.mdspecs/README.mdtests/002_schema_test.gotests/runner_test.gotests/testdata/002_schema/duplicate_document_names.yamltests/testdata/002_schema/duplicate_root_keys.yamltests/testdata/002_schema/empty_document.yamltests/testdata/002_schema/empty_steps.yamltests/testdata/002_schema/entrypoint_name_forbidden.yamltests/testdata/002_schema/inline_subdag_valid.yamltests/testdata/002_schema/later_document_without_name.yamltests/testdata/002_schema/minimal_valid.yamltests/testdata/002_schema/missing_steps.yamltests/testdata/002_schema/steps_mapping_forbidden.yamltests/testdata/002_schema/unknown_root_field.yaml
There was a problem hiding this comment.
1 issue found and verified against the latest diff
Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.
Re-trigger cubic
Summary
Adds workflow specs and blackbox validation coverage for the current workflow behavior.
Changes
Related Issues
N/A
Testing
Checklist