Skip to content
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

url_generation needs refactor and classes #1525

Open
Tracked by #1521
anthony-chaudhary opened this issue Aug 15, 2023 · 0 comments
Open
Tracked by #1521

url_generation needs refactor and classes #1525

anthony-chaudhary opened this issue Aug 15, 2023 · 0 comments
Labels

Comments

@anthony-chaudhary
Copy link
Member

anthony-chaudhary commented Aug 15, 2023

Right now we have to go fairly far "down" to get a signed URL back.
Too many similar function calls without clear value add or difference.

  • serialize_for_source_control
  • blob_regenerate_url
  • connection_url_regenerate
  • get_from_connector (thin pass through)
  • __get_pre_signed_url (connector implementation specific)
  • __custom_presign_url (optional)

The net result is that in the __custom_presign_url case, there's about 5+ layers it has to pass through to actually get result back.
Given that connectors are expected to be the new default path, it should be more clear.

Conceptually what feels like is missing is

  • A SignedURL generation class or something similar
    All these functions are spread apart connections, media type specific, etc. and not sure if that's the most logical through thread
  • A refresh on what the expected default case is.
  • A "Return object" or something that better encapsulates the expected items.
    Most of this is around error handling. e.g. we have http errors, our regular log system, etc. but it feels like this error handling gets very confused at the multiple layers. Sometimes we are only returning the error, sometimes the log, sometimes another object and the log, sometimes not returning at all, etc. Just feels very messy (each function maybe it's reasonable, but then used together it's very hard to follow).
  • Commented on fetch_data/connector issues here Next iteration of fetch_data connectors concept #1524
  • Better surface __custom_presign_url

Naming

  • New default is to generate "on demand" so should be something more about that and not regenerate
  • get_from_connector is a very thin pass through and feels like it confuses more then helps.
    Note that it was thicker before, because it had duplicate error handling logic.

Generally this has evolved out of a system that did far less, and now needs some big refactors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant