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

Provide four-digit version number #6

Open
Totktonada opened this issue Aug 20, 2020 · 0 comments
Open

Provide four-digit version number #6

Totktonada opened this issue Aug 20, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@Totktonada
Copy link
Member

I propose to give git describe --long <commit> output as part of a filed issue.

The relevant code:

docbot/tarantoolbot.py

Lines 115 to 116 in 1211606

description = '{}\nRequested by @{} in {}.'.format(description, author,
src_url)

I would change it like so when:

description = '{}\nRequested by @{} in [{}]({}).'.format(
    description, author, git_describe, src_url)

It should be useful for tarantool/doc#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:

$ curl -fsS 'https://api.github.com/repos/tarantool/tarantool/issues/5223/events?page=1' | \
  jq --raw-output '.[] | select(.event=="closed") | .commit_id'
29ec628918bd7279de08e47becc070420775c2eb

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.

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

No branches or pull requests

3 participants