Mapping identifiers

Each object in F3 (issues, releases, etc.) have a unique identifier that originates from the forge from which it was created. When it is imported in another forge, it may get the same identifier (for instance issues have identifiers relative to the project in Gitea) or different identifiers (for instance comments in Gitea are each assigned globally unique identifiers which are unlikely to be the same from one forge to the other.

For mirroring to work, F3 needs to remember which identifier was assigned to an object when it was imported in a given forge. The identifier stored in the object matches the forge from which the object was exported. The mapping to the identifier assigned to the object after it is imported in another forge is stored in an external map in the _identifiers.json file, structured as follows:

{
  "forgehash1": {
    203: 843,
    43: 3223,
    ...
  },
  "forgehash2": {
    ...
  },
}

Where forgehash1 is the hash of the forge in which the object was imported (for instance https://gitea.gna.org could be hashed into 8423432ab883).

Each level of the F3 hierarchy has such a _identifiers.yml file. Whenever an object is removed, the mapping is also removed.

An implementation was merged with a simpler design. The _identifiers.json file is an array of pairs. It does not allow for multiple forges.