Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Submit feedback
    • Contribute to GitLab
  • Sign in
haskell-gargantext
haskell-gargantext
  • Project
    • Project
    • Details
    • Activity
    • Releases
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 159
    • Issues 159
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 6
    • Merge Requests 6
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • gargantext
  • haskell-gargantexthaskell-gargantext
  • Merge Requests
  • !375

Closed
Opened Dec 09, 2024 by Alfredo Di Napoli@AlfredoDiNapoli
  • Report abuse
Report abuse

Transferring nodes between instances

Eventually fixes #403 (closed).

This MR makes possible sending nodes over the wire from an instance A to an instance B. This MR introduces two new endpoints:

  • /api/v1.0/remote/export
  • /api/v1.0/remote/import

The idea is that users willing to transfer a node from A to B have to be logged on both instances. Then, they would issue a request to /api/v1.0/remote/export specifying the id of the node, the BaseUrl of the target instance and the JWT token to authenticated against instance B. Both the instance URL and the token would be in scope in the frontend, as the latter has to manage logins between instances.

Under the hood, the backend of node A would call the /import endpoint on node B, which would proceed transferring the node.

At the moment there are several limitations:

  1. We support sending only one node at the time, but that's not very useful, because a node might have children, so we need to figure out, from A, the recursive list of children and stream all of that;
  2. We don't efficiently deserialise and stream the results into the DB code that inserts them, there is support but is currently not leveraged, maybe that's for a follow-up MR;
  3. There is the question about what to do in case of inter-dependencies, but I think that for the initial MR it's enough to pass a tree structure we can use to sequentially insert nodes from the root (which parentId would be Nothing) to the last leaf, but I have to yet figure out how to do that properly.
Edited Jan 20, 2025 by Alfredo Di Napoli

Check out, review, and merge locally

Step 1. Fetch and check out the branch for this merge request

git fetch origin
git checkout -b adinapoli/issue-403 origin/adinapoli/issue-403

Step 2. Review the changes locally

Step 3. Merge the branch and fix any conflicts that come up

git fetch origin
git checkout origin/dev
git merge --no-ff adinapoli/issue-403

Step 4. Push the result of the merge to GitLab

git push origin dev

Note that pushing to GitLab requires write access to this repository.

Tip: You can also checkout merge requests locally by following these guidelines.

  • Discussion 46
  • Commits 25
  • Pipelines 23
  • Changes 62
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
1
Labels
Ready to merge
Assign labels
  • View project labels
Reference: gargantext/haskell-gargantext!375