Currently when a commit references an issue, we display that in the issue page the same way that Gitlab itself does
I've always thought that was a naff approach though - good commit messages convey meaning and should add to the context presented in the issue page.
In JIRA I had a workflow set-up so that the commit message and metadata was written into the issue:
If nothing else it means you're not left duplicating effort by having to add a comment to say something the commit message would already have told you.
I'd like GILS to be capable of displaying something similar when commits reference issues
#37 | Issue page may break with "Commit Not Found" when project filtering active |
Activity
21-Apr-22 07:26
assigned to @btasker
21-Apr-22 07:26
changed the description
21-Apr-22 07:35
From a coding perspective, it shouldn't be too much of an issue to adjust processing so that we pull full commit information (via
getCommit()
) for any commit notifications that are detected when preparing to render the page.On a busy issue, though, that's going to be quite a few extra API calls, so it's got the potential to slow things down.
getCommit()
also fetches project details (which we'd already have), so either we need to refactor so that that can be toggled off, or we need to re-prioritise API call caching (#16) to mitigate the latency hit.At the moment we simply mark commits as being type
statechange
, the same as issue mentions etc.Looking at the object gitlab makes available to us at the point that we make that decision:
There isn't really any way (bar string matching) for us to tell it's a commit notification rather than the issue being assigned etc. System messages tend to be quite short, so the overhead of string matching shouldn't be too bad (although it does mean there's a risk of this feature not working with non-english Gitlab installs).
I'd still like to build this, but I think if we do, it has to be config gated.
21-Apr-22 17:23
Redis support is in place, so this should now be feasible to implement
21-Apr-22 18:53
mentioned in commit 1a4eb98fa153594172113404dcf5fba61b8e075a
Message
Show enhanced information for commit mentions in issues (websites/Gitlab-Issue-Listing-Script#30)
Rather than just noting a commit has referenced the issue, commit metadata is provided
21-Apr-22 18:56
mentioned in commit ae378a7b833127cdfd0e138d78dbae159fec1969
Message
Handle relative commit references gracefully (websites/Gitlab-Issue-Listing-Script#30)
Where a notification simply says "mentioned in commit aaaaaa" use the current project path
21-Apr-22 18:57
I've implemented a mechanism to show more information
It doesn't currently note whether a commit is signed/verified - we should probably add that too
21-Apr-22 19:04
mentioned in commit 3050c4f71a3622edcdeab022a6bd6d9214fafb23
Message
Add commit signature status to in-issue notifications (websites/Gitlab-Issue-Listing-Script#30)
This'll show the little green badge if the commit is signed by a trusted key
21-Apr-22 19:09
mentioned in commit 1ef5a25a97d4eef35706bbcc10d26200e00d49a1
Message
Introduce config options to control enhanced commit notifications (websites/Gitlab-Issue-Listing-Script#30)
New options
$enhanced_commit_notifications
: should enhanced notifications be used (default true)$commit_mention_text
: part of the text that Gitlab uses in the system notification. Allows changing for non-english installs22-Apr-22 07:24
mentioned in issue #32
23-Apr-22 10:10
marked this issue as related to #37
23-Apr-22 10:31
mentioned in issue #41