Skip to content

Conversation

@tombruijn
Copy link
Member

@tombruijn tombruijn commented Oct 23, 2024

Merge array option values from loaders

Loaders can set config defaults. If more than one loader set a config option that contains an array, they would overwrite each other. I think it's a good default to merge array values from loaders. This will prevent options like ignore_actions from being overwritten by another loader, and reported actions that should be ignored.

Automatically ignore Rails' health-check

Adds the Rails::HealthController#show endpoint to the default ignore_actions config by adding it to the Railtie loader defaults.

Suggested by a customer in: https://app.intercom.com/a/inbox/yzor8gyw/inbox/shared/unassigned/conversation/16410700366724#part_id=comment-16410700366724-21909575460

Fix duplicate Railtie default config in specs

In the diagnose CLI spec the Railtie config defaults would be set twice, failing the specs.

This was because the spec only checked beforehand if the MyApp constant was present or not, which it is most of the time in this spec. Now also check if the app is already initialized, so the Railtie isn't triggered again, and then trigger it manually.

@tombruijn tombruijn added the enhancement An improvement to an existing feature. label Oct 23, 2024
@tombruijn tombruijn self-assigned this Oct 23, 2024
Loaders can set config defaults. If more than one loader set a config
option that contains an array, they would overwrite each other.
I think it's a good default to merge array values from loaders.
This will prevent options like `ignore_actions` from being overwritten
by another loader, and reported actions that should be ignored.
@tombruijn tombruijn force-pushed the ignore-rails-healthcheck branch from 2a1dc55 to dfdfd53 Compare October 23, 2024 07:43
tombruijn and others added 2 commits October 23, 2024 10:03
Adds the `Rails::HealthController#show` endpoint to the default
`ignore_actions` config by adding it to the Railtie loader defaults.

Suggested by a customer in:
https://app.intercom.com/a/inbox/yzor8gyw/inbox/shared/unassigned/conversation/16410700366724#part_id=comment-16410700366724-21909575460

Co-authored-by: Noemi <[email protected]>
In the diagnose CLI spec the Railtie config defaults would be set twice,
failing the specs.

This was because the spec only checked beforehand if the MyApp constant
was present or not, which it is most of the time in this spec. Now also
check if the app is already initialized, so the Railtie isn't triggered
again, and then trigger it manually.
@tombruijn tombruijn force-pushed the ignore-rails-healthcheck branch from dfdfd53 to 4aaac06 Compare October 23, 2024 08:05
@tombruijn tombruijn marked this pull request as ready for review October 23, 2024 08:14
@backlog-helper
Copy link


This is a message from the daily scheduled checks.

New issue guide | Backlog management | Rules | Feedback

Copy link
Contributor

@unflxw unflxw left a comment

Choose a reason for hiding this comment

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

This approach makes a lot of sense to me 🎉 Thank you for taking on this task!

@tombruijn tombruijn merged commit eeb5fab into main Oct 28, 2024
@tombruijn tombruijn deleted the ignore-rails-healthcheck branch October 28, 2024 11:10
@stefanvermaas
Copy link
Contributor

This is great! When will this be released 🤞 ?

@tombruijn
Copy link
Member Author

Soon! I want to get some other PRs merged as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement An improvement to an existing feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants