-
Notifications
You must be signed in to change notification settings - Fork 30
fix(NegativeSampleGenerator): Prevent duplicate user IDs when getting unique IPs #958
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
fix(NegativeSampleGenerator): Prevent duplicate user IDs when getting unique IPs #958
Conversation
|
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! (If you believe you should not receive this message, you can add yourself to the blocklist.) |
|
Is there anything major blocking this from being merged? I've tested out these changes for myself, and it seems to fix #860. |
ChristophWurst
left a comment
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.
Perfect, thanks for the descriptive PR and the test coverage 🙏
9690f4f to
0b71fb1
Compare
|
@ChristophWurst : You're welcome! I'm looking forward to the release of my changes. |
|
Dear @DerDreschner, apologies for the delay. It seems CI hasn't run so my attempt for automerge stalled. Let's try a branch update. |
… unique IPs Signed-off-by: David Dreschner <[email protected]>
Signed-off-by: David Dreschner <[email protected]>
Signed-off-by: David Dreschner <[email protected]>
Signed-off-by: David Dreschner <[email protected]>
0b71fb1 to
d4c332d
Compare
|
/backport to stable30 |
|
The backport to # Switch to the target branch and update it
git checkout stable30
git pull origin stable30
# Create the new backport branch
git checkout -b backport/958/stable30
# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts, resolve them
git cherry-pick d1e2b79f cbe0fad3 2d894667 d4c332d3
# Push the cherry pick commit to the remote repository and open a pull request
git push origin backport/958/stable30Error: Failed to cherry pick commits: error: no cherry-pick or revert in progress Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports. |
|
/backport to stable29 |
|
The backport to # Switch to the target branch and update it
git checkout stable29
git pull origin stable29
# Create the new backport branch
git checkout -b backport/958/stable29
# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts, resolve them
git cherry-pick d1e2b79f cbe0fad3 2d894667 d4c332d3
# Push the cherry pick commit to the remote repository and open a pull request
git push origin backport/958/stable29Error: Failed to cherry pick commits: error: no cherry-pick or revert in progress Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports. |
|
@ChristophWurst / @joshtrichards : Looks something got very wrong. Backporting didn't work at all and I can't see my changes in the stable30 nor stable29 branch / 30.0.5rc1 tag. |
|
Apologies for the delay, @DerDreschner. The bot failed because of the squashed merge. It probably tried to find the original commit hashes. |
To weight the usage of IPs in the data model, the user id is being added multiple times to the dataset. The exact number is being determined here:
suspicious_login/lib/Service/DataLoader.php
Line 80 in 9043a66
The problem is that this isn't always being taken into account when generating the training data. In case the dataset contains no IP with exactly one user id in the array, the array is malformed by containing only user ids (16 columns in size) in this variable:
suspicious_login/lib/Service/DataLoader.php
Line 107 in 9043a66
The reason is the code in the
getUniqueIPsPerUserfunction. It returns only IPs with exactly one user id in the second dimension, while not checking if the user id was already added to the IP during the previous data transformation.The Rubix ML library then throws an
InvalidArgumentExceptiondue to the unequal number of columns when trying to merge the malformed array with the other datasets here:suspicious_login/lib/Service/DataLoader.php
Line 115 in 9043a66
This PR will fix the issue and adds an unit test to prevent it during future refactoring steps.
Closes #860
Closes #933