Skip to content

refactor: extract shared helper for useHashes env-var boilerplate#27031

Closed
tylerbutler wants to merge 2 commits into
microsoft:mainfrom
tylerbutler:worktree-agent-aec28790
Closed

refactor: extract shared helper for useHashes env-var boilerplate#27031
tylerbutler wants to merge 2 commits into
microsoft:mainfrom
tylerbutler:worktree-agent-aec28790

Conversation

@tylerbutler
Copy link
Copy Markdown
Member

Summary

  • Extracts a shared isHashingEnabled(envVar) helper function to eliminate repeated multi-line JSDoc + useHashes getter boilerplate across 4 LeafWithFileStatDoneFileTask subclasses (CopyfilesTask, TypeValidationTask, GoodFence, DepCruiseTask)
  • Each class's useHashes getter is now a one-liner delegating to the helper
  • The consolidated JSDoc on the helper documents the hashing behavior once

Fixes #26802

Test plan

  • pnpm build passes in build-tools/packages/build-tools
  • pnpm test passes (137 tests) in build-tools/packages/build-tools
  • CI passes

🤖 Generated with [Nori](https://noriagentic.com)

Co-Authored-By: Nori <contact@tilework.tech>
@tylerbutler tylerbutler self-assigned this Apr 14, 2026
@tylerbutler tylerbutler marked this pull request as ready for review May 14, 2026 14:55
@tylerbutler tylerbutler requested review from a team and Copilot May 14, 2026 14:55
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 14, 2026

Hi! Thank you for opening this PR. Want me to review it?

Based on the diff (53 lines, 1 files), I've queued these reviewers:

  • Correctness — logic errors, race conditions, lifecycle issues
  • Security — vulnerabilities, secret exposure, injection
  • API Compatibility — breaking changes, release tags, type design
  • Performance — algorithmic regressions, memory leaks
  • Testing — coverage gaps, hollow tests

How this works

  • Adjust the reviewer set by ticking/unticking boxes above. Reviewer toggles alone don't trigger anything.

  • Tick Start review below to dispatch the review fleet.

  • After review finishes, tick Start review again to request another run — it auto-resets after each dispatch.

  • This comment updates as new commits land; your reviewer selections are preserved.

  • Start review

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

Refactors fluid-build leaf tasks to remove repeated useHashes env-var boilerplate by introducing a single helper that encapsulates the “enable hashing via env var == '1'” behavior.

Changes:

  • Added isHashingEnabled(envVar) helper (with consolidated JSDoc) for env-var controlled hashing.
  • Updated CopyfilesTask, TypeValidationTask, GoodFence, and DepCruiseTask to delegate useHashes to the helper.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 14, 2026

Fleet Review — Clean

No issues found across the reviewer fleet for this run.

View run

@tylerbutler tylerbutler deleted the worktree-agent-aec28790 branch May 14, 2026 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Duplicate Code: repeated useHashes/env-var boilerplate in fluid-build leaf tasks

2 participants