Skip to content

Conversation

@hieuk09
Copy link
Collaborator

@hieuk09 hieuk09 commented Jul 28, 2025

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/hanami folder makes it harder to require them (because bundle will try to find them in hanami gem folder), so we need to put them in lib/idempotency

Copy link

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 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.rb file
  • Moved monkey-patch files from lib/hanami/ to lib/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

@hieuk09 hieuk09 force-pushed the chore/monkey-patch branch from 3576fba to 0186d52 Compare July 28, 2025 08:57
@hieuk09 hieuk09 merged commit 9dd02e3 into master Jul 28, 2025
1 check passed
@hieuk09 hieuk09 deleted the chore/monkey-patch branch July 28, 2025 08:58
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.

2 participants