Release (#490)
Fix: Jumping to renamed files (#484) Fix: Store reviewer data before creating comment popup (#476) Fix: Make publishing drafts more robust (#483) Fix: Swap file_name and old_file_name in reviewer data (#485) --------- Co-authored-by: Jakub F. Bortlík <jakub.bortlik@proton.me>
This commit is contained in:
committed by
GitHub
parent
9f898aa1a8
commit
a260f648fe
@@ -68,8 +68,8 @@ func NewClient() (*Client, error) {
|
||||
|
||||
retryClient := retryablehttp.NewClient()
|
||||
retryClient.HTTPClient.Transport = tr
|
||||
retryClient.RetryMax = 0
|
||||
gitlabOptions = append(gitlabOptions, gitlab.WithHTTPClient(retryClient.HTTPClient))
|
||||
gitlabOptions = append(gitlabOptions, gitlab.WithoutRetries())
|
||||
|
||||
client, err := gitlab.NewClient(pluginOptions.AuthToken, gitlabOptions...)
|
||||
|
||||
|
||||
@@ -42,13 +42,19 @@ type RequestWithPosition interface {
|
||||
func buildCommentPosition(commentWithPositionData RequestWithPosition) *gitlab.PositionOptions {
|
||||
positionData := commentWithPositionData.GetPositionData()
|
||||
|
||||
// If the file has been renamed, then this is a relevant part of the payload
|
||||
oldFileName := positionData.OldFileName
|
||||
if oldFileName == "" {
|
||||
oldFileName = positionData.FileName
|
||||
}
|
||||
|
||||
opt := &gitlab.PositionOptions{
|
||||
PositionType: &positionData.Type,
|
||||
StartSHA: &positionData.StartCommitSHA,
|
||||
HeadSHA: &positionData.HeadCommitSHA,
|
||||
BaseSHA: &positionData.BaseCommitSHA,
|
||||
NewPath: &positionData.FileName,
|
||||
OldPath: &positionData.OldFileName,
|
||||
OldPath: &oldFileName,
|
||||
NewLine: positionData.NewLine,
|
||||
OldLine: positionData.OldLine,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user