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

Allow alerts to be posted to a different Slack channel #570

Merged
merged 1 commit into from
Oct 23, 2024

Conversation

brucebolt
Copy link
Member

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 where no other value is specified.

Trello card

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
@brucebolt brucebolt marked this pull request as ready for review October 23, 2024 09:51
@brucebolt brucebolt merged commit 7dc4017 into main Oct 23, 2024
10 checks passed
@brucebolt brucebolt deleted the alert-channel branch October 23, 2024 10:15
@@ -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}"
[]
Copy link
Contributor

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? 🤔

Copy link
Member Author

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
Copy link
Contributor

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".

Copy link
Member Author

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.

brucebolt added a commit that referenced this pull request Oct 23, 2024
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants