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

[20823] Example refactor: Content filter #4859

Merged
merged 29 commits into from
Jun 17, 2024

Conversation

elianalf
Copy link
Contributor

@elianalf elianalf commented May 28, 2024

Description

This PR is part of a suite of PR which would make a refactor in the repository examples.
It is intended to apply to most of the examples, by making them homogeneous, more understandable, and more specific to the case they were meant to be.
In this content filter example, the main changes are:

  • Add customizable lower-bound and upper-bound options of the filter as arguments. In case of Custom filter, they represent the maximum and minimum values of the message indexes that are filtered-out through the filter. In case of Default filter they represent the maximum and minimum value message indexes that are read.
  • Add option filter Default, Custom or None

Contributor Checklist

  • Commit messages follow the project guidelines.
  • The code follows the style guidelines of this project.
  • Tests that thoroughly check the new feature have been added/Regression tests checking the bug and its fix have been added; the added tests pass locally
  • Any new/modified methods have been properly documented using Doxygen.
  • N/A Any new configuration API has an equivalent XML API (with the corresponding XSD extension)
  • Changes are backport compatible: they do NOT break ABI nor change library core behavior.
  • Changes are API compatible.
  • New feature has been added to the versions.md file (if applicable).
  • N/A New feature has been documented/Current behavior is correctly described in the documentation.
  • N/A Applicable backports have been included in the description.

Reviewer Checklist

  • The PR has a milestone assigned.
  • The title and description correctly express the PR's purpose.
  • Check contributor checklist is correct.
  • Check CI results: changes do not issue any warning.
  • Check CI results: failing tests are unrelated with the changes.

@elianalf elianalf added this to the v3.0.0 milestone May 28, 2024
@elianalf elianalf added the needs-review PR that is ready to be reviewed label May 30, 2024
@elianalf elianalf force-pushed the feature/example_refactor/content_filtering branch 2 times, most recently from 8bdb05a to 29d638f Compare May 31, 2024 07:14
Copy link
Member

@Mario-DL Mario-DL left a comment

Choose a reason for hiding this comment

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

Good job ! really nice example refactor.
Apart from the suggestions, we would need to update the README.md of the example and pass uncrustify

examples/cpp/content_filter/main.cpp Outdated Show resolved Hide resolved
examples/cpp/content_filter/CLIParser.hpp Outdated Show resolved Hide resolved
examples/cpp/content_filter/CMakeLists.txt Outdated Show resolved Hide resolved
examples/cpp/content_filter/HelloWorld.hpp Outdated Show resolved Hide resolved
test/examples/test_examples.py Outdated Show resolved Hide resolved
@Mario-DL
Copy link
Member

Mario-DL commented Jun 4, 2024

Also, we would need to update versions.md

@Mario-DL Mario-DL removed the needs-review PR that is ready to be reviewed label Jun 4, 2024
@elianalf elianalf force-pushed the feature/example_refactor/content_filtering branch 4 times, most recently from 30cb7ac to 558593c Compare June 5, 2024 15:10
@elianalf elianalf force-pushed the feature/example_refactor/content_filtering branch 2 times, most recently from 35872ef to 0b0f246 Compare June 10, 2024 07:25
@elianalf elianalf requested a review from Mario-DL June 10, 2024 07:26
@github-actions github-actions bot added the ci-pending PR which CI is running label Jun 10, 2024
Copy link
Member

@Mario-DL Mario-DL left a comment

Choose a reason for hiding this comment

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

I think we are getting there ! Leaving some comments.
In addition

  • We would also take the chance for renaming MyCustomFitler to CustomContentFilter or something like that as well as the factory.
  • We will need to rebase master and split the test case

