project Websites / Gitlab Issue Listing Script avatar

websites/Gitlab-Issue-Listing-Script#41: More relative reference pain



Issue Information

Issue Type: issue
Status: closed
Reported By: btasker

Milestone: v0.4
Created: 23-Apr-22 10:20



Description

In #17 we dealt with relative references and addressed the use of short references (e.g. #41) in commits and issues.

However, it turns out Gitlab has another form of relative reference.

Normally, if you reference an issue from a commit in another project the reference pushed into the issue will look something like group/project@<commit ref>

But, if both projects are in the same group, Gitlab will omit the project name giving you a reference of the form project@<commit ref>.

Currently that'll lead to us building an incomplete URL as we won't include a project name.



Toggle State Changes

Activity


changed the description

There are actually 2 sides to this.

  • Enhanced commit notifications (#30) need to be able to retrieve the right commit from the API
  • Embedded links to the commit need to use the correct path

The first is more important as it can break the display of issue pages (because of the incorrect path we'll return a 404 after failing to retrieve the commit)

Commit ce373d99 fixes display of enhanced commit notifications, although we still need to fix the second item so that links out to the commit are valid.

Although I've not seen an example, I guess we're going to need to implement similar support for issue mentions (we'll probably be able to see an example once we can access the commit itself)

verified

mentioned in commit 1413e66b9b7c886ad3f9a478859324db4c16c167

Commit: 1413e66b9b7c886ad3f9a478859324db4c16c167 
Author: B Tasker                            
                            
Date: 2022-04-23T11:50:05.000+01:00 

Message

Handle building commit urls from relative references for websites/Gitlab-Issue-Listing-Script#41

This implements support for linking back to commits where Gitlab's only given us a relative (i.e. just commit ref) or partial (just project name) reference

+25 -1 (26 lines changed)

So, if I temporarily mention privacy-sensitive-analytics#9 we should get partial issue reference

Stupid smart commit closed my issue... reopening

verified

mentioned in commit 0bb1c9a480051160b32b16633baaaa291ffe390a

Commit: 0bb1c9a480051160b32b16633baaaa291ffe390a 
Author: B Tasker                            
                            
Date: 2022-04-23T11:58:06.000+01:00 

Message

Handle partial issue references for websites/Gitlab-Issue-Listing-Script#41

This change means that we can handle partially qualified references (those missing the group).

+13 -0 (13 lines changed)

This looks to be working, closing.