Repository navigation
fix(hooks): show the watch configuration hint when hooks omit the watch config - #838
Merged
Merged
Conversation
mwbrooks
marked this pull request as ready for review
November 23, 2026 22:13
mwbrooks
requested review from
WilliamBergamin and
zimeg
and removed request for
a team
November 23, 2026 22:13
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #838 +/- ##
=======================================
Coverage 80.54% 80.54%
=======================================
Files 246 246
Lines 18899 18899
=======================================
+ Hits 15222 15223 +1
+ Misses 3677 3676 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
WilliamBergamin
approved these changes
Nov 23, 2026
WilliamBergamin
left a comment
Contributor
There was a problem hiding this comment.
💯 @mwbrooks thanks! Turning Watch into a pointer is the smallest fix here, since the nil checks on WatchOpts were already waiting for it.
Nothing blocking, ready to go 🚀
| hooksJSON: `{"config":{}}`, | ||
| expectedIsAvailable: false, | ||
| }, | ||
| } |
Contributor
There was a problem hiding this comment.
💯 praise: Unmarshalling real hooks JSON with and without watch tests the exact case that was broken, not just a hand-built nil.
Member
Author
|
Thanks @WilliamBergamin for the quick review! 🙇 |
3 tasks done
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.
Changelog
N/A - fixes a debug message only.
Summary
This pull request shows developers the "To watch file changes, provide watch configuration in .slack/hooks.json" debug hint again when their SDK hooks leave out the
watchconfig.hooks.SDKCLIConfig.Config.Watchwas aWatchOptsvalue, soWatch.IsAvailable()checked the address of a struct field and was always true. That meant the hint inWatchManifestandWatchAppcould never print.Config.Watcha*WatchOpts, so a missingwatchkey unmarshals tonil.IsAvailable,GetManifestWatchConfig, andGetAppWatchConfigalready handle anilreceiver.Test_WatchOpts_IsAvailablethat unmarshal hooks JSON with and withoutwatchFound while adding tests for
WatchManifestin #831 (a PR). If #839 (a PR) merges first, this PR updates its test to setWatchas a pointer.Testing
go test ./internal/hooks/... -run Test_WatchOpts_IsAvailable -vget-hooksoutput has noconfig.watch, runslack run --verboseand confirm the "provide watch configuration" debug line printsRequirements