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

Refactoring datasets components #2415

Closed
lorenzo-cavazzi opened this issue Mar 10, 2023 · 1 comment
Closed

Refactoring datasets components #2415

lorenzo-cavazzi opened this issue Mar 10, 2023 · 1 comment
Assignees

Comments

@lorenzo-cavazzi
Copy link
Member

lorenzo-cavazzi commented Mar 10, 2023

This is an umbrella issue for refactoring datasets components.

Tasks

Tasks include converting all the datasets components to:

  • Use React functional components.
  • Invoke APIs through RTK Query.
  • Save local status to Redux slices using RTK.

Changes

In the process, we should:

Caveats

Here are a few things to keep in mind.

Datasets can be accessed either through a project or alone. There are some differences:

  • As an independent entity they:
    • Have a unique ID, similar to a SHA, that identifies them (there might be new versions, and older versions of these ids might contain - that must be stripped out). There is no user-friendly name. E.G: https://dev.renku.ch/datasets/7492c98815a544418762fcb5fae2d6ba
    • Data is available only from the KG, and it might be temporarily not up-to-date after modifying a dataset. Currently, there is no way around it since the KG takes some time to process new commits.
    • They are usually contained in 1 or more projects; even when contained in just 1 project, they are a separate entity from the project's counterpart.
  • Inside a project:
    • Both a unique ID (SHA-style) and a human-friendly ID exist. The readable one works slight differently since it points to the latest version of that dataset. E.G. lorenzo.cavazzi.tech/updated-flight-tutorial-2023/datasets/flight-data might vary when accessing it again later.
    • Data is available from both KG and core. Core is immediately up-to-date but it might have less information. KG might be outdated after updating a dataset. Be careful when merging the data and explore possible good solutions (E.G. play with the unique IDs and see if that can be used to identify outdated data. Maybe we can even discard outdated KG data and try to refetch with polling style until we get the recent information; or we could use the KG indexing status data to discard KG content until the project is fully indexed. In any case, don't mix core and KG data unless it's sure they are both referring to the latest version of the dataset)

There might be other difficulties not listed here. Consider spending some time before the implementation to analyze how datasets work right now and what could be problematic.

@lorenzo-cavazzi lorenzo-cavazzi converted this from a draft issue Mar 10, 2023
@ciyer ciyer moved this from Todo 📌 to In Progress 🧑‍💻 in UI Sprints - DEPRECATED Mar 20, 2023
ciyer added a commit that referenced this issue Apr 14, 2023
* refactor: prepare to migrate to rtk-query for dataset
* refactor: fetch dataset files using rtk query
* refactor: simplify ProjectDatasetView logic
* refactor: fetch datasets from KG using rtk query
ciyer added a commit that referenced this issue Jun 16, 2023
* fix: redirect to the datasets page after import
* refactor: convert DatasetImport to TS
* tests: dataset import test
* refactor: implement dataset import without form generator
ciyer added a commit that referenced this issue Jun 30, 2023
* tests: test adding a dataset without sufficient project access
* fix: bug fixes in ImageInput
@ciyer ciyer moved this from In Progress 🧑‍💻 to Review 🔎 in UI Sprints - DEPRECATED Jul 13, 2023
@ciyer ciyer moved this from Review 🔎 to In Progress 🧑‍💻 in UI Sprints - DEPRECATED Jul 13, 2023
ciyer pushed a commit that referenced this issue Jul 14, 2023
minor: improve appearance of dataset delete
ciyer pushed a commit that referenced this issue Jul 14, 2023
minor: improve appearance of dataset delete
@lorenzo-cavazzi
Copy link
Member Author

We can close this. We will continue the refactoring in #2678

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

No branches or pull requests

2 participants