Skip to content

[ENG-11516] Eliminate the request between metadata and download#490

Open
antkryt wants to merge 2 commits into
CenterForOpenScience:feature/improve-daz-phase2from
antkryt:feature/ENG-11516
Open

[ENG-11516] Eliminate the request between metadata and download#490
antkryt wants to merge 2 commits into
CenterForOpenScience:feature/improve-daz-phase2from
antkryt:feature/ENG-11516

Conversation

@antkryt

@antkryt antkryt commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Ticket

https://openscience.atlassian.net/browse/ENG-11516

Purpose

Pass storage meta to provider download method

Changes

Side effects

QA Notes

Deployment Notes

@cslzchen cslzchen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks great and will merge after local verification.

@cslzchen cslzchen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Re-review this PR with local testing and raised two questions 🔥

Comment on lines +216 to +219
if version is None and storage and storage.get('data', None):
data = storage
else:
# Capture user_id for analytics if user is logged in

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let's add a comment explaining that the first option is to bypass the extra request and only falls back to make that request if storage returned is None.

In addition, I don't know when this fall back happens, we should add a sentry message to log. Note: don't log any credentials. Just the node and the path.

Another thing I missed earlier is this request affects osfstorage download in general instead of just for DAZ. This means, we need to extra careful.

# Capture user_id for analytics if user is logged in

Can you take a look at if our change will lead to missing analytics? What are the analytics this request is capturing? Is it captured on WB or more likely is it sending information to OSF for OSF to capture?

Comment on lines 562 to +568
if limit is not None:
query['orm'] = True
query['limit'] = limit
if after is not None:
query['after'] = after
elif kwargs.get('orm') is not None:
query['orm'] = kwargs['orm']

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This may be done in a future ticket but we need to decide and document the default behavior. As it is coded right now, the behavior is:

  • RAW SQL is used unless orm is explicitly specified or limit (pagination, which requires orm) is used

Another thought I have is, if ORM is equivalent to raw SQL, is there a strong reason to keep both, since it adds maintenance effort to sync both?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants