Uploading a forge project via the API

Bonjour,

Although the Gitea codebase is able to migrate projects from GitLab, GitHub or other Gitea instances using the API, it can only do so with a Gitea target. It goes like this for issues (and all other aspects of a project, except the git repository):

  • Get issue information from a forge via the API
  • Option A
    • store it in YAML on disk
    • at a later time read the YAML information to create a new issue in the Gitea database
  • Option B: create a new issue in the Gitea database

In the context of forge federation, there is a need to create an issue via the API of the forge being federated. It cannot assume, even in the case of Gitea, that there is access to the database. Here is the proposed implementation:

  • Get repository and issue information from a forge via the API
  • Store them in YAML on disk
  • Read the YAML and create an issue via the forge being proxied using the API

There also is a need for this to be idempotent: when an issue is updated in the originating forge, it must also be updated in the target forge. For this purpose a new table is created in the database of the fedeproxy server. It maps URL/id of the originating forge to URL/id of the target forge. When an issue is created, a new entry is added. Before creating an issue, a query with the URL/id of the originating forge is made: if a match is found, the corresponding issue on the target forge is updated instead of creating a new one.

Cheers