You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
scripts/workflow_validator.py contains pure workflow-quality rules whose edge cases should be covered apart from live workflow files. This is a safe Route-Weight testgen opener because it is deterministic, file-local, and can use synthetic fixtures.
Adds tests/scripts/test_workflow_validator.py with six unit test functions covering all major rule functions in scripts/workflow_validator.py: YAML loading edge cases, deprecated action detection, missing timeout detection, upload-artifact major-version validation, hardcoded secret detection, and unsafe string interpolation detection.
Changes
Workflow Validator Unit Tests
Layer / File(s)
Summary
Module wiring and load_workflow tests tests/scripts/test_workflow_validator.py
Imports Path and scripts.workflow_validator; tests load_workflow for valid YAML (asserts name extraction), invalid/unterminated YAML, missing file path, and non-mapping YAML (all returning None).
Validator rule function tests tests/scripts/test_workflow_validator.py
Tests check_deprecated_actions for explicit and fallback step names; check_missing_timeout across multiple jobs; check_upload_artifact_major for expected v7, patch/beta/wrong-major variants; check_hardcoded_secrets for PAT, GitHub App token, and API key patterns; check_unsafe_string_interpolation for exactly two unsafe interpolation issues with correct job/step identity.
Estimated code review effort
🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related PRs
stranske/Workflows#2426: Changes check_upload_artifact_major to default to v7, directly affecting the expected-version assertions tested in this PR.
Suggested labels
codex
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name
Status
Explanation
Resolution
Docstring Coverage
⚠️ Warning
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%.
Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name
Status
Explanation
Title check
✅ Passed
The title is concise and accurately describes the main change: adding workflow validator rule tests.
Linked Issues check
✅ Passed
The new tests match issue #2637's requested workflow-validator coverage using synthetic, file-local fixtures.
Out of Scope Changes check
✅ Passed
The PR appears scoped to the requested test file and does not introduce unrelated code changes.
Description Check
✅ Passed
Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing Touches📝 Generate docstrings
Create stacked PR
Commit on current branch
🧪 Generate unit tests (beta)
Create PR with unit tests
Commit unit tests in branch orchestrator/issue-2637
Comment @coderabbitai help to get the list of available commands.
Post-push review check: no inline review threads found; CodeRabbit skipped because the PR is draft. Local validation passed as listed in the PR body. GitHub status data currently shows Gate queued and several checks still in progress, so remote CI is not complete yet.
Updated automatically; will refresh on subsequent CI/Docker completions.
Keepalive checklist
Scope
scripts/workflow_validator.py contains pure workflow-quality rules whose edge cases should be covered apart from live workflow files. This is a safe Route-Weight testgen opener because it is deterministic, file-local, and can use synthetic fixtures.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2637
Automated Status Summary
Scope
scripts/workflow_validator.pycontains pure workflow-quality rules whose edge cases should be covered apart from live workflow files. This is a safe Route-Weighttestgenopener because it is deterministic, file-local, and can use synthetic fixtures.Tasks
load_workflow()valid YAML, invalid YAML, missing file, and non-mapping YAML.step-Nnames.Acceptance criteria
tests/scripts/test_workflow_validator.pyforscripts/workflow_validator.py.Head SHA: 70aa2eb
Latest Runs: ❔ in progress — Gate
Required: gate: ❔ in progress
Summary by CodeRabbit