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

[#394] sample mut uninit #395

Merged
merged 10 commits into from
Sep 27, 2024

Conversation

elfenpiff
Copy link
Contributor

@elfenpiff elfenpiff commented Sep 25, 2024

Notes for Reviewer

  • Fixes the problem that uninitialized samples can be sent by introducing a SampleMutUninit struct that does not offer a send method
  • Renames the method send_sample into send since it was weird to read send_sample(std::move(sample)), this is much cleaner send(std::move(sample)).
  • The introduction of the new class needed an adjustment on the C API level - here we always use uninitialized samples
    • SampleMut has no C binding, the C++ implementation is done directly via the C API, otherwise it would be much more code on the FFI layer

Pre-Review Checklist for the PR Author

  1. Add sensible notes for the reviewer
  2. PR title is short, expressive and meaningful
  3. Relevant issues are linked in the References section
  4. Every source code file has a copyright header with SPDX-License-Identifier: Apache-2.0 OR MIT
  5. Branch follows the naming format (iox2-123-introduce-posix-ipc-example)
  6. Commits messages are according to this guideline
  7. Tests follow the best practice for testing
  8. Changelog updated in the unreleased section including API breaking changes
  9. Assign PR to reviewer
  10. All checks have passed (except task-list-completed)

Checklist for the PR Reviewer

  • Commits are properly organized and messages are according to the guideline
  • Unit tests have been written for new behavior
  • Public API is documented
  • PR title describes the changes

Post-review Checklist for the PR Author

  1. All open points are addressed and tracked via issues

References

Closes #394

@elfenpiff elfenpiff self-assigned this Sep 25, 2024
@@ -161,7 +161,7 @@ static DEFAULT_LOGGER: logger::log::Logger = logger::log::Logger::new();
#[cfg(not(any(feature = "logger_log", feature = "logger_tracing")))]
static DEFAULT_LOGGER: logger::console::Logger = logger::console::Logger::new();

const DEFAULT_LOG_LEVEL: u8 = LogLevel::Trace as u8;
const DEFAULT_LOG_LEVEL: u8 = LogLevel::Warn as u8;
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess this is based on #393

Copy link
Contributor Author

@elfenpiff elfenpiff Sep 25, 2024

Choose a reason for hiding this comment

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

Yes it is ... I forget to mention this.

But it was an accident

Copy link
Contributor

@orecham orecham left a comment

Choose a reason for hiding this comment

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

@elfenpiff Looks good. Ping me for approval after rebasing on main or merging #393.

@elfenpiff elfenpiff force-pushed the iox2-394-sample-mut-uninit branch from 53f2c3c to 9c4c1d7 Compare September 25, 2024 13:51
Copy link

codecov bot commented Sep 25, 2024

Codecov Report

Attention: Patch coverage is 78.82353% with 18 lines in your changes missing coverage. Please review.

Project coverage is 79.00%. Comparing base (88d7507) to head (dbff454).
Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
iceoryx2/src/sample_mut_uninit.rs 74.64% 18 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #395      +/-   ##
==========================================
- Coverage   79.01%   79.00%   -0.02%     
==========================================
  Files         194      194              
  Lines       22730    22730              
==========================================
- Hits        17961    17958       -3     
- Misses       4769     4772       +3     
Files with missing lines Coverage Δ
iceoryx2/src/port/publisher.rs 84.99% <100.00%> (ø)
iceoryx2/src/sample_mut.rs 56.25% <ø> (ø)
iceoryx2/src/sample_mut_uninit.rs 74.64% <74.64%> (ø)

... and 5 files with indirect coverage changes

@elfenpiff elfenpiff force-pushed the iox2-394-sample-mut-uninit branch from 9c4c1d7 to 88d7507 Compare September 25, 2024 20:58
@orecham orecham self-requested a review September 25, 2024 21:21
orecham
orecham previously approved these changes Sep 25, 2024
Copy link
Member

@elBoberido elBoberido left a comment

Choose a reason for hiding this comment

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

The request changes is just to make you aware of my comments. If you dismiss them, I'm fine with merging.

doc/release-notes/iceoryx2-unreleased.md Show resolved Hide resolved
iceoryx2-ffi/ffi/src/api/sample_mut_uninit.rs Outdated Show resolved Hide resolved
@elfenpiff elfenpiff force-pushed the iox2-394-sample-mut-uninit branch from 852f747 to dbff454 Compare September 26, 2024 11:39
@elBoberido elBoberido dismissed their stale review September 26, 2024 23:50

Well, obviously I did not find time to look at it, so no reason to block the PR.

@elfenpiff elfenpiff merged commit da1ec61 into eclipse-iceoryx:main Sep 27, 2024
55 of 56 checks passed
@elfenpiff elfenpiff deleted the iox2-394-sample-mut-uninit branch September 27, 2024 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SampleMut<MaybeUninit<T>> offers send method
3 participants