Conversation
🦋 Changeset detectedLatest commit: eff6b72 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
👋 bytesizedroll, thanks for creating this pull request! To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team. Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks! |
There was a problem hiding this comment.
Pull request overview
This PR adds global hook registration capability to the ChangesetsRegistry, enabling pre-hooks and post-hooks to be applied to every changeset in the registry. The implementation follows the existing thread-safe patterns in the codebase using sync.Mutex.
Changes:
- Added
globalPreHooksandglobalPostHooksfields toChangesetsRegistrystruct - Implemented
AddGlobalPreHooksandAddGlobalPostHooksmethods with proper mutex locking - Added changeset file documenting the minor version bump
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| engine/cld/changeset/registry.go | Added global hook storage fields and thread-safe methods for registering global pre/post hooks |
| .changeset/light-rabbits-decide.md | Documented the change as a minor version bump |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
| } | ||
|
|
||
| // AddGlobalPreHooks appends pre-hooks that run before every changeset in this registry. | ||
| func (r *ChangesetsRegistry) AddGlobalPreHooks(hooks ...PreHook) { |
There was a problem hiding this comment.
Please add tests for these
There was a problem hiding this comment.
@jkongie I have these three Jiras to completely test all teh new code:
https://smartcontract-it.atlassian.net/browse/CLD-1269
https://smartcontract-it.atlassian.net/browse/CLD-1270
https://smartcontract-it.atlassian.net/browse/CLD-1271
Am trying to keep the implementation PRs focused and the test PRs thorough rather than adding minimal tests as an afterthought on each story.


Summary
AddGlobalPreHooks(...PreHook)andAddGlobalPostHooks(...PostHook)methods toChangesetsRegistryApply()in Story 4)sync.MutexpatternTest plan
golangci-lint)