-
Notifications
You must be signed in to change notification settings - Fork 2
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
[CZID-8457] Create a file - part 2 #65
[CZID-8457] Create a file - part 2 #65
Conversation
@@ -38,7 +38,7 @@ def download_link( | |||
) -> typing.Optional[SignedURL]: | |||
if not self.path: # type: ignore | |||
return None | |||
key = self.path.lstrip("/") # type: ignore | |||
key = self.path # type: ignore |
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.
While i'm at it, I'm removing all lstrip calls and making sure the file paths generated in the seed script don't start with /
@@ -11,6 +12,12 @@ | |||
Faker.add_provider(EnumProvider) | |||
|
|||
|
|||
def generate_relative_file_path(obj) -> str: # type: ignore | |||
fake = faker.Faker() |
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 think we need to use factory.Faker() 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.
mutation = f""" | ||
mutation MyQuery {{ | ||
createFile(entityId: "{entity_id}", entityFieldName: "{entity_field}", | ||
fileName: "test.fastq", fileSize: 123, fileFormat: "fastq") {{ |
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.
Do we have (/want/need?) to get the file size info as part of the 'create' call?
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.
Not sure actually, I don't think we need the file size to be stored in the DB for the app to work. The only use case I can think of is: we want basic stats about how much certain uploaded files take up on S3 and querying the DB would be much faster than querying S3 (but not guaranteed to be accurate).
assert output["errors"] is not None | ||
return | ||
|
||
assert output["data"]["createFile"]["url"] == "https://local-bucket.s3.amazonaws.com/" |
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.
Can we return a fully formed signed URL instead of all the parts of one?
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 tried putting it all in a URL but it didn't work for some reason, I had to send the fields in the body of the POST request
Adding tests for the changes in #61