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

Rework what is stored in mergin.json file #83

Closed
PeterPetrik opened this issue Apr 26, 2021 · 2 comments · Fixed by #185
Closed

Rework what is stored in mergin.json file #83

PeterPetrik opened this issue Apr 26, 2021 · 2 comments · Fixed by #185
Assignees
Labels
enhancement New feature or request

Comments

@PeterPetrik
Copy link
Contributor

plugin stores different format than the input (core) library, so it is not possible to use mergin project downloaded in QGIS with the mergin-cpp-client

MerginMaps/cpp-api-client#4

@wonder-sk
Copy link
Contributor

wonder-sk commented Oct 10, 2023

Here's the plan:

  • use the same approach as Input - dump the whole JSON from project_info() to .mergin/mergin.json
  • because right now py-client uses incompatible and incomplete JSON compared to the content of project_info(), we need the client to be able to parse both "old" and "new" mergin.json when reading metadata from MerginProject
  • new version of py-client will only save "new" mergin.json (so older versions of py-client will not understand mergin.json written by new versions)

Old version contains:

  • project full name (workspace + project name)
  • project ID
  • version
  • files

New version contains everything from the above, but also workspace ID and other bits as well (which we will not use immediately, but maybe later we will).

Incompatibilities between the "old" and "new" version of mergin.json:

  • old version uses name for <workspace>/<project_name>, while new version has separate attributes namespace and name
  • old version uses project_id for the ID, new version uses id attribute
  • freshly created project has explicitly stored "v0" in it, but server project info returns empty string (?)

When reading mergin.json, we could probably distinguish between old and new version based on whether name attribute has a slash in it (separating workspace and project name).

One last thing to consider: projects from older versions of py-client may not even include project_id as this has been added relatively recently. It would be good to detect that and either show an error, or maybe get new project info from the server and overwrite mergin.json.

Pre-requisite: #178 is merged

@wonder-sk
Copy link
Contributor

This will then fix also #151 and #71

@wonder-sk wonder-sk changed the title Consolidate mergin.json file with Input & mergin-cpp-client Rework what is stored in mergin.json file Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants