-
Notifications
You must be signed in to change notification settings - Fork 19
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
Allow alerts to be posted to a different Slack channel #570
Conversation
At the moment, PR review reinders are sent to the Slack channel of the team who own the application. Some teams may wish to have automated alerting sent to a different channel. Therefore updating to use the `alerts_team` value instead of the `team` value. By default, `govuk-developer-docs` falls back to the `team` value [1] where no other value is specified. 1:https://github.com/alphagov/govuk-developer-docs/blob/b5241f5c2202330ac8488fce3ce1fe8c681bb472/app/repo.rb#L145-L146
@@ -96,7 +96,7 @@ def govuk_json | |||
end | |||
|
|||
def govuk_team_repos(team_channel) | |||
@govuk_data.select { |repos| repos["team"] == team_channel }.map { |repo| repo["app_name"] } | |||
@govuk_data.select { |repos| repos["alerts_team"] == team_channel }.map { |repo| repo["app_name"] } | |||
rescue StandardError => e | |||
puts "Error fetching govuk team repos (#{team_channel}): #{e.message}" | |||
[] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to update the is_govuk_team?
for consistency? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think we do. I've updated that in #571.
@@ -11,11 +11,11 @@ | |||
let(:uri) { URI("https://docs.publishing.service.gov.uk/repos.json") } | |||
|
|||
let(:repos) do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to have some tests for a scenario when "team" is not the same as "alerts_team".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need any tests here, since govuk-developer-docs will always return a value for alerts_team
.
In #570, we added the ability to post alerts to a different Slack channel to the main team. Changing the hash key in this method was missed.
At the moment, PR review reinders are sent to the Slack channel of the team who own the application.
Some teams may wish to have automated alerting sent to a different channel. Therefore updating to use the
alerts_team
value instead of theteam
value.By default,
govuk-developer-docs
falls back to theteam
value where no other value is specified.Trello card