-
Notifications
You must be signed in to change notification settings - Fork 7
[s3inbox] Send remove message on overwrite #1543
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
Conversation
f6c34d0
to
a13a000
Compare
We have the schema for the |
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.
We have all the JSON schemas available so validation of the outgoing message can be done.
We should also not only check for the existence of the file but also handle any errors in a way so that the user gets the proper notification.
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.
The checkFileExists
should have a static test so we can validate the two expected results.
e2fab24
to
6b88b02
Compare
One extra message for deletion of the overwritten file is expected.
6b88b02
to
000c8ad
Compare
After a lot of rebasing, bug fixing and improved test setup (mainly from @jbygdell) this is now ready for review again! |
Co-authored-by: Joakim Bygdell <[email protected]>
I have fixed the things you comment on @jbygdell . Please have a look and resolve the comments. Personally, I think our linters should be responsible for things like newlines. They should complain on everything we want to enforce. If they do not enforce a standard, it should be optional :) . |
The new version of the linter (that caused all the failures) will catch the empty lines among many other things in the codbase. So I'm just being preemptive here. |
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.
Works well when I tested. Great job!
Related issue(s) and PR(s)
This PR closes #1480 .
Description
When uploading a file to s3inbox, a check is done to see if the file is already there. If it is, a delete message is sent before the upload message, so that the FEGA portal will know that the new version of the file exists.
Note: Theremove
message is formatted according to this spec. However, our messages will have two extra fields,"encrypted_checksums":null
and"filesize":0
, since it shares the go struct with upload messages. Hopefully, that won't be any problem. Please let me know if you think it will.How to test
Run the integration tests, and check that after the tests in
.github/integration/tests/sda/10_upload_test.sh
are run, there are 6 messages forupload
and one forremove
in rabbitmq messages in theinbox
queue.You can also manually upload a file twice, and check the queue and the logs to make sure the
remove
message is only sent the second time:s3cmd -c /tmp/shared/s3cfg put dummyfile.c4gh s3://test_dummy.org/