Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix and improve Hanami 2.2 support #1328

Merged
merged 5 commits into from
Nov 11, 2024
Merged

Fix and improve Hanami 2.2 support #1328

merged 5 commits into from
Nov 11, 2024

Conversation

tombruijn
Copy link
Member

@tombruijn tombruijn commented Nov 5, 2024

Add Hanami 2.2 to the CI build

Add Hanami 2.2 to the build matrix so we test against it on the CI.

Set Hanami action name from middleware

Remove the need for the monkeypatch in the Hanami loader and fetch the Hanami action instance from the request env to determine the action name.

I'll remove the monkeypatch in the next commit.

This only works on Hanami 2.2 and newer.

Part of #911

Disable Hanami monkeypatch on Hanami 2.2

In the previous commit we started reading the action name from the Hanami Action instance on the request env.

Disable the monkeypatch on Hanami 2.2+ so it's not doing the same thing twice. We'll leave the monkeypatch for now, but eventually we should be able to remove it. Like on the next major Hanami version or after some years.

Part of #911

Fix request parameter reporting for Hanami 2.2

In Hanami 2.2 they removed the params class. We can't access it that way anymore.

This "router.params" env key contains both query params and POST request payload params.

This approach seems to be least intrusive and less prone to breaking in future version of Hanami.

Ignore Hanami errors by default

Configure the loader to ignore some Hanami built-in errors by default so they don't confuse our users.

@tombruijn tombruijn self-assigned this Nov 5, 2024
@tombruijn tombruijn changed the title Set Hanami action name from middleware Fix and improve Hanami 2.2 support Nov 5, 2024
@tombruijn tombruijn marked this pull request as ready for review November 5, 2024 13:59
lib/appsignal/loaders/hanami.rb Show resolved Hide resolved
@backlog-helper

This comment has been minimized.

Add Hanami 2.2 to the build matrix so we test against it on the CI.
Remove the need for the monkeypatch in the Hanami loader and fetch the
Hanami action instance from the request env to determine the action
name.

I'll remove the monkeypatch in the next commit.

This only works on Hanami 2.2 and newer.

Part of #911
In the previous commit we started reading the action name from the
Hanami Action instance on the request env.

Disable the monkeypatch on Hanami 2.2+ so it's not doing the same thing
twice. We'll leave the monkeypatch for now, but eventually we should be
able to remove it. Like on the next major Hanami version or after some
years.

Part of #911
In Hanami 2.2 they removed the params class. We can't access it that way
anymore.

This "router.params" env key contains both query params and POST request
payload params.

This approach seems to be least intrusive and less prone to breaking in
future version of Hanami.
Configure the loader to ignore some Hanami built-in errors by default so
they don't confuse our users.
@backlog-helper
Copy link


This is a message from the daily scheduled checks.

New issue guide | Backlog management | Rules | Feedback

@tombruijn tombruijn merged commit 50e5a67 into main Nov 11, 2024
127 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants