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

Iox #14 restrict access to chunk header #664

Conversation

elBoberido
Copy link
Member

@elBoberido elBoberido commented Apr 1, 2021

Pre-Review Checklist for the PR Author

  1. Code follows the coding style of CONTRIBUTING.md
  2. Tests follow the best practice for testing
  3. Branch follows the naming format (iox-#123-this-is-a-branch)
  4. Commits messages are according to this guideline
    • Commit messages have the issue ID (iox-#123 commit text)
    • Commit messages are signed (git commit -s)
    • Commit author matches Eclipse Contributor Agreement (and ECA is signed)
  5. Update the PR title
    • Follow the same conventions as for commit messages
    • Link to the relevant issue
  6. Relevant issues are linked
  7. Add sensible notes for the reviewer
  8. All checks have passed (except task-list-completed)
  9. Assign PR to reviewer

Notes for Reviewer

This PR restricts the write access to the ChunkHeader only to the ChunkSender. Everyone else has only read access. This prevents accidentally corrupting the ChunkHeader by e.g. setting the payload offset.

Additionally const correctness is added to some methods of the ChunkHeader and the C API is adjusted accordingly

Checklist for the PR Reviewer

  • Commits are properly organized and messages are according to the guideline
  • Code according to our coding style and naming conventions
  • Unit tests have been written for new behavior
  • Public API changes are documented via doxygen
  • Copyright owner are updated in the changed files
  • PR title describes the changes

Post-review Checklist for the PR Author

  1. All open points are addressed and tracked via issues

References

@elBoberido elBoberido self-assigned this Apr 1, 2021
@elBoberido elBoberido added the technical debt unclean code and design flaws label Apr 1, 2021
@elBoberido elBoberido force-pushed the iox-#14-restrict-access-to-chunk-header branch from d8cfc2e to 815f2a7 Compare April 1, 2021 09:44
@codecov
Copy link

codecov bot commented Apr 1, 2021

Codecov Report

Merging #664 (72aaabc) into master (c043d3c) will increase coverage by 0.35%.
The diff coverage is 98.21%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #664      +/-   ##
==========================================
+ Coverage   74.04%   74.39%   +0.35%     
==========================================
  Files         319      319              
  Lines       11180    11207      +27     
  Branches     1963     1963              
==========================================
+ Hits         8278     8338      +60     
+ Misses       2132     2098      -34     
- Partials      770      771       +1     
Flag Coverage Δ
unittests 74.35% <98.21%> (+0.35%) ⬆️
unittests_timing 31.20% <19.64%> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...nclude/iceoryx_dds/internal/gateway/iox_to_dds.inl 62.96% <0.00%> (ø)
...eoryx_posh/include/iceoryx_posh/popo/publisher.hpp 100.00% <ø> (ø)
...sh/include/iceoryx_posh/popo/untyped_publisher.hpp 100.00% <ø> (ø)
iceoryx_binding_c/source/c_chunk.cpp 100.00% <100.00%> (ø)
...clude/iceoryx_posh/internal/mepoo/chunk_header.inl 100.00% <100.00%> (ø)
...osh/internal/popo/building_blocks/chunk_sender.inl 96.77% <100.00%> (ø)
...h/include/iceoryx_posh/internal/popo/publisher.inl 100.00% <100.00%> (ø)
...lude/iceoryx_posh/internal/popo/sample_deleter.inl 100.00% <100.00%> (ø)
.../include/iceoryx_posh/internal/popo/subscriber.inl 80.00% <100.00%> (ø)
...e/iceoryx_posh/internal/popo/untyped_publisher.inl 100.00% <100.00%> (ø)
... and 6 more

Signed-off-by: Mathias Kraus <[email protected]>
elfenpiff
elfenpiff previously approved these changes Apr 1, 2021
iceoryx_binding_c/include/iceoryx_binding_c/chunk.h Outdated Show resolved Hide resolved
iceoryx_posh/source/mepoo/chunk_header.cpp Show resolved Hide resolved
EXPECT_EQ(userPayloadRoundtrip, userPayload);
}

TEST_F(BindingC_Chunk_test, GettingUserHeaderFromNonConstChunkHeaderWorks)
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: I try to avoid NonConstFoo and ConstFoo. I prefer Foo and ConstFoo

Copy link
Member Author

@elBoberido elBoberido Apr 1, 2021

Choose a reason for hiding this comment

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

I try to be explicit since this tests are explicitly for the constness

iceoryx_posh/source/mepoo/chunk_header.cpp Show resolved Hide resolved
@elBoberido elBoberido merged commit a7bc3a0 into eclipse-iceoryx:master Apr 1, 2021
@elBoberido elBoberido deleted the iox-#14-restrict-access-to-chunk-header branch April 1, 2021 14:54
marthtz pushed a commit to boschglobal/iceoryx that referenced this pull request May 12, 2021
…ccess-to-chunk-header

Iox eclipse-iceoryx#14 restrict access to chunk header
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
technical debt unclean code and design flaws
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reserved chunkinfo user payload header
4 participants