Skip to content

[dead-code] chore: remove dead functions — 5 functions removed - #58996

Merged
pelikhan merged 2 commits into
mainfrom
dead-code-removal-1788705101-574297b96e490d26
Sep 6, 2026
Merged

[dead-code] chore: remove dead functions — 5 functions removed#58996
pelikhan merged 2 commits into
mainfrom
dead-code-removal-1788705101-574297b96e490d26

Conversation

@github-actions

@github-actions github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Dead Code Removal

Removed 5 unreachable functions identified by the deadcode static analyzer (./cmd/... ./internal/tools/...), plus their exclusive tests.

Functions Removed

Function File
compileWorkflowWithRefresh pkg/cli/add_workflow_compilation.go
compileWorkflowWithTracking pkg/cli/add_workflow_compilation.go
compileDispatchWorkflowDependencies pkg/cli/add_workflow_compilation.go
compileCallWorkflowDependencies pkg/cli/add_workflow_compilation.go
RunShellcheckOnLockFiles pkg/cli/compile_external_tools.go

Tests Removed

  • TestCompileWorkflowWithRefresh (pkg/cli/update_command_test.go)
  • TestCompileWorkflowWithTracking_SharedActions (pkg/cli/file_tracker_test.go)
  • TestCompileDispatchWorkflowDependencies_FallsBackToRawFrontmatter (pkg/cli/add_command_test.go)
  • TestCompileCallWorkflowDependencies_PropagatesError (pkg/cli/add_command_test.go)
  • TestCompileCallWorkflowDependencies_ForceRecompilesStale (pkg/cli/add_command_test.go)

Verification

  • go build ./...
  • go vet ./...
  • go vet -tags=integration ./...
  • make fmtfmt-json target fails pre-existing on main (unrelated to this change); Go/JS formatting portions passed.

https://github.com/github/gh-aw/actions/runs/34038688676

Generated by 🧹 Dead Code Removal Agent · copilot · auto · 66.1 AIC · ⌖ 15.3 AIC · ⊞ 9.9K ·

  • expires on Sep 9, 2026, 6:35 AM UTC-08:00

pr-sous-chef

Run: https://github.com/github/gh-aw/actions/runs/34042322138

Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 29.6 AIC · ⌖ 10 AIC · ⊞ 9.2K ·
Comment /souschef to run again

Remove 5 unreachable functions identified by the deadcode static analyzer, along with their exclusive tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@pelikhan
pelikhan marked this pull request as ready for review September 6, 2026 15:14
Copilot AI balanced review requested due to automatic review settings September 6, 2026 15:14
@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel skipped because pre-fetch PR data was unavailable: unable to fetch test file diff

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

Ponytail Reviewer completed successfully!

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • ab.chatgpt.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "ab.chatgpt.com"

See Network Configuration for more information.

Generated by Ponytail Reviewer for #58996

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

PR Code Quality Reviewer completed the code quality review.

No actionable review comments: this PR removes genuinely unreferenced helper wrappers and their orphaned tests without changing remaining call sites or behavior.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • github.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "github.com"

See Network Configuration for more information.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft.

No ADR enforcement needed: PR does not have the implementation label and has ≤100 new lines of code in business logic directories.

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice cleanup overall. Remaining cuts are mostly now-duplicate tests that existed only to exercise removed wrapper helpers; removing them keeps the suite focused on observable command behavior and shrinks maintenance surface.

net: -180 lines possible.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • ab.chatgpt.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "ab.chatgpt.com"

See Network Configuration for more information.

Generated by ✂️ Ponytail Reviewer for #58996 · codex · gpt53codex · 5.19 AIC · ⌖ 3.28 AIC · ⊞ 12.8K
Comment /ponytail to run again

Comments that could not be inline-anchored

pkg/cli/add_command_test.go:419

L419: delete: whole test for compileDispatchWorkflowDependencies wrapper. Nothing replaces it; wrapper is removed and behavior is already covered via command-level compilation tests.

pkg/cli/add_command_test.go:457

L457: delete: whole test for compileCallWorkflowDependencies wrapper. Nothing replaces it; wrapper is removed and behavior stays exercised through top-level add workflow paths.

pkg/cli/file_tracker_test.go:253

L253: delete: TestCompileWorkflowWithTracking_SharedActions integration-style setup around a removed wrapper. Nothing replaces it; tracking behavior is already validated by direct FileTracker tests.

pkg/cli/update_command_test.go:981

L981: delete: TestCompileWorkflowWithRefresh function-existence test for a removed wrapper. Nothing replaces it; update behavior is already asserted in TestUpdateWorkflow_* cases.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skills-Based Review 🧠

Applied /codebase-design — clean dead-code removal, one nit on stale doc comments.

📋 Details

Key Themes

  • Removal is well-scoped: each deleted function had no remaining callers and its exclusive tests were removed alongside it (verified via grep across the repo).
  • One doc comment (compileWorkflow, add_workflow_compilation.go:23) still references compileWorkflowWithRefresh, which this PR deletes — left as an inline comment.

Positive Highlights

  • ✅ Verification steps (go build, go vet, go vet -tags=integration) are documented in the PR body.
  • ✅ Tests removed are exclusively those exercising the deleted functions — no unrelated test coverage lost.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · sonnet50 · 22.7 AIC · ⌖ 14.6 AIC · ⊞ 10.3K
Comment /matt to run again

Comments that could not be inline-anchored

pkg/cli/add_workflow_compilation.go:23

[/codebase-design] This doc comment for compileWorkflow still references compileWorkflowWithRefresh, which was just removed in this PR — the comment now points to a non-existent function.

<details>
<summary>💡 Suggested fix</summary>

Update the comment to reference compileWorkflowWithRefreshAndActionRef (the actual delegate), e.g.:

// compileWorkflow compiles a workflow file without refreshing stop time.
// This is a convenience wrapper around compileWorkflowWithRefreshAndActi…

</details>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed with Impeccable distill lens (refactor/cleanup change). This is a clean, mechanical dead-code removal — verified no remaining call sites for any of the 5 removed functions. One minor doc-comment drift flagged inline (stale reference to a deleted function name in a doc comment that now describes a different function). Non-blocking.

🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · copilot · sonnet50 · 28.5 AIC · ⌖ 13.3 AIC · ⊞ 8.3K

Comments that could not be inline-anchored

pkg/cli/add_workflow_compilation.go:155

The doc comment above (lines 146-154) still refers to the now-deleted compileCallWorkflowDependencies wrapper by name ("compileCallWorkflowDependencies compiles any call-workflow .md worker dependencies..."), but that function was removed in this PR — the comment is now attached to compileCallWorkflowDependenciesWithActionRef. Please update the comment to reference the correct (remaining) function name so it doesn't describe a function that no longer exists.

@copilot please address this.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Preserve the exported compatibility wrapper and applicable tests, and correct stale documentation references.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Removes five reported dead-code functions and associated tests from CLI workflow compilation and ShellCheck tooling.

Changes:

  • Removes four workflow-compilation wrappers.
  • Removes an exported ShellCheck compatibility wrapper.
  • Deletes five tests and unused imports.
File summaries
File Review
pkg/cli/update_command_test.go Removes a wrapper-specific refresh test.
pkg/cli/file_tracker_test.go Removes coverage still applicable to the surviving action-ref helper; migrate the test instead.
pkg/cli/compile_external_tools.go Removes a documented exported helper, creating a downstream compatibility risk.
pkg/cli/add_workflow_compilation.go Removes wrappers but leaves two documentation comments referencing deleted symbols.
pkg/cli/add_command_test.go Removes tests for behavior still present in action-ref variants; migrate those tests instead.
Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 5
  • Review effort level: Balanced

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread pkg/cli/compile_external_tools.go
assert.Contains(t, string(recompiled), "name: \"Worker\"", "recompiled lock should contain worker name")
}

func TestValidateWorkflowDestination_SkipsExistingWorkflowFromSameSource(t *testing.T) {
return compileWorkflowWithRefreshAndActionRef(ctx, filePath, verbose, quiet, engineOverride, "", refreshStopTime, approve)
}

func compileWorkflowWithRefreshAndActionRef(ctx context.Context, filePath string, verbose bool, quiet bool, engineOverride, actionRef string, refreshStopTime bool, approve bool) error {
return compileCallWorkflowDependenciesWithActionRef(ctx, workflowFile, verbose, quiet, engineOverride, "", force, tracker)
}

func compileCallWorkflowDependenciesWithActionRef(ctx context.Context, workflowFile string, verbose, quiet bool, engineOverride, actionRef string, force bool, tracker *FileTracker) error {
// we don't expect any reaction action files to be created or tracked
}

func TestFileTracker_StageAllFiles_NonGitRepo(t *testing.T) {
@gh-aw-bot

Copy link
Copy Markdown
Collaborator
pr-sous-chef

@copilot Please take the next forward-progress pass on this PR.

  • Address the latest review feedback about stale doc-comment references and compatibility/test coverage concerns around the removed wrappers.
  • Reconcile the remaining Copilot review items, then run the pr-finisher skill.
  • Leave a concise maintainer-facing handoff describing whether the removals remain safe after those fixes.

Recent review blockers:

  • stale references to deleted wrapper names remain in doc comments.
  • Copilot requested a closer look at preserving compatibility coverage for removed wrappers and their tests.

Generated by PR Sous Chef: https://github.com/github/gh-aw/actions/runs/34042322138

Generated by 👨‍🍳 PR Sous Chef · pi · gpt54 · 29.6 AIC · ⌖ 10 AIC · ⊞ 9.2K ·
Comment /souschef to run again

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>

Copilot AI commented Sep 6, 2026

Copy link
Copy Markdown
Contributor
pr-sous-chef
```...

Addressed in commit 62e9ba1: restored the exported RunShellcheckOnLockFiles compatibility wrapper, retained the removed regression tests while migrating them to the surviving WithActionRef helpers, and corrected stale doc-comment references. Targeted tests plus final make lint, make test-unit, make test, and make recompile completed successfully. The removals remain safe for internal wrappers; the exported shellcheck API is preserved.

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

🎉 This pull request is included in a new release.

Release: v0.88.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants