-
Notifications
You must be signed in to change notification settings - Fork 967
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
Display DOIs in Archived Histories #18134
Conversation
Nice, great idea! |
Thanks! Obviously not my idea 😆 |
To clearly indicate that the function is fetching the file sources from the server and not just returning them from the store.
To avoid multiple similar queries to the backend since fileSources are rather static.
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.
My preference would be to just add URL to the serialized object instead of the extra
handling. It seems fine to me that 95% of file sources wouldn't use it and I think I like that it would be documented in the schema. I get the handling it this way though - I understand the impulse and we've done things like this all over Galaxy many times.
That was my initial approach 3e375ca#diff-644fe18408381b506c4abc27ffe07d42b8a8dc55a5a833f705662f65fe60c6d6L382 😅 But I'm happy to revert that if the |
I think what I was suggesting was just adding --- a/lib/galaxy/files/sources/__init__.py
+++ b/lib/galaxy/files/sources/__init__.py
@@ -98,6 +98,7 @@ class FilesSourceProperties(TypedDict):
uri_root: NotRequired[str]
type: NotRequired[str]
browsable: NotRequired[bool]
+ url: NotRequired[str]
@dataclass
@@ -319,6 +320,9 @@ class BaseFilesSource(FilesSource):
def get_writable(self) -> bool:
return self.writable
+ def get_url(self) -> Optional[str]:
+ return None
+
def user_has_access(self, user_context: "OptionalUserContext") -> bool:
if user_context is None and self.user_context_required:
return False
@@ -381,6 +385,9 @@ class BaseFilesSource(FilesSource):
"disable_templating": self.disable_templating,
"scheme": self.get_scheme(),
}
+ url = self.get_url()
+ if url is not None:
+ rval["url"] = url
if self.get_browsable():
rval["uri_root"] = self.get_uri_root()
if for_serialization: But what URL means is going to change a lot from plugin to plugin if any others ever implement it. So I am totally fine with your approach. This just feels a little more structured. |
Ahh I see your point now. This is certainly simpler, the whole Thank you for explaining in detail! I will remove the |
For the sake of simplicity
The integration test failure is somewhat "persistent" but unrelated:
|
When a history has been archived preserving the data in an external RDM repository like Zenodo, we can display its Document Object Identifier on it.
This PR also allows FilesSource plugins to serialize extra properties defined in theWe decided to replace theserialize_extra_props
class variable. This adds flexibility to customize the information we want to serialize for the file source. In this particular case, we serialize to theextra
fields the repository URL associated with the RDM file source so it can be used to fetch the DOI information.extra
field with directly serializing theurl
for simplicity even if not all file sources might use it.How to test the changes?
(Select all options that apply)
License