Modules: Validate execution plans at startup to remove per-request warnings#4662
Open
postindustria-code wants to merge 3 commits intoprebid:masterfrom
Open
Conversation
antoxas1986
previously approved these changes
Jan 28, 2026
antoxas1986
reviewed
Jan 28, 2026
antoxas1986
left a comment
There was a problem hiding this comment.
Code Review - Minor Suggestions
Great PR! The implementation successfully addresses the log noise issue. Here are some minor suggestions to improve code clarity:
1. Variable Shadowing in router/router.go
File: router/router.go (lines 218-221)
Current code:
if errs = hooks.ValidateExecutionPlan(cfg.Hooks, repo); len(errs) > 0 {
for _, err = range errs {
logger.Warnf("%s", err.Error())
}
}Suggested:
if validationErrs := hooks.ValidateExecutionPlan(cfg.Hooks, repo); len(validationErrs) > 0 {
for _, validationErr := range validationErrs {
logger.Warnf("%v", validationErr)
}
}Rationale:
- Avoids shadowing the outer
errvariable - Simplifies string formatting (
%vinstead of%swith.Error())
2. Add Clarifying Comment in hooks/plan.go
File: hooks/plan.go (around line 209, before the loop)
Suggested addition:
// Hook lookup and assembly. Hooks not found in repository are silently skipped
// as they are reported at startup via ValidateExecutionPlan().
for _, hookCfg := range cfg.HookSequence {
if h, ok := getHookFn(hookCfg.ModuleCode); ok {
group.Hooks = append(group.Hooks, HookWrapper[T]{
Module: hookCfg.ModuleCode,
Hook: h,
})
}
}Rationale: Makes it clear why hooks are silently skipped (they're already validated at startup), which helps future maintainers understand the design decision.
Summary
These are non-blocking suggestions that improve code clarity. The PR is ready to merge as-is if you prefer to keep the current implementation.
Overall: LGTM ✓
Contributor
Author
|
@antoxas1986 Thanks for the review! I’ve fixed the minor nits. Need a re-approve. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
Addresses Issue #3748
Behavior Changes
Before:
After:
✅ All existing tests pass - No breaking changes
✅ All new tests pass - New functionality verified
✅ Code formatting correct - Passes gofmt -s
✅ No vet issues - Passes go vet
✅ Project builds successfully - Compiles without errors
✅ Handles edge cases - Empty plans, nil repos, missing hooks