It seems we need to maintain a bare repository (clone if it not exists and update on demand) and use a command like git --git-dir <mirror-dir> describe --long <commit>.
I would fallback to the just commit without git describe --long <commit> if something going wrong with the mirror or if a commit is not found.
Commenting issue flow
It would be easier to implement the feature for the flow when a documentation comment is placed within a commit: we already know a commit hash.
However it is possible too for comments placed within an issue using issue events:
I would traverse over a constant number of pages to find a "closed" event and fallback to just commit without git describe --long <commit> if such event is not found or if commit_id is null.
NB: It is not possible to directly fetch such event, because its event_id is not the same number as id field within a webhook event.
I propose to give
git describe --long <commit>
output as part of a filed issue.The relevant code:
https://github.com/tarantool/docbot/blob/1211606da71b4dae7c59b97e79ac821a7979446c/tarantoolbot.py#L115-L116
I would change it like so when:
It should be useful for https://github.com/tarantool/doc/issues/1415
Details
Manage repository mirror
It seems we need to maintain a bare repository (clone if it not exists and update on demand) and use a command like
git --git-dir <mirror-dir> describe --long <commit>
.I would fallback to the just commit without
git describe --long <commit>
if something going wrong with the mirror or if a commit is not found.Commenting issue flow
It would be easier to implement the feature for the flow when a documentation comment is placed within a commit: we already know a commit hash.
However it is possible too for comments placed within an issue using issue events:
I would traverse over a constant number of pages to find a "closed" event and fallback to just commit without
git describe --long <commit>
if such event is not found or ifcommit_id
isnull
.NB: It is not possible to directly fetch such event, because its
event_id
is not the same number asid
field within a webhook event.