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

Check if :appsec setting is present before accessing it in remote component #2854

Merged

Conversation

GustavoCaso
Copy link
Member

@GustavoCaso GustavoCaso commented May 16, 2023

What does this PR do?

Fixes a regression previously fixed #2677.

Since the introduction of remote components, the CI configuration for some projects has been broken.

The issue comes from the remote component checking appsec settings. In the context of CI, most users do not load appsec, which is causing issues. This PR fixes it

Motivation

Additional Notes

How to test the change?

CI

@GustavoCaso GustavoCaso requested a review from a team May 16, 2023 16:29
@GustavoCaso GustavoCaso changed the title Check if :appsec setting is enabled before accessing it in remote component Check if :appsec setting is present before accessing it in remote component May 16, 2023
@github-actions github-actions bot added the core Involves Datadog core libraries label May 16, 2023
@GustavoCaso GustavoCaso merged commit 55556b5 into master May 17, 2023
113 of 128 checks passed
@GustavoCaso GustavoCaso deleted the fix-appsec-component-not-loaded-error-on-remote-component branch May 17, 2023 07:46
@github-actions github-actions bot added this to the 1.12.0 milestone May 17, 2023
Comment on lines 25 to +26
def register(settings)
if settings.appsec.enabled
if settings.respond_to?(:appsec) && settings.appsec.enabled
Copy link
Member

Choose a reason for hiding this comment

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

To be honest, this is why I'm not a big fan of patching behavior into core classes, especially conditionally; it makes is a bit hard to reason about what's there or what's not and only really gives the illusion of things being separate.

Copy link
Member Author

Choose a reason for hiding this comment

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

Agree 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Involves Datadog core libraries
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RSpec tracing setup broke on v1.10.0 - undefined method `appsec'
3 participants