Skip to content

Commit

Permalink
Use latest azuredevops package
Browse files Browse the repository at this point in the history
  • Loading branch information
jpreese committed Apr 11, 2020
1 parent 39cd5b2 commit 515cbaa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ require (
github.com/imdario/mergo v0.3.5 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/magiconair/properties v1.7.3 // indirect
github.com/mcdafydd/go-azuredevops v0.11.0
github.com/mcdafydd/go-azuredevops v0.11.1
github.com/microcosm-cc/bluemonday v1.0.1
github.com/mitchellh/colorstring v0.0.0-20150917214807-8631ce90f286
github.com/mitchellh/go-homedir v1.0.0
Expand Down
5 changes: 2 additions & 3 deletions server/events/vcs/azuredevops_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"net/http"
"net/url"
"path/filepath"
"strconv"
"strings"
"time"

Expand Down Expand Up @@ -177,7 +176,7 @@ func (g *AzureDevopsClient) PullIsMergeable(repo models.Repo, pull models.PullRe
}

projectID := *adPull.Repository.Project.ID
artifactID := g.Client.PolicyEvaluations.GetPullRequestArtifactID(projectID, strconv.Itoa(pull.Num))
artifactID := g.Client.PolicyEvaluations.GetPullRequestArtifactID(projectID, pull.Num)
policyEvaluations, _, err := g.Client.PolicyEvaluations.List(g.ctx, owner, project, artifactID, &azuredevops.PolicyEvaluationsListOptions{})
if err != nil {
return false, fmt.Errorf("list policy evaluations: %w", err)
Expand All @@ -195,7 +194,7 @@ func (g *AzureDevopsClient) PullIsMergeable(repo models.Repo, pull models.PullRe
continue
}

if *policyEvaluation.Configuration.IsBlocking && *policyEvaluation.Status != "approved" {
if *policyEvaluation.Configuration.IsBlocking && *policyEvaluation.Status != azuredevops.PolicyEvaluationApproved {
return false, nil
}
}
Expand Down

0 comments on commit 515cbaa

Please sign in to comment.