Skip to content

Commit

Permalink
Update module github.com/slack-go/slack to v0.11.0 (#57)
Browse files Browse the repository at this point in the history
* Update module github.com/slack-go/slack to v0.11.0

* update

Co-authored-by: Renovate Bot <[email protected]>
Co-authored-by: Karl-Johan Grahn <[email protected]>
  • Loading branch information
3 people authored Jun 13, 2022
1 parent f76f7f6 commit b785843
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 24 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.15.0] - 2022-06-13
### Update
- Update module github.com/slack-go/slack to v0.11.0

## [0.14.14] - 2022-05-13
### Update
- Update incident documentation
Expand Down
46 changes: 23 additions & 23 deletions bot/bot.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,13 +211,13 @@ func (h *botHandler) cmdIncident(ctx context.Context, w http.ResponseWriter, cmd
initialChannelLabel := slack.NewTextBlockObject(slack.PlainTextType,
fmt.Sprintf("<#%s>", h.opts.BroadcastChannelID), false, false)
broadcastChOption.InitialOption = slack.NewOptionBlockObject(h.opts.BroadcastChannelID, initialChannelLabel, nil)
broadcastChBlock := slack.NewInputBlock("broadcast_channel", broadcastChLabel, broadcastChOption)
broadcastChBlock.Hint = slack.NewTextBlockObject(slack.PlainTextType,
broadcastChHint := slack.NewTextBlockObject(slack.PlainTextType,
h.opts.Localizer.MustLocalize(&i18n.LocalizeConfig{
DefaultMessage: &i18n.Message{
ID: "BroadcastChannelHint",
Other: "The channels listed are the ones that the bot has been added to as a user"},
}), false, false)
broadcastChBlock := slack.NewInputBlock("broadcast_channel", broadcastChLabel, broadcastChHint, broadcastChOption)

// Only the inputs in input blocks will be included in view_submission’s view.state.values: https://slack.dev/java-slack-sdk/guides/modals
incidentNameText := slack.NewTextBlockObject(slack.PlainTextType,
Expand All @@ -232,14 +232,14 @@ func (h *botHandler) cmdIncident(ctx context.Context, w http.ResponseWriter, cmd
incidentNameElement.DispatchActionConfig = &slack.DispatchActionConfig{
TriggerActionsOn: []string{"on_character_entered"},
}
incidentNameBlock := slack.NewInputBlock("incident_name", incidentNameText, incidentNameElement)
incidentNameBlock.DispatchAction = true
incidentNameBlock.Hint = slack.NewTextBlockObject(slack.PlainTextType,
incidentNameHint := slack.NewTextBlockObject(slack.PlainTextType,
h.opts.Localizer.MustLocalize(&i18n.LocalizeConfig{
DefaultMessage: &i18n.Message{
ID: "IncidentNameHint",
Other: "Incident names may only contain lowercase letters, numbers, hyphens, and underscores, and must be 60 characters or less"},
}), false, false)
incidentNameBlock := slack.NewInputBlock("incident_name", incidentNameText, incidentNameHint, incidentNameElement)
incidentNameBlock.DispatchAction = true

securityIncHeading := slack.NewTextBlockObject(slack.PlainTextType,
h.opts.Localizer.MustLocalize(&i18n.LocalizeConfig{
Expand All @@ -255,7 +255,7 @@ func (h *botHandler) cmdIncident(ctx context.Context, w http.ResponseWriter, cmd
}), false, false)
securityOptionBlockObject := slack.NewOptionBlockObject("yes", securityIncLabel, nil)
securityOptionsBlock := slack.NewCheckboxGroupsBlockElement("security_incident", securityOptionBlockObject)
securityBlock := slack.NewInputBlock("security_incident", securityIncHeading, securityOptionsBlock)
securityBlock := slack.NewInputBlock("security_incident", securityIncHeading, nil, securityOptionsBlock)
securityBlock.Optional = true

responderText := slack.NewTextBlockObject(slack.PlainTextType,
Expand All @@ -265,13 +265,13 @@ func (h *botHandler) cmdIncident(ctx context.Context, w http.ResponseWriter, cmd
Other: "Responder"},
}), false, false)
responderOption := slack.NewOptionsSelectBlockElement(slack.OptTypeUser, responderText, "incident_responder")
responderBlock := slack.NewInputBlock("incident_responder", responderText, responderOption)
responderBlock.Hint = slack.NewTextBlockObject(slack.PlainTextType,
responderHint := slack.NewTextBlockObject(slack.PlainTextType,
h.opts.Localizer.MustLocalize(&i18n.LocalizeConfig{
DefaultMessage: &i18n.Message{
ID: "ResponderHint",
Other: "The responder leads the work of resolving the incident"},
}), false, false)
responderBlock := slack.NewInputBlock("incident_responder", responderText, responderHint, responderOption)

commanderText := slack.NewTextBlockObject(slack.PlainTextType,
h.opts.Localizer.MustLocalize(&i18n.LocalizeConfig{
Expand All @@ -280,13 +280,13 @@ func (h *botHandler) cmdIncident(ctx context.Context, w http.ResponseWriter, cmd
Other: "Commander"},
}), false, false)
commanderOption := slack.NewOptionsSelectBlockElement(slack.OptTypeUser, commanderText, "incident_commander")
commanderBlock := slack.NewInputBlock("incident_commander", commanderText, commanderOption)
commanderBlock.Hint = slack.NewTextBlockObject(slack.PlainTextType,
commanderHint := slack.NewTextBlockObject(slack.PlainTextType,
h.opts.Localizer.MustLocalize(&i18n.LocalizeConfig{
DefaultMessage: &i18n.Message{
ID: "CommanderHint",
Other: "The incident commander coordinates, communicates, and controls the response"},
}), false, false)
commanderBlock := slack.NewInputBlock("incident_commander", commanderText, commanderHint, commanderOption)

envTxt := slack.NewTextBlockObject(slack.PlainTextType,
h.opts.Localizer.MustLocalize(&i18n.LocalizeConfig{
Expand All @@ -300,7 +300,7 @@ func (h *botHandler) cmdIncident(ctx context.Context, w http.ResponseWriter, cmd
}
envOptions := createOptionBlockObjects(envs, "")
envOptionsBlock := slack.NewCheckboxGroupsBlockElement("incident_environment_affected", envOptions...)
environmentBlock := slack.NewInputBlock("incident_environment_affected", envTxt, envOptionsBlock)
environmentBlock := slack.NewInputBlock("incident_environment_affected", envTxt, nil, envOptionsBlock)

regionTxt := slack.NewTextBlockObject(slack.PlainTextType,
h.opts.Localizer.MustLocalize(&i18n.LocalizeConfig{
Expand All @@ -314,7 +314,7 @@ func (h *botHandler) cmdIncident(ctx context.Context, w http.ResponseWriter, cmd
}
regionOptions := createOptionBlockObjects(regions, "")
regionOptionsBlock := slack.NewCheckboxGroupsBlockElement("incident_region_affected", regionOptions...)
regionBlock := slack.NewInputBlock("incident_region_affected", regionTxt, regionOptionsBlock)
regionBlock := slack.NewInputBlock("incident_region_affected", regionTxt, nil, regionOptionsBlock)

severityTxt := slack.NewTextBlockObject(slack.PlainTextType,
h.opts.Localizer.MustLocalize(&i18n.LocalizeConfig{
Expand All @@ -328,7 +328,7 @@ func (h *botHandler) cmdIncident(ctx context.Context, w http.ResponseWriter, cmd
}
severityOptions := createOptionBlockObjects(severityLevels, "")
severityOptionsBlock := slack.NewRadioButtonsBlockElement("incident_severity_level", severityOptions...)
severityBlock := slack.NewInputBlock("incident_severity_level", severityTxt, severityOptionsBlock)
severityBlock := slack.NewInputBlock("incident_severity_level", severityTxt, nil, severityOptionsBlock)

impactTxt := slack.NewTextBlockObject(slack.PlainTextType,
h.opts.Localizer.MustLocalize(&i18n.LocalizeConfig{
Expand All @@ -342,7 +342,7 @@ func (h *botHandler) cmdIncident(ctx context.Context, w http.ResponseWriter, cmd
}
impactOptions := createOptionBlockObjects(impactLevels, "")
impactOptionsBlock := slack.NewRadioButtonsBlockElement("incident_impact_level", impactOptions...)
impactBlock := slack.NewInputBlock("incident_impact_level", impactTxt, impactOptionsBlock)
impactBlock := slack.NewInputBlock("incident_impact_level", impactTxt, nil, impactOptionsBlock)

summaryText := slack.NewTextBlockObject(slack.PlainTextType,
h.opts.Localizer.MustLocalize(&i18n.LocalizeConfig{
Expand All @@ -354,7 +354,7 @@ func (h *botHandler) cmdIncident(ctx context.Context, w http.ResponseWriter, cmd
// Set an arbitrary max length to avoid prose summary
summaryElement.MaxLength = 200
summaryElement.Multiline = true
summaryBlock := slack.NewInputBlock("incident_summary", summaryText, summaryElement)
summaryBlock := slack.NewInputBlock("incident_summary", summaryText, nil, summaryElement)

inviteeLabel := slack.NewTextBlockObject(slack.PlainTextType,
h.opts.Localizer.MustLocalize(&i18n.LocalizeConfig{
Expand All @@ -363,7 +363,7 @@ func (h *botHandler) cmdIncident(ctx context.Context, w http.ResponseWriter, cmd
Other: "Invitees"},
}), false, false)
inviteeOption := slack.NewOptionsSelectBlockElement(slack.MultiOptTypeUser, inviteeLabel, "incident_invitees")
inviteeBlock := slack.NewInputBlock("incident_invitees", inviteeLabel, inviteeOption)
inviteeBlock := slack.NewInputBlock("incident_invitees", inviteeLabel, nil, inviteeOption)
inviteeBlock.Optional = true

blocks := slack.Blocks{
Expand Down Expand Up @@ -469,13 +469,13 @@ func (h *botHandler) cmdResolveIncident(ctx context.Context, w http.ResponseWrit
initialChannelLabel := slack.NewTextBlockObject(slack.PlainTextType,
fmt.Sprintf("<#%s>", h.opts.BroadcastChannelID), false, false)
broadcastChOption.InitialOption = slack.NewOptionBlockObject(h.opts.BroadcastChannelID, initialChannelLabel, nil)
broadcastChBlock := slack.NewInputBlock("broadcast_channel", broadcastChLabel, broadcastChOption)
broadcastChBlock.Hint = slack.NewTextBlockObject(slack.PlainTextType,
broadcastChHint := slack.NewTextBlockObject(slack.PlainTextType,
h.opts.Localizer.MustLocalize(&i18n.LocalizeConfig{
DefaultMessage: &i18n.Message{
ID: "BroadcastChannelHint",
Other: "The channels listed are the ones that the bot has been added to as a user"},
}), false, false)
broadcastChBlock := slack.NewInputBlock("broadcast_channel", broadcastChLabel, broadcastChHint, broadcastChOption)

incChanText := slack.NewTextBlockObject(slack.PlainTextType,
h.opts.Localizer.MustLocalize(&i18n.LocalizeConfig{
Expand All @@ -490,14 +490,14 @@ func (h *botHandler) cmdResolveIncident(ctx context.Context, w http.ResponseWrit
ExcludeExternalSharedChannels: false,
ExcludeBotUsers: false,
}
incChanBlock := slack.NewInputBlock("incident_channel", incChanText, incChanOption)
incChanBlock.DispatchAction = true
incChanBlock.Hint = slack.NewTextBlockObject(slack.PlainTextType,
incChanHint := slack.NewTextBlockObject(slack.PlainTextType,
h.opts.Localizer.MustLocalize(&i18n.LocalizeConfig{
DefaultMessage: &i18n.Message{
ID: "IncidentChannelNamePattern",
Other: "Choose a channel that starts with 'inc_'"},
}), false, false)
incChanBlock := slack.NewInputBlock("incident_channel", incChanText, incChanHint, incChanOption)
incChanBlock.DispatchAction = true

archiveTxt := slack.NewTextBlockObject(slack.PlainTextType,
h.opts.Localizer.MustLocalize(&i18n.LocalizeConfig{
Expand All @@ -517,7 +517,7 @@ func (h *botHandler) cmdResolveIncident(ctx context.Context, w http.ResponseWrit
Other: "No"},
})}, "")
archiveOptionsBlock := slack.NewRadioButtonsBlockElement("archive_choice", archiveOptions...)
archiveBlock := slack.NewInputBlock("archive_choice", archiveTxt, archiveOptionsBlock)
archiveBlock := slack.NewInputBlock("archive_choice", archiveTxt, nil, archiveOptionsBlock)

resolutionLabel := slack.NewTextBlockObject(slack.PlainTextType,
h.opts.Localizer.MustLocalize(&i18n.LocalizeConfig{
Expand All @@ -528,7 +528,7 @@ func (h *botHandler) cmdResolveIncident(ctx context.Context, w http.ResponseWrit
resolutionElement := slack.NewPlainTextInputBlockElement(resolutionLabel, "resolution")
resolutionElement.MaxLength = 200
resolutionElement.Multiline = true
resolutionBlock := slack.NewInputBlock("resolution", resolutionLabel, resolutionElement)
resolutionBlock := slack.NewInputBlock("resolution", resolutionLabel, nil, resolutionElement)

blocks := slack.Blocks{
BlockSet: []slack.Block{
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/nicksnyder/go-i18n/v2 v2.1.2
github.com/prometheus/client_golang v1.12.1
github.com/rs/zerolog v1.26.1
github.com/slack-go/slack v0.10.2
github.com/slack-go/slack v0.11.0
github.com/spf13/cobra v1.3.0
github.com/spf13/viper v1.10.1
github.com/stretchr/testify v1.7.1
Expand Down
3 changes: 3 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ=
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
Expand Down Expand Up @@ -364,6 +365,8 @@ github.com/slack-go/slack v0.10.1 h1:BGbxa0kMsGEvLOEoZmYs8T1wWfoZXwmQFBb6FgYCXUA
github.com/slack-go/slack v0.10.1/go.mod h1:wWL//kk0ho+FcQXcBTmEafUI5dz4qz5f4mMk8oIkioQ=
github.com/slack-go/slack v0.10.2 h1:KMN/h2sgUninHXvQI8PrR/PHBUuWp2NPvz2Kr66tki4=
github.com/slack-go/slack v0.10.2/go.mod h1:5FLdBRv7VW/d9EBxx/eEktOptWygbA9K2QK/KW7ds1s=
github.com/slack-go/slack v0.11.0 h1:sBBjQz8LY++6eeWhGJNZpRm5jvLRNnWBFZ/cAq58a6k=
github.com/slack-go/slack v0.11.0/go.mod h1:hlGi5oXA+Gt+yWTPP0plCdRKmjsDxecdHxYQdlMQKOw=
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4=
github.com/spf13/afero v1.6.0 h1:xoax2sJ2DT8S8xA2paPFjDCScCNeWsg75VG0DLRreiY=
Expand Down

0 comments on commit b785843

Please sign in to comment.