zed/crates/git_hosting_providers
littleKitchen f7fe6181cd
Implement extract_pull_request for GitLab provider (#47973)
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
2026-01-31 21:56:34 +00:00
..
src Implement extract_pull_request for GitLab provider (#47973) 2026-01-31 21:56:34 +00:00
Cargo.toml git: Improve self-hosted provider support and Bitbucket integration (#42343) 2025-12-08 13:32:14 -05:00
LICENSE-GPL Add a registry for GitHostingProviders (#11470) 2024-05-06 21:24:48 -04:00