examples/cpp/content_filter/Application.hpp Outdated Show resolved Hide resolved
examples/cpp/content_filter/CLIParser.hpp Outdated Show resolved Hide resolved
examples/cpp/content_filter/CLIParser.hpp Outdated Show resolved Hide resolved
examples/cpp/content_filter/CLIParser.hpp Outdated Show resolved Hide resolved
examples/cpp/content_filter/SubscriberApp.cpp Show resolved Hide resolved
examples/cpp/content_filter/README.md Outdated Show resolved Hide resolved
examples/cpp/content_filter/README.md Outdated Show resolved Hide resolved
examples/cpp/content_filter/SubscriberApp.cpp Outdated Show resolved Hide resolved
test/examples/test_examples.py Outdated Show resolved Hide resolved
@elianalf elianalf force-pushed the feature/example_refactor/content_filtering branch 6 times, most recently from 4c91c10 to 76f132b Compare June 12, 2024 05:22
@elianalf elianalf requested a review from Mario-DL June 12, 2024 05:24
Copy link
Member

@Mario-DL Mario-DL left a comment

Choose a reason for hiding this comment

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

Just one suggestion !
Also, please, put the static cast in CLIParser.hpp(230,54): warning C4244: '=': conversion from 'int' to 'uint16_t' to prevent windows from complaining

examples/cpp/content_filter/CLIParser.hpp Show resolved Hide resolved
@elianalf elianalf requested a review from Mario-DL June 12, 2024 13:05
Mario-DL
Mario-DL previously approved these changes Jun 12, 2024
Copy link
Member

@Mario-DL Mario-DL left a comment

Choose a reason for hiding this comment

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

LGTM with green CI !
Gj @elianalf

… the example

Signed-off-by: elianalf <62831776+elianalf@users.noreply.github.com>
Signed-off-by: elianalf <62831776+elianalf@users.noreply.github.com>
Signed-off-by: elianalf <62831776+elianalf@users.noreply.github.com>
Signed-off-by: elianalf <62831776+elianalf@users.noreply.github.com>
Signed-off-by: elianalf <62831776+elianalf@users.noreply.github.com>
Signed-off-by: elianalf <62831776+elianalf@users.noreply.github.com>
…for writer side filtering

Signed-off-by: elianalf <62831776+elianalf@users.noreply.github.com>
Signed-off-by: elianalf <62831776+elianalf@users.noreply.github.com>
Signed-off-by: elianalf <62831776+elianalf@users.noreply.github.com>
Signed-off-by: elianalf <62831776+elianalf@users.noreply.github.com>
Signed-off-by: elianalf <62831776+elianalf@users.noreply.github.com>
Signed-off-by: elianalf <62831776+elianalf@users.noreply.github.com>
…to allowing the writer side filtering

Signed-off-by: elianalf <62831776+elianalf@users.noreply.github.com>
Signed-off-by: elianalf <62831776+elianalf@users.noreply.github.com>
Signed-off-by: elianalf <62831776+elianalf@users.noreply.github.com>
Signed-off-by: elianalf <62831776+elianalf@users.noreply.github.com>
Signed-off-by: elianalf <62831776+elianalf@users.noreply.github.com>
Signed-off-by: elianalf <62831776+elianalf@users.noreply.github.com>
Signed-off-by: elianalf <62831776+elianalf@users.noreply.github.com>
Signed-off-by: elianalf <62831776+elianalf@users.noreply.github.com>
@elianalf elianalf force-pushed the feature/example_refactor/content_filtering branch from da99050 to 62dd37e Compare June 14, 2024 11:56
@elianalf elianalf requested a review from Mario-DL June 14, 2024 11:56
@elianalf
Copy link
Contributor Author

CI passed at the previous commit. The last commit only add the license comment.

Signed-off-by: elianalf <62831776+elianalf@users.noreply.github.com>
@elianalf elianalf force-pushed the feature/example_refactor/content_filtering branch from 66de49c to 4dac17a Compare June 17, 2024 05:46
Copy link
Member

@Mario-DL Mario-DL left a comment

Choose a reason for hiding this comment

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

LGTM ! Latest commit only adding licenses, ci was green

@Mario-DL Mario-DL added ready-to-merge Ready to be merged. CI and changes have been reviewed and approved. and removed ci-pending PR which CI is running labels Jun 17, 2024
@EduPonz EduPonz merged commit 984405b into master Jun 17, 2024
2 of 3 checks passed
@EduPonz EduPonz deleted the feature/example_refactor/content_filtering branch June 17, 2024 06:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge Ready to be merged. CI and changes have been reviewed and approved.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants