Skip to content

Cld 1267/global hook reg#801

Open
bytesizedroll wants to merge 2 commits intomainfrom
CLD-1267/global-hook-reg
Open

Cld 1267/global hook reg#801
bytesizedroll wants to merge 2 commits intomainfrom
CLD-1267/global-hook-reg

Conversation

@bytesizedroll
Copy link
Contributor

@bytesizedroll bytesizedroll commented Feb 27, 2026

Summary

  • Adds AddGlobalPreHooks(...PreHook) and AddGlobalPostHooks(...PostHook) methods to ChangesetsRegistry
  • Global hooks run on every changeset in the registry (wired into Apply() in Story 4)
  • Thread-safe via the existing sync.Mutex pattern
  • Multiple calls are additive; no global hooks = identical behavior to today

Test plan

  • Package compiles cleanly
  • 0 lint issues (golangci-lint)
  • All existing changeset tests pass unchanged

@bytesizedroll bytesizedroll requested a review from a team as a code owner February 27, 2026 10:26
Copilot AI review requested due to automatic review settings February 27, 2026 10:26
@changeset-bot
Copy link

changeset-bot bot commented Feb 27, 2026

🦋 Changeset detected

Latest commit: eff6b72

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
chainlink-deployments-framework Minor

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

@github-actions
Copy link

👋 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!

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

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 globalPreHooks and globalPostHooks fields to ChangesetsRegistry struct
  • Implemented AddGlobalPreHooks and AddGlobalPostHooks methods 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.

@cl-sonarqube-production
Copy link

Quality Gate failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube

}

// AddGlobalPreHooks appends pre-hooks that run before every changeset in this registry.
func (r *ChangesetsRegistry) AddGlobalPreHooks(hooks ...PreHook) {
Copy link
Collaborator

@jkongie jkongie Feb 27, 2026

Choose a reason for hiding this comment

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

Please add tests for these

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@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.

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.

3 participants