-
Notifications
You must be signed in to change notification settings - Fork 388
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-#1036 builder pattern for file lock #1418
iox-#1036 builder pattern for file lock #1418
Conversation
Signed-off-by: Christian Eltzschig <me@elchris.org>
Signed-off-by: Christian Eltzschig <me@elchris.org>
Signed-off-by: Christian Eltzschig <me@elchris.org>
Signed-off-by: Christian Eltzschig <me@elchris.org>
Signed-off-by: Christian Eltzschig <me@elchris.org>
Signed-off-by: Christian Eltzschig <me@elchris.org>
Signed-off-by: Christian Eltzschig <me@elchris.org>
536e9f1
to
0f9dbcc
Compare
…y manager and ipc interface creator Signed-off-by: Christian Eltzschig <me@elchris.org>
…just invalid name test Signed-off-by: Christian Eltzschig <me@elchris.org>
Codecov Report
@@ Coverage Diff @@
## master #1418 +/- ##
==========================================
- Coverage 78.83% 78.80% -0.03%
==========================================
Files 378 377 -1
Lines 14579 14503 -76
Branches 2027 2020 -7
==========================================
- Hits 11493 11429 -64
Misses 2432 2432
+ Partials 654 642 -12
Flags with carried forward coverage won't be shown. Click here to find out more.
|
iceoryx_hoofs/include/iceoryx_hoofs/posix_wrapper/file_lock.hpp
Outdated
Show resolved
Hide resolved
iceoryx_hoofs/include/iceoryx_hoofs/posix_wrapper/file_lock.hpp
Outdated
Show resolved
Hide resolved
iceoryx_hoofs/include/iceoryx_hoofs/posix_wrapper/file_lock.hpp
Outdated
Show resolved
Hide resolved
…blic type aliases, remove unnecessary arguments Signed-off-by: Christian Eltzschig <me@elchris.org>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not yet review the new tests for the helplets
iceoryx_hoofs/include/iceoryx_hoofs/posix_wrapper/file_lock.hpp
Outdated
Show resolved
Hide resolved
…pacity so that it considers the file name length with suffix Signed-off-by: Christian Eltzschig <me@elchris.org>
Signed-off-by: Christian Eltzschig <me@elchris.org>
Signed-off-by: Christian Eltzschig <me@elchris.org>
…n windows since the maximum supported path length is 255 and as long as the maximumg file name length Signed-off-by: Christian Eltzschig <me@elchris.org>
iceoryx_hoofs/include/iceoryx_hoofs/posix_wrapper/file_lock.hpp
Outdated
Show resolved
Hide resolved
iceoryx_hoofs/include/iceoryx_hoofs/posix_wrapper/file_lock.hpp
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
helplets tests still not reviewed
Signed-off-by: Christian Eltzschig <me@elchris.org>
Signed-off-by: Christian Eltzschig <me@elchris.org>
iceoryx_hoofs/include/iceoryx_hoofs/posix_wrapper/file_lock.hpp
Outdated
Show resolved
Hide resolved
{ | ||
::testing::Test::RecordProperty("TEST_ID", "8052b601-c9ad-4cb8-9a87-c301f213d8c4"); | ||
EXPECT_TRUE(isValidPath( | ||
string<FILE_PATH_LENGTH>("/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/0123456789/-.:_"))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it mean that removing :_
from the end makes this path invalid?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, maybe the name is misleading. I just wanted to pack all valid characters in one string and check if the string is valid.
Why did you think that removing :_
would make the path invalid?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because the FilePathsWithEndingDotsAreInvalid
test suggest that this is the case since the path would end with a dot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah of course then you are right.
The validation of the file names, paths and entries should work platform independently and therefore I restricted the names a bit to support some more file systems or let's say weird applications.
For instance, NTFS supports file names which end with a dot (blaa.
) but the windows file explorer does not. So you can see the file but not open, modify or delete it since it is not supported by the Windows API. Yeah.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's similar with .blaa
. You cannot create it but AFAIK open, modify and delete it with the file explorer.
…aths at the end of a path Signed-off-by: Christian Eltzschig <me@elchris.org>
Signed-off-by: Christian Eltzschig <me@elchris.org>
Signed-off-by: Christian Eltzschig <me@elchris.org>
…needed function Signed-off-by: Christian Eltzschig <me@elchris.org>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost there
@@ -47,8 +47,8 @@ class RouDiApp | |||
|
|||
protected: | |||
/// @brief waits for the next signal to RouDi daemon | |||
[[deprecated( | |||
"use iox::posix::waitForTerminationRequest() from 'iceoryx_hoofs/posix_wrapper/signal_watcher.hpp'")]] bool | |||
[[deprecated("removed in 4.0, use iox::posix::waitForTerminationRequest() from " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this.
Disclaimer: I don't suggest to do this in this PR
It would be great to have this formalized and checked by the CI. A a script ninja could create a script to check for a specific syntax for our deprecation attributes. In combination with the VERSION
file, this could tell us that there are deprecated functions for the new release and we need to remove them.
Do you think it might make sense to also tell the user which release introduce the deprecation? Just in case we have something that will be remove in next+2, e.g.
[[deprecated("in 3.0, removed in 6.0, use foo::bar()")]]
…PathEntry to reduce code duplication, add further tests Signed-off-by: Christian Eltzschig <me@elchris.org>
…h in api change in release note Signed-off-by: Christian Eltzschig <me@elchris.org>
0eb35b3
to
5274023
Compare
Pre-Review Checklist for the PR Author
iox-#123-this-is-a-branch
)iox-#123 commit text
)git commit -s
)task-list-completed
)Notes for Reviewer
The FileLock had some issues. For instance it never verified that the path prefix was a valid path (syntax) and it hardcoded the permissions. I added those as builder parameters and verified them.
To verify the path I had to add a variation of
isValidFilePath
calledisValidPath
which just does not check if the last character is a separator. The tests are also more or less the same with some minor addition (adding a last slash).Checklist for the PR Reviewer
Post-review Checklist for the PR Author
References