Conversation
Remove JobManager.RenderToYAML and JobManager.renderJob which are unreachable from production binary entry points per deadcode analysis. Replace test callers with WriteJobsYAML and renderJobTo equivalents. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Removes dead/unreachable JobManager YAML-rendering helpers and updates tests to use the remaining builder-based rendering APIs.
Changes:
- Removed
JobManager.RenderToYAMLandJobManager.renderJobfrompkg/workflow/jobs.go. - Updated multiple tests to render YAML via
WriteJobsYAML/renderJobTousing astrings.Builder. - Removed the now-obsolete
TestJobManager_RenderToYAMLtest and adjustedWriteJobsYAMLtest expectations accordingly.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/jobs.go | Deletes dead RenderToYAML and renderJob methods, leaving builder-based rendering paths. |
| pkg/workflow/jobs_test.go | Removes the RenderToYAML-specific test and updates WriteJobsYAML test commentary/assertions accordingly. |
| pkg/workflow/zizmor_annotation_test.go | Switches YAML generation from RenderToYAML to WriteJobsYAML + strings.Builder. |
| pkg/workflow/threat_detection_test.go | Switches YAML generation from RenderToYAML to WriteJobsYAML + strings.Builder. |
| pkg/workflow/safe_outputs_call_workflow_test.go | Switches YAML generation from RenderToYAML to WriteJobsYAML + strings.Builder. |
| pkg/workflow/main_job_env_test.go | Switches YAML generation from RenderToYAML to WriteJobsYAML + strings.Builder. |
| pkg/workflow/if_expression_clean_test.go | Switches single-job rendering from renderJob to renderJobTo + strings.Builder. |
| pkg/workflow/compiler_jobs_test.go | Switches YAML generation from RenderToYAML to WriteJobsYAML + strings.Builder. |
| pkg/workflow/call_workflow_permissions_test.go | Switches YAML generation from RenderToYAML to WriteJobsYAML + strings.Builder. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 9/9 changed files
- Comments generated: 0
🧪 Test Quality Sentinel ReportTest Quality Score: 90/100✅ Excellent — Dead-code removal with clean test maintenance
Test Classification DetailsNo new test functions were added in this PR. All test changes fall into two categories:
Flagged Tests — Requires ReviewNo tests flagged. All modifications are syntactic API adaptations. The behavioral assertions in each test remain intact and unchanged. Language SupportTests analyzed:
Verdict
📖 Understanding Test ClassificationsDesign Tests (High Value) verify what the system does:
Implementation Tests (Low Value) verify how the system does it:
Goal: Shift toward tests that describe the system's behavioral contract — the promises it makes to its users and collaborators. References: §25282301221
|
There was a problem hiding this comment.
✅ Test Quality Sentinel: 90/100. Test quality is excellent — 0% of new tests are implementation tests (threshold: 30%). This is a dead-code removal PR with clean test maintenance: existing test API calls updated, one test appropriately removed for the deleted dead function. No coding-guideline violations detected.
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Dead Code Removal
This PR removes unreachable Go functions identified by the
deadcodestatic analyzer.Functions Removed
JobManager.RenderToYAMLpkg/workflow/jobs.goJobManager.renderJobpkg/workflow/jobs.goTests Removed
TestJobManager_RenderToYAML— exclusively tested the removedRenderToYAMLmethodRenderToYAML/renderJobcall sites in 7 other test files, replacing them withWriteJobsYAML/renderJobToequivalentsVerification
go build ./...— passesgo vet ./...— passesgo vet -tags=integration ./...— passesmake fmt— no changes neededTestJobManager*,TestIfExpression*, etc.) — passDead Function Count
CompileToYAML,ParseWorkflowString,WithSkipValidation,WithNoEmit,WithWorkflowIdentifier; WASM code path:validatePiEngineRequirements; high change count:WithVersion— 224+ test call sites)Automated by Dead Code Removal workflow — https://github.com/github/gh-aw/actions/runs/25281792468