Skip to content

chore: remove dead validation/map helper functions (batch 5)#18813

Merged
dsyme merged 3 commits intomainfrom
dead5
Feb 28, 2026
Merged

chore: remove dead validation/map helper functions (batch 5)#18813
dsyme merged 3 commits intomainfrom
dead5

Conversation

@dsyme
Copy link
Contributor

@dsyme dsyme commented Feb 28, 2026

Removes 11 dead functions and their exclusive tests.

validation_helpers.go (6 functions):

  • ValidateRequired, ValidateMaxLength, ValidateMinLength
  • ValidateInList, ValidatePositiveInt, ValidateNonNegativeInt

map_helpers.go (5 functions):

  • isEmptyOrNil, getMapFieldAsString, getMapFieldAsMap, getMapFieldAsBool, getMapFieldAsInt

Also removes the 11 corresponding test functions from validation_helpers_test.go.

All kept tests pass. Part of the ongoing dead code removal series.

Copilot AI review requested due to automatic review settings February 28, 2026 11:02
Copy link
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 a set of unused validation and map helper functions from pkg/workflow/ and deletes their now-obsolete tests as part of the ongoing dead code cleanup series.

Changes:

  • Removed 6 dead exported validation helpers from validation_helpers.go.
  • Removed 5 dead internal map helpers from map_helpers.go.
  • Deleted 11 tests that exclusively covered the removed helpers from validation_helpers_test.go.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
pkg/workflow/validation_helpers.go Drops unused validation helpers and prunes related imports / header list.
pkg/workflow/map_helpers.go Drops unused map-field extraction and emptiness helpers, simplifying the helper surface area.
pkg/workflow/validation_helpers_test.go Removes tests that only exercised the deleted helpers.

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

// - ValidateInList() - Validates that a value is in an allowed list
// - ValidatePositiveInt() - Validates that a value is a positive integer
// - ValidateNonNegativeInt() - Validates that a value is a non-negative integer
// - validateMountStringFormat() - Parses and validates a "source:dest:mode" mount string
Copy link

Copilot AI Feb 28, 2026

Choose a reason for hiding this comment

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

The "Available Helper Functions" list was updated to remove the deleted exported validators, but it now omits other helpers that still exist in this file (e.g., formatList() and validateTargetRepoSlug()). Please update this section (or remove it) so the header documentation reflects the current contents of validation_helpers.go.

Suggested change
// - validateMountStringFormat() - Parses and validates a "source:dest:mode" mount string
// - validateMountStringFormat() - Parses and validates a "source:dest:mode" mount string
// - formatList() - Formats a slice of strings into a human-readable comma-separated list
// - validateTargetRepoSlug() - Validates that a target-repo slug is not a wildcard

Copilot uses AI. Check for mistakes.
@dsyme dsyme merged commit a213f99 into main Feb 28, 2026
88 checks passed
@dsyme dsyme deleted the dead5 branch February 28, 2026 11:09
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.

2 participants