Skip to content

Require hanami monkey-patch in idempotency/hanami#15

Merged
hieuk09 merged 2 commits into
masterfrom
chore/monkey-patch
Jul 28, 2025
Merged

Require hanami monkey-patch in idempotency/hanami#15
hieuk09 merged 2 commits into
masterfrom
chore/monkey-patch

Conversation

@hieuk09

@hieuk09 hieuk09 commented Jul 28, 2025

Copy link
Copy Markdown
Collaborator

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

Copilot AI left a comment

Copy link
Copy Markdown

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

Comment thread lib/idempotency/hanami_extend.rb
@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.

3 participants