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

update: engine_version in semver representation #2838

Merged
merged 7 commits into from
Sep 28, 2023

Conversation

loresuso
Copy link
Member

@loresuso loresuso commented Sep 26, 2023

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 PR convert the falco engine_version to semver. It does so while trying to deal with possible breaking changes with rules. In particular, if required_engine_version yaml field in rule is

  • numeric, it is converted into a semver string by appending and prepending major and patch number (0.x.0)
  • a string, it will be handled as a semver string

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

update: engine_version in semver representation

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.

Looks great! Left some comments. Also, not strong on this but we may want to check that

base_engine_ver=$(grep ENGINE_VERSION "./userspace/engine/falco_engine_version.h" | awk '{print $3}' | sed -e 's/(//g' -e 's/)//g')
works as expected.

userspace/engine/falco_engine_version.h Outdated Show resolved Hide resolved
userspace/engine/rule_loader_collector.cpp Outdated Show resolved Hide resolved
userspace/falco/grpc_server_impl.cpp Outdated Show resolved Hide resolved
@loresuso loresuso force-pushed the update/engine-version-semver branch from 6326958 to 86c20cf Compare September 27, 2023 15:12
@loresuso loresuso force-pushed the update/engine-version-semver branch from 86c20cf to 0b6b432 Compare September 27, 2023 15:14
@loresuso loresuso changed the title wip: update: engine_version in semver representation update: engine_version in semver representation Sep 27, 2023
@jasondellaluce
Copy link
Contributor

/milestone 0.37.0

@poiana
Copy link
Contributor

poiana commented Sep 27, 2023

LGTM label has been added.

Git tree hash: 449e969acb49f3b7c9f24d28311a8428611e2641

@loresuso
Copy link
Member Author

Updated the checksum with the last commit

jasondellaluce
jasondellaluce previously approved these changes Sep 27, 2023
@poiana poiana added the lgtm label Sep 27, 2023
@poiana
Copy link
Contributor

poiana commented Sep 27, 2023

LGTM label has been added.

Git tree hash: 9dc3bd714eb7c4ef601c7a15555ee93fa7bd2112

@loresuso
Copy link
Member Author

Unfortunately CI Build / test-dev-packages / test-packages is failing. I'm investigating the issue

@loresuso loresuso changed the title update: engine_version in semver representation wip: update: engine_version in semver representation Sep 28, 2023
@loresuso loresuso force-pushed the update/engine-version-semver branch from cee5c42 to f3ae2c4 Compare September 28, 2023 15:08
@loresuso loresuso changed the title wip: update: engine_version in semver representation update: engine_version in semver representation Sep 28, 2023
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 poiana added the lgtm label Sep 28, 2023
@poiana
Copy link
Contributor

poiana commented Sep 28, 2023

LGTM label has been added.

Git tree hash: 9dc3bd714eb7c4ef601c7a15555ee93fa7bd2112

Copy link
Contributor

@incertum incertum 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 Sep 28, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: incertum, jasondellaluce, loresuso

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 [incertum,jasondellaluce]

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

@poiana poiana merged commit 09b1f92 into falcosecurity:master Sep 28, 2023
@incertum
Copy link
Contributor

Great work!!! 🎉

@@ -45,6 +45,9 @@ message response
string prerelease = 5;
string build = 6;
// falco engine version
uint32 engine_version = 7;
uint32 engine_minor = 7;
Copy link
Member

Choose a reason for hiding this comment

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

why did we change the proto here? I've seen that we keep engine_version as a field but we moved it to 11, maybe we can keep it here, WDYT?

@@ -79,6 +80,10 @@ void falco::grpc::server_impl::version(const context& ctx, const version::reques

res.set_engine_version(FALCO_ENGINE_VERSION);
res.set_engine_fields_checksum(FALCO_ENGINE_CHECKSUM);
auto engine_version = falco_engine::engine_version();
res.set_engine_major(engine_version.major());
Copy link
Member

Choose a reason for hiding this comment

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

i would remove the above line

res.set_engine_version(FALCO_ENGINE_VERSION);

and use

res.set_engine_version(engine_version.as_string());

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

Successfully merging this pull request may close these issues.

5 participants