Skip to content

[dead-code] chore: remove dead functions — 1 function removed#37331

Merged
pelikhan merged 1 commit into
mainfrom
chore/remove-dead-functions-2026-06-06-77e152c5843b74d9
Jun 6, 2026
Merged

[dead-code] chore: remove dead functions — 1 function removed#37331
pelikhan merged 1 commit into
mainfrom
chore/remove-dead-functions-2026-06-06-77e152c5843b74d9

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

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

chore: remove dead functions

Summary

Removes the unused public function GenerateHeredocDelimiterFromSeed from pkg/workflow/strings.go together with its two no-longer-needed imports (crypto/hmac, crypto/rand), and deletes the five accompanying test functions that covered its full behaviour surface.


What changed and why

File Change type Detail
pkg/workflow/strings.go Modified Deleted GenerateHeredocDelimiterFromSeed (HMAC-SHA256 seeded heredoc-delimiter generator) and removed the crypto/hmac / crypto/rand imports that were only required by that function.
pkg/workflow/strings_test.go Modified Removed the five test functions that verified the deleted function: stability, different-names, different-seeds, empty-seed fallback, and empty-name cases.

Breaking changes

⚠️ BreakingGenerateHeredocDelimiterFromSeed was a public API. Any caller outside this module that imported and used this function will fail to compile after this change.

Callers must remove all references to GenerateHeredocDelimiterFromSeed before upgrading to this version.


Checklist

  • Dead code confirmed removed (function was unused within the module)
  • All tests covering the removed function deleted
  • Crypto imports (crypto/hmac, crypto/rand) cleaned up — no orphan imports remain
  • Confirm no external consumers reference GenerateHeredocDelimiterFromSeed (search dependents / downstream repos)

Commit

6baf8c501 chore: remove dead functions — 1 function removed

Generated by PR Description Updater for issue #37331 · 100.5 AIC · ⌖ 13.2 AIC ·

Remove GenerateHeredocDelimiterFromSeed (unreachable, test-only callers)
and its 5 exclusive test functions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@pelikhan pelikhan marked this pull request as ready for review June 6, 2026 15:11
Copilot AI review requested due to automatic review settings June 6, 2026 15:11
@pelikhan pelikhan merged commit 7267026 into main Jun 6, 2026
19 of 20 checks passed
@pelikhan pelikhan deleted the chore/remove-dead-functions-2026-06-06-77e152c5843b74d9 branch June 6, 2026 15:11
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Removes an unused heredoc-delimiter helper (GenerateHeredocDelimiterFromSeed) and its associated unit tests from the workflow string utilities, simplifying the package and reducing maintenance surface.

Changes:

  • Removed GenerateHeredocDelimiterFromSeed from pkg/workflow/strings.go and cleaned up now-unneeded imports (crypto/hmac, crypto/rand).
  • Removed the unit tests that exercised the deleted function from pkg/workflow/strings_test.go.
Show a summary per file
File Description
pkg/workflow/strings.go Deletes the unused seeded-heredoc delimiter function and trims related imports.
pkg/workflow/strings_test.go Removes tests that only covered the deleted function.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/2 changed files
  • Comments generated: 0

@github-actions
Copy link
Copy Markdown
Contributor Author

github-actions Bot commented Jun 6, 2026

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

@github-actions
Copy link
Copy Markdown
Contributor Author

github-actions Bot commented Jun 6, 2026

🧪 Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel: PR #37331 is a deletion-only PR — 'GenerateHeredocDelimiterFromSeed' was removed from strings.go (36 lines) along with its 5 test functions from strings_test.go (65 lines). All changes are pure deletions with zero new or modified test functions added. No new behavioral contracts to score; test quality is unchanged. Analysis skipped.

@github-actions
Copy link
Copy Markdown
Contributor Author

github-actions Bot commented Jun 6, 2026

⚠️ Security scanning failed for Design Decision Gate 🏗️. Review the logs for details.

No ADR enforcement needed: PR #37331 does not have the 'implementation' label (has_implementation_label=false) and has 0 new lines of code in business logic directories (≤100 threshold, requires_adr_by_default_volume=false).

@github-actions
Copy link
Copy Markdown
Contributor Author

github-actions Bot commented Jun 6, 2026

PR Code Quality Reviewer completed the code quality review.

@github-actions github-actions Bot mentioned this pull request Jun 6, 2026
Copy link
Copy Markdown
Contributor Author

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Skills-Based Review 🧠

Applied /zoom-out — one stale documentation entry found after scanning for all remaining references to the removed function.

📋 Key Themes & Highlights

Key Themes

  • Stale documentation: pkg/workflow/README.md line 321 still lists GenerateHeredocDelimiterFromSeed in the function table, even though the function no longer exists after this PR.

Positive Highlights

  • ✅ Zero remaining call sites in production code — the removal is safe
  • ✅ All five covering tests removed alongside the function
  • ✅ Unused imports (crypto/hmac, crypto/rand) cleaned up correctly
  • go build ./... and go vet ./... pass post-removal
  • ✅ The seeded approach is cleanly superseded by the content-addressed GenerateHeredocDelimiterFromContent

Requested Change

Remove line 321 from pkg/workflow/README.md:

-| `GenerateHeredocDelimiterFromSeed` | `func(name, seed string) string` | Generates a stable heredoc delimiter |

Otherwise the public API table documents a function that does not exist, which will confuse callers.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · sonnet46 387.4K · 116.2 AIC · ⌖ 12.9 AIC

Copy link
Copy Markdown
Contributor Author

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Stale API documentation will mislead consumers of this package. pkg/workflow/README.md still lists GenerateHeredocDelimiterFromSeed as an exported function (line 321), and its active replacement GenerateHeredocDelimiterFromContent is absent from the same table.

💡 Required fix

In pkg/workflow/README.md, replace line 321:

| `GenerateHeredocDelimiterFromSeed` | `func(name, seed string) string` | Generates a stable heredoc delimiter |

with:

| `GenerateHeredocDelimiterFromContent` | `func(name, content string) string` | Generates a stable heredoc delimiter derived from the wrapped content |

GenerateHeredocDelimiterFromContent is already actively used in mcp_setup_generator.go and several other callers — it just was never documented when it replaced the seed-based variant. A reader following the current README would attempt to call a function that no longer compiles.


The code deletions themselves are clean: the function has no remaining Go callers, the crypto/hmac/crypto/rand imports are correctly removed, and all five test functions are properly trimmed.

🔎 Code quality review by PR Code Quality Reviewer · sonnet46 155.4K · ⌖ 12.8 AIC

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.

2 participants