Skip to content

Commit

Permalink
Merge pull request #545 from kenske/rename-status-checks
Browse files Browse the repository at this point in the history
Renamed status checks from <action>/atlantis to atlantis/<action>
  • Loading branch information
lkysow authored Mar 22, 2019
2 parents a6c819d + c9e3909 commit b9a0469
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion e2e/e2e.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ func getAtlantisStatus(t *E2ETester, branchName string) (string, error) {
}

for _, status := range combinedStatus.Statuses {
if status.GetContext() == "plan/atlantis" {
if status.GetContext() == "atlantis/plan" {
return status.GetState(), nil
}
}
Expand Down
6 changes: 3 additions & 3 deletions server/events/commit_status_updater.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ type DefaultCommitStatusUpdater struct {
}

func (d *DefaultCommitStatusUpdater) UpdateCombined(repo models.Repo, pull models.PullRequest, status models.CommitStatus, command models.CommandName) error {
src := fmt.Sprintf("%s/atlantis", command.String())
src := fmt.Sprintf("atlantis/%s", command.String())
var descripWords string
switch status {
case models.PendingCommitStatus:
Expand All @@ -58,7 +58,7 @@ func (d *DefaultCommitStatusUpdater) UpdateCombined(repo models.Repo, pull model
}

func (d *DefaultCommitStatusUpdater) UpdateCombinedCount(repo models.Repo, pull models.PullRequest, status models.CommitStatus, command models.CommandName, numSuccess int, numTotal int) error {
src := fmt.Sprintf("%s/atlantis", command.String())
src := fmt.Sprintf("atlantis/%s", command.String())
cmdVerb := "planned"
if command == models.ApplyCommand {
cmdVerb = "applied"
Expand All @@ -71,7 +71,7 @@ func (d *DefaultCommitStatusUpdater) UpdateProject(ctx models.ProjectCommandCont
if projectID == "" {
projectID = fmt.Sprintf("%s/%s", ctx.RepoRelDir, ctx.Workspace)
}
src := fmt.Sprintf("%s/atlantis: %s", cmdName.String(), projectID)
src := fmt.Sprintf("atlantis/%s: %s", cmdName.String(), projectID)
var descripWords string
switch status {
case models.PendingCommitStatus:
Expand Down
10 changes: 5 additions & 5 deletions server/events/commit_status_updater_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func TestUpdateCombined(t *testing.T) {
err := s.UpdateCombined(models.Repo{}, models.PullRequest{}, c.status, c.command)
Ok(t, err)

expSrc := fmt.Sprintf("%s/atlantis", c.command)
expSrc := fmt.Sprintf("atlantis/%s", c.command)
client.VerifyWasCalledOnce().UpdateStatus(models.Repo{}, models.PullRequest{}, c.status, expSrc, c.expDescrip, "")
})
}
Expand Down Expand Up @@ -137,7 +137,7 @@ func TestUpdateCombinedCount(t *testing.T) {
err := s.UpdateCombinedCount(models.Repo{}, models.PullRequest{}, c.status, c.command, c.numSuccess, c.numTotal)
Ok(t, err)

expSrc := fmt.Sprintf("%s/atlantis", c.command)
expSrc := fmt.Sprintf("atlantis/%s", c.command)
client.VerifyWasCalledOnce().UpdateStatus(models.Repo{}, models.PullRequest{}, c.status, expSrc, c.expDescrip, "")
})
}
Expand All @@ -157,13 +157,13 @@ func TestDefaultCommitStatusUpdater_UpdateProjectSrc(t *testing.T) {
projectName: "name",
repoRelDir: ".",
workspace: "default",
expSrc: "plan/atlantis: name",
expSrc: "atlantis/plan: name",
},
{
projectName: "",
repoRelDir: "dir1/dir2",
workspace: "workspace",
expSrc: "plan/atlantis: dir1/dir2/workspace",
expSrc: "atlantis/plan: dir1/dir2/workspace",
},
}

Expand Down Expand Up @@ -239,7 +239,7 @@ func TestDefaultCommitStatusUpdater_UpdateProject(t *testing.T) {
c.status,
"url")
Ok(t, err)
client.VerifyWasCalledOnce().UpdateStatus(models.Repo{}, models.PullRequest{}, c.status, fmt.Sprintf("%s/atlantis: ./default", c.cmd.String()), c.expDescrip, "url")
client.VerifyWasCalledOnce().UpdateStatus(models.Repo{}, models.PullRequest{}, c.status, fmt.Sprintf("atlantis/%s: ./default", c.cmd.String()), c.expDescrip, "url")
})
}
}
2 changes: 1 addition & 1 deletion server/events/vcs/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type Client interface {
PullIsMergeable(repo models.Repo, pull models.PullRequest) (bool, error)
// UpdateStatus updates the commit status to state for pull. src is the
// source of this status. This should be relatively static across runs,
// ex. plan/atlantis or apply/atlantis.
// ex. atlantis/plan or atlantis/apply.
// description is a description of this particular status update and can
// change across runs.
// url is an optional link that users should click on for more information
Expand Down

0 comments on commit b9a0469

Please sign in to comment.