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

Compile output clone #3364

Merged
merged 3 commits into from
Oct 10, 2024
Merged

Compile output clone #3364

merged 3 commits into from
Oct 10, 2024

Conversation

mstemm
Copy link
Contributor

@mstemm mstemm commented Oct 2, 2024

What type of PR is this?

Uncomment one (or more) /kind <> lines:

/kind bug

/kind cleanup

/kind design

/kind documentation

/kind failing-test

/kind feature

/kind release

Any specific area of the project related to this PR?

Uncomment one (or more) /area <> lines:

/area build

/area engine

/area tests

/area proposals

/area CI

What this PR does / why we need it:

This adds a clone() method for rule_loader::compile_output() that can be overridden by subclasses. This allows creating a mutable compile output in a polymorphic way.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

Copy link

github-actions bot commented Oct 2, 2024

This PR may bring feature or behavior changes in the Falco engine and may require the engine version to be bumped.

Please double check userspace/engine/falco_engine_version.h file. See versioning for FALCO_ENGINE_VERSION.

/hold

@mstemm mstemm force-pushed the compile-output-clone branch 2 times, most recently from 32d373f to 1b77da9 Compare October 2, 2024 16:01
mstemm added 3 commits October 2, 2024 09:10
Add a clone() method that can be overridden by subclasses. This allows
copying compile state when needed in a way that preserves
polymorphism.

Signed-off-by: Mark Stemm <[email protected]>
Add an equality operator for indexed_vector.

As indexed_vectors commonly hold falco lists/macros/rules, also add
equality operators for those structs. For condition/sinsp_filter
shared_ptrs, the operator checks that the shared_ptrs point to the
same underlying memory.

Signed-off-by: Mark Stemm <[email protected]>
Add a test for checking that compile_output::clone() returns equal
values, specifically in the case of derived values.

Signed-off-by: Mark Stemm <[email protected]>
@mstemm mstemm force-pushed the compile-output-clone branch from 1b77da9 to 42edde1 Compare October 2, 2024 16:10
Copy link
Contributor

@jasondellaluce jasondellaluce left a comment

Choose a reason for hiding this comment

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

/approve

@poiana
Copy link
Contributor

poiana commented Oct 2, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jasondellaluce, mstemm

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [jasondellaluce,mstemm]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@poiana
Copy link
Contributor

poiana commented Oct 2, 2024

LGTM label has been added.

Git tree hash: 7591b4a273b704292ebb9c0f3c3a2dcfc5abd991

@FedeDP FedeDP added this to the 0.40.0 milestone Oct 2, 2024
@FedeDP
Copy link
Contributor

FedeDP commented Oct 10, 2024

/unhold

@poiana poiana merged commit 80b7de6 into master Oct 10, 2024
36 checks passed
@poiana poiana deleted the compile-output-clone branch October 10, 2024 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants