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

Hide projects without locked phases on describe-locks #1142

Merged
merged 1 commit into from
Sep 11, 2024
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
14 changes: 9 additions & 5 deletions slack.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,15 +314,19 @@ func (s *SlackListener) describeLocks() slack.MsgOption {

var buf strings.Builder
for _, pj := range projects {
project := pj.Name
envs := pj.Phases
buf.WriteString(project)
buf.WriteString("\n")
for _, lock := range envs {
var wroteProjectHeader bool
for _, lock := range pj.Phases {
if !lock.Locked {
continue
}

if !wroteProjectHeader {
project := pj.Name
buf.WriteString(project)
buf.WriteString("\n")
wroteProjectHeader = true
}

env := lock.Name
buf.WriteString(" ")
buf.WriteString(env)
Expand Down
1 change: 0 additions & 1 deletion slack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,6 @@ myproject2
}))
require.Equal(t, `myproject1
staging: Locked (by user2, for deployment of revision b)
myproject2
`, nextMessage().Text())
}

Expand Down
Loading