Skip to content
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

Azure Devops: Improve comment formatting #863

Merged
merged 1 commit into from
Nov 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ require (
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5
gopkg.in/go-playground/assert.v1 v1.2.1 // indirect
gopkg.in/go-playground/validator.v9 v9.20.2
gopkg.in/russross/blackfriday.v2 v2.0.0
gopkg.in/yaml.v2 v2.2.2
gotest.tools v2.2.0+incompatible // indirect
)
8 changes: 1 addition & 7 deletions server/events/vcs/azuredevops_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"github.com/pkg/errors"
"github.com/runatlantis/atlantis/server/events/models"
"github.com/runatlantis/atlantis/server/events/vcs/common"
"gopkg.in/russross/blackfriday.v2"
)

// AzureDevopsClient represents an Azure DevOps VCS client
Expand Down Expand Up @@ -84,9 +83,6 @@ func (g *AzureDevopsClient) GetModifiedFiles(repo models.Repo, pull models.PullR
//
// If comment length is greater than the max comment length we split into
// multiple comments.
// Azure DevOps doesn't support markdown in Work Item comments, but it will
// convert text to HTML. We use the blackfriday library to convert Atlantis
// comment markdown before submission.
func (g *AzureDevopsClient) CreateComment(repo models.Repo, pullNum int, comment string) error {
sepEnd := "\n```\n</details>" +
"\n<br>\n\n**Warning**: Output length greater than max comment size. Continued in next comment."
Expand All @@ -102,14 +98,12 @@ func (g *AzureDevopsClient) CreateComment(repo models.Repo, pullNum int, comment
owner, project, repoName := SplitAzureDevopsRepoFullName(repo.FullName)

for _, c := range comments {
input := blackfriday.Run([]byte(c))
s := string(input)
commentType := "text"
parentCommentID := 0

prComment := azuredevops.Comment{
CommentType: &commentType,
Content: &s,
Content: &c,
ParentCommentID: &parentCommentID,
}
prComments := []*azuredevops.Comment{&prComment}
Expand Down
8 changes: 0 additions & 8 deletions vendor/gopkg.in/russross/blackfriday.v2/.gitignore

This file was deleted.

18 changes: 0 additions & 18 deletions vendor/gopkg.in/russross/blackfriday.v2/.travis.yml

This file was deleted.

29 changes: 0 additions & 29 deletions vendor/gopkg.in/russross/blackfriday.v2/LICENSE.txt

This file was deleted.

283 changes: 0 additions & 283 deletions vendor/gopkg.in/russross/blackfriday.v2/README.md

This file was deleted.

Loading