Require hanami monkey-patch in idempotency/hanami#15
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR reorganizes Hanami monkey-patch loading to ensure proper initialization order by consolidating requires into a single entry point. The change addresses issues where monkey-patches weren't loading correctly due to bundle trying to find them in the hanami gem folder instead of the local lib directory.
- Consolidated multiple monkey-patch requires into a single
hanami_extend.rbfile - Moved monkey-patch files from
lib/hanami/tolib/idempotency/hanami/structure - Updated spec file to use the new consolidated require path
Reviewed Changes
Copilot reviewed 2 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| spec/hanami/action/callbacks_spec.rb | Updated to require consolidated hanami extensions file |
| lib/idempotency/hanami_extend.rb | New consolidation file that requires all hanami monkey-patches |
vu-hoang-kaligo
approved these changes
Jul 28, 2025
3576fba to
0186d52
Compare
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.
Context
Sometimes the monkey-patch isn't loaded correctly and we need to load it manually to ensure order. Putting these monkey-patches in
lib/hanamifolder makes it harder to require them (because bundle will try to find them in hanami gem folder), so we need to put them inlib/idempotency