Skip to content

Implement extract_pull_request for GitLab provider#47973

Merged
cole-miller merged 2 commits intozed-industries:mainfrom
littleKitchen:fix/gitlab-merge-request-link
Jan 31, 2026
Merged

Implement extract_pull_request for GitLab provider#47973
cole-miller merged 2 commits intozed-industries:mainfrom
littleKitchen:fix/gitlab-merge-request-link

Conversation

@littleKitchen
Copy link
Contributor

@littleKitchen littleKitchen commented Jan 29, 2026

Fixes #38709

Summary

This implements the extract_pull_request method for GitLab's GitHostingProvider trait, enabling merge request links to be shown in the git blame hover popover.

Implementation

The implementation parses GitLab MR references from commit messages using a regex that matches two common patterns:

  1. Squash merge pattern: message (!123) - When GitLab squash-merges, it appends the MR number in parentheses
  2. Standard merge commit: See merge request group/project!123 - The default merge commit message

Tests Added

  • test_extract_merge_request_from_squash_commit - Validates the (!123) pattern
  • test_extract_merge_request_from_merge_commit - Validates the See merge request pattern
  • test_extract_merge_request_self_hosted - Ensures it works with self-hosted GitLab instances
  • test_extract_merge_request_no_match - Confirms None is returned for non-matching messages

Related

This follows the same pattern as the GitHub provider implementation.

Release Notes

  • Added support for GitLab merge request links in git blame hover popover

@cla-bot
Copy link

cla-bot bot commented Jan 29, 2026

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Yuxuan Che.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email email@example.com
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@zed-community-bot zed-community-bot bot added the first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions label Jan 29, 2026
Fixes zed-industries#38709

This implements the extract_pull_request method for GitLab's
GitHostingProvider trait, enabling merge request links to be shown
in the git blame hover popover.

The implementation parses GitLab MR references from commit messages:
- Squash merge pattern: message (!123)
- Standard merge commit: See merge request group/project!123

Added comprehensive tests covering:
- Squash commit pattern
- Merge commit pattern
- Self-hosted GitLab instances
- Non-matching messages
@littleKitchen littleKitchen force-pushed the fix/gitlab-merge-request-link branch from 6fce59b to f2623cb Compare January 29, 2026 22:28
@cla-bot
Copy link

cla-bot bot commented Jan 29, 2026

We require contributors to sign our Contributor License Agreement, and we don't have @littleKitchen on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

@littleKitchen
Copy link
Contributor Author

@cla-bot check

@cla-bot
Copy link

cla-bot bot commented Jan 29, 2026

We require contributors to sign our Contributor License Agreement, and we don't have @littleKitchen on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

@cla-bot
Copy link

cla-bot bot commented Jan 29, 2026

The cla-bot has been summoned, and re-checked this pull request!

@littleKitchen
Copy link
Contributor Author

@cla-bot check

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Jan 29, 2026
@cla-bot
Copy link

cla-bot bot commented Jan 29, 2026

The cla-bot has been summoned, and re-checked this pull request!

@MrSubidubi MrSubidubi changed the title Implement extract_pull_request for GitLab provider Implement extract_pull_request for GitLab provider Jan 30, 2026
@zed-industries-bot
Copy link
Contributor

zed-industries-bot commented Jan 30, 2026

Warnings
⚠️

This PR is missing release notes.

Please add a "Release Notes" section that describes the change:

Release Notes:

- Added/Fixed/Improved ...

If your change is not user-facing, you can use "N/A" for the entry:

Release Notes:

- N/A

Generated by 🚫 dangerJS against 6ba516d

@cla-bot
Copy link

cla-bot bot commented Jan 30, 2026

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Yuxuan Che.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email email@example.com
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@cla-bot cla-bot bot removed the cla-signed The user has signed the Contributor License Agreement label Jan 30, 2026
@littleKitchen littleKitchen force-pushed the fix/gitlab-merge-request-link branch from 4a24da8 to 6ba516d Compare January 30, 2026 00:47
@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Jan 30, 2026
@cole-miller
Copy link
Member

Thanks!

@cole-miller cole-miller enabled auto-merge (squash) January 31, 2026 21:47
@cole-miller cole-miller merged commit f7fe618 into zed-industries:main Jan 31, 2026
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Merge Request / Commit link not shown for gitlab repositories on git blame hover

3 participants