Michael Muré (MichaelMure) opened
Now that the importer is working (:tada:), an exporter would be neat.
It will probably need https://github.com/MichaelMure/git-bug/issues/55 to be resolved though.
Labels: enhancement
Michael Muré (MichaelMure) opened
Now that the importer is working (:tada:), an exporter would be neat.
It will probably need https://github.com/MichaelMure/git-bug/issues/55 to be resolved though.
Michael Muré (MichaelMure)
added label
enhancement
anarcat (anarcat) commented
this is a followup to #7 which does the opposite, of course.
Cristian Filipov (cfilipov) commented
Looking at the GitHub API I don't see any way to set the created timestamp on an issue using either the rest api or graphql. This means that unfortunately timestamps of all issues exported to github will not match what's in git-bug. This may also be a problem for syncing, which time stamp is treated as authoritative?
Michael Muré (MichaelMure) commented
@cfilipov It won't be a problem for syncing.
The Github importer is tagging operation in git-bug with the corresponding id on Github (for example: https://github.com/MichaelMure/git-bug/blob/master/bridge/github/import.go#L134). When doing an import again, the importer will look for this tag to recognize an already imported event and import what is missing.
For the exporter it's a little trickier because you can't tag an already persisted operation, the data model is immutable. What is possible though is to create a new operation (let's call it SetMetadataOperation) that will tag retroactively another operation (the same way EditCommentOperation operate on a previous comment). When a bug is compiled into a snapshot, this new operation will append the new tag into a previously defined operation.
The Github exporter will replicate the operation stored in git-bug through the Github API and then add in git-bug a series of SetMetadataOperation to tag retroactively the operation with the corresponding Github id. When doing another export, only the operation that are not tagged will be replicated on Github.
So yes, the timestamp won't match exactly but I don't think that it will be that much of a problem, especially if the exporter is ran automatically after each edit.
Michael Muré (MichaelMure) commented
Alternatively, the exporter could also use the NoOpOperation to store arbitrary metadata in an issue timeline without doing any changes.
Michael Muré (MichaelMure) commented
@cfilipov Btw, if you want to give it a try you are more than welcome, I probably won't have time to work on it for a while as I just started a new job.
Michael Muré (MichaelMure) commented
This is @A-Hilaly 's task now, as part of the Summer of Code :tada: :tada:
Michael Muré (MichaelMure) closed the bug
Michael Muré (MichaelMure) commented (edited)
The exporter just landed in master, which means you can use git-bug as an offline remote for github !
There is still a few things to take care of to have a very robust bridge (#164 #167 #175 #176 ), but most of the job is done