-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support blob link without line hash #320
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a test case for this patch.
See followings.
gitpanda/gitlab/url_parser_test.go
Lines 519 to 572 in 39c589b
{ | |
name: "Blob URL (single line)", | |
args: args{ | |
url: "http://example.com/diaspora/diaspora-project-site/blob/master/gitlabci-templates/continuous_bundle_update.yml#L4", | |
}, | |
want: &Page{ | |
Title: "gitlabci-templates/continuous_bundle_update.yml:4", | |
Description: "```\n variables:\n```", | |
AuthorName: "", | |
AuthorAvatarURL: "", | |
AvatarURL: "http://example.com/uploads/project/avatar/3/uploads/avatar.png", | |
CanTruncateDescription: false, | |
FooterTitle: "diaspora/diaspora-project-site", | |
FooterURL: "http://example.com/diaspora/diaspora-project-site", | |
FooterTime: nil, | |
Color: "", | |
}, | |
}, | |
{ | |
name: "Blob URL (single line & including /-/)", | |
args: args{ | |
url: "http://example.com/diaspora/diaspora-project-site/-/blob/master/gitlabci-templates/continuous_bundle_update.yml#L4", | |
}, | |
want: &Page{ | |
Title: "gitlabci-templates/continuous_bundle_update.yml:4", | |
Description: "```\n variables:\n```", | |
AuthorName: "", | |
AuthorAvatarURL: "", | |
AvatarURL: "http://example.com/uploads/project/avatar/3/uploads/avatar.png", | |
CanTruncateDescription: false, | |
FooterTitle: "diaspora/diaspora-project-site", | |
FooterURL: "http://example.com/diaspora/diaspora-project-site", | |
FooterTime: nil, | |
Color: "", | |
}, | |
}, | |
{ | |
name: "Blob URL (multiple line)", | |
args: args{ | |
url: "http://example.com/diaspora/diaspora-project-site/blob/master/gitlabci-templates/continuous_bundle_update.yml#L4-9", | |
}, | |
want: &Page{ | |
Title: "gitlabci-templates/continuous_bundle_update.yml:4-9", | |
Description: "```\n variables:\n CACHE_VERSION: \"v1\"\n GIT_EMAIL: \"[email protected]\"\n GIT_USER: \"GitLab CI\"\n LABELS: \"bundle update\"\n OPTIONS: \"\"\n```", | |
AuthorName: "", | |
AuthorAvatarURL: "", | |
AvatarURL: "http://example.com/uploads/project/avatar/3/uploads/avatar.png", | |
CanTruncateDescription: false, | |
FooterTitle: "diaspora/diaspora-project-site", | |
FooterURL: "http://example.com/diaspora/diaspora-project-site", | |
FooterTime: nil, | |
Color: "", | |
}, | |
}, |
@sue445 sorry I didn't think test cases for blob fetcher covered in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Thank you for creating this great tool!
Currently, gitpanda does not support a blob link without Line Hash.
But GitHub integration on Slack supports a link without Line Hash like this.
So I think it would be great if gitpanda can support blob link without line hash like GitHub!