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
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
2 changes: 1 addition & 1 deletion lib/team_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
10 changes: 5 additions & 5 deletions spec/team_builder_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.

[{ "app_name" => "Brazil", "team" => "#govuk-jaguars" },
{ "app_name" => "rainforest", "team" => "#govuk-wildcats-team" },
{ "app_name" => "savanna", "team" => "#govuk-wildcats-team" },
{ "app_name" => "grassland", "team" => "#govuk-wildcats-team" },
{ "app_name" => "generic-repo", "team" => "govuk-generic-team" }]
[{ "app_name" => "Brazil", "alerts_team" => "#govuk-jaguars" },
{ "app_name" => "rainforest", "alerts_team" => "#govuk-wildcats-team" },
{ "app_name" => "savanna", "alerts_team" => "#govuk-wildcats-team" },
{ "app_name" => "grassland", "alerts_team" => "#govuk-wildcats-team" },
{ "app_name" => "generic-repo", "alerts_team" => "govuk-generic-team" }]
end

before do
Expand Down