Skip to content

Commit

Permalink
Merge pull request #478 from alphagov/small-improvements
Browse files Browse the repository at this point in the history
Small improvements
MuriloDalRi authored Nov 29, 2023

Verified

This commit was signed with the committer’s verified signature.
2 parents f4ef196 + a1c80a1 commit 1d4300f
Showing 6 changed files with 11 additions and 16 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/afternoon_seal.yml
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup ruby
uses: ruby/setup-ruby@v1
@@ -25,7 +25,6 @@ jobs:
id: afternoon_seal
run: |
teams=(
govuk-accounts
govuk-developers
govuk-platform-security-reliability
)
4 changes: 1 addition & 3 deletions .github/workflows/dependapanda.yml
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup ruby
uses: ruby/setup-ruby@v1
@@ -26,8 +26,6 @@ jobs:
id: dependapanda
run: |
teams=(
di-ipv-orange-cri-maintainers
govuk-accounts-tech
govuk-datagovuk
govuk-developers
govuk-forms
4 changes: 1 addition & 3 deletions .github/workflows/morning_seal.yml
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup ruby
uses: ruby/setup-ruby@v1
@@ -26,8 +26,6 @@ jobs:
id: morning_seal
run: |
teams=(
di-ipv-orange-cri-maintainers
govuk-accounts-tech
govuk-datagovuk
govuk-developers
govuk-forms
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
- name: Install dependencies and run Rake
run: |
6 changes: 3 additions & 3 deletions lib/github_fetcher.rb
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ def initialize(team, dependabot_prs_only: false)
@repos = team.repos
@include_security_alerts = team.security_alerts
@dependabot_prs_only = dependabot_prs_only
@repo_specific_alerts = {}
@repo_security_alerts = {}
@security_alert_handler = dependabot_prs_only && @include_security_alerts ? SecurityAlertHandler.new(github, organisation, repos) : nil
end

@@ -32,7 +32,7 @@ def list_pull_requests

def pull_requests_from_github
repos.flat_map do |repo|
@repo_specific_alerts[repo] = @security_alert_handler.filter_security_alerts(repo) if @security_alert_handler
@repo_security_alerts[repo] = @security_alert_handler.filter_security_alerts(repo) if @security_alert_handler
fetch_pull_requests(repo).reject(&:draft)
end
end
@@ -64,7 +64,7 @@ def fetch_pull_requests(repo)

def present_pull_request(pull_request)
repo = pull_request.base.repo.name
security_label = @dependabot_prs_only && @include_security_alerts ? @security_alert_handler.label_for_branch(pull_request.head.ref, pull_request.title, @repo_specific_alerts[repo]) : nil
security_label = @dependabot_prs_only && @include_security_alerts ? @security_alert_handler.label_for_branch(pull_request.head.ref, pull_request.title, @repo_security_alerts[repo]) : nil

{
title: pull_request.title,
8 changes: 4 additions & 4 deletions lib/message_builder.rb
Original file line number Diff line number Diff line change
@@ -7,13 +7,13 @@ class MessageBuilder

attr_accessor :pull_requests, :report, :mood, :poster_mood

def initialize(team, animal)
def initialize(team, mode)
@team = team
@animal = animal
@mode = mode
end

def build
case @animal
case @mode
when :panda
build_dependapanda_message
else
@@ -62,7 +62,7 @@ def pr_date(pr)
end

def github_fetcher
@github_fetcher ||= GithubFetcher.new(team, dependabot_prs_only: @animal == :panda)
@github_fetcher ||= GithubFetcher.new(team, dependabot_prs_only: @mode == :panda)
end

def pull_requests

0 comments on commit 1d4300f

Please sign in to comment.