Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
It would be nice to link back to the issue from the cgit page for a commit.
I couldn't find a discussion or issue that discussed why we are not linking back to the issue from the commit message.
Attached is the example cgit commit-links.sh filter adjusted to link to a drupal.org node.
Comment | File | Size | Author |
---|
Comments
Comment #1
marvil07 CreditAttribution: marvil07 commentedThis sounds like a good idea, here a couple of comments.
Two notes: let's add a boundary character at the start and do not use the string "Issue " in the link, since commit message could contain already that string(so we do not end up with a "Issue Issue #123" link).
I do not really know how cgit expect this, but this seems to execute the regex defined, which is overridden, so we should have one more sed call before overriding the regex variable, right?
Comment #2
joestewart CreditAttribution: joestewart commentedThanks for looking at it. I quickly attached a file to start discussion. I see the regex wasn't right anyway.
changes attached.
Comment #3
joestewart CreditAttribution: joestewart commented1. addressed with starting boundary and Issue.
2. Fellow developer tells me this uses bash concatenation to run both regex lines.
Comment #4
joestewart CreditAttribution: joestewart commentedpatch attached. Didn't know which repo so it is against the cgit repo at http://git.zx2c4.com/cgit/about/
Comment #5
MixologicComment #6
gregglesI'm not sure this is still relevant in the long-term vision for our use of gitlab, but at least the title can be cleaned up/clarified a bit.
Comment #7
marvil07 CreditAttribution: marvil07 as a volunteer commentedIt may not be possible to do it just now.
Gitlab support specific trackers, and have a general custom tracker, but it may not be ready for d.o use.
Official gitlab documentation for custom issue trackers seems to not yet support using ids starting only with
#
, which seems to be reserved for gitlab issue queue.Back to active, since cgit is not the target anymore, and the suggested configuration is therefore not helping anymore.
Comment #8
FeyP CreditAttribution: FeyP as a volunteer and at werk21 commentedIt should work just fine. Under "Project" > "Settings" > "Integrations" > "Project services", click on "Custom Issue Tracker".
As URL set
https://www.drupal.org/node/:id
and the issue ids in commit messages should link back to d.o. Works fine on our own custom GitLab CE instance.Don't know, if there is a setting to configure this globally, which would be better. Also not sure what happens, if you want to use this in parallel with the internal issue tracker of GitLab.
Comment #9
MixologicI just checked this on our dev instance of gitlab, and it does, indeed work the way we'd like it to, which is great.
However, there are two places to make this settings change 1. on an individual project 2. in the "service templates" section of the main admin screen.
My testing on dev shows that if we add drupal.org as an issue tracker in the service templates section, it will copy that configuration to every project. However, it only does that once, and if we need to make changes to that configuration, we'll have to script a change for all individual projects.
Which means, we probably need to make sure to get it right the first time.
The main thing we need to get correct is what we actually name the service template.
Gitlab will make a link that says "Issue in "
As you can see here: https://drupal:drupal@gitlab1.code-dev.devdrupal.org/project/drupalorg I had named the service "Drupal.org" so we get "Issue in Drupal.org" which is weird.
I had fixed it here:
https://drupal:drupal@gitlab1.code-dev.devdrupal.org/project/drupal/tree...
But Im not sure if thats what we actually want. What should that label actually say?
"Issue in Drupal.org Issue Queue"
"Issue in Drupal.org Issue Queues"
"Issue in issue queues on Drupal.org"
Comment #10
gregglesNeeds review for the proposals at the end of #9. I'm fine with any of them personally.
Comment #11
drumm“Issue in Drupal.org issue queue”, without title capitalization, works for me.
Comment #12
MixologicRight on. I went ahead and made this change. But It caused a different problem.
Gitlab's docs on this are terrible.
https://docs.gitlab.com/ee/user/project/integrations/custom_issue_tracke...
Says that the project url and new issues url is unused.
It wouldnt let me leave them blank. So I tried:
https://www.drupal.org/project/:project, and apparently :project is not what I should have used.
There is now a 'drupal.org issue tracker' link on the side of the project pages, all of them linking to
https://www.drupal.org/project/:project
*however*. the issue urls now link back to the drupal.org issue properly. I'll close this issue, and open a new one to cleanup the mess.
Comment #13
MixologicFollow up here:
https://www.drupal.org/project/infrastructure/issues/3046642
Comment #14
MixologicComment #15
marvil07 CreditAttribution: marvil07 as a volunteer commentedIt is great to hear that it worked, thanks!
And it feels even better to close this old ticket :-)