Skip to content

Commit

Permalink
Fix pagination of track team members (#7055)
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikSchierboom authored Sep 4, 2024
1 parent 8e393fd commit 2933e5c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions app/commands/track/retrieve_maintainers_status.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,13 @@ def track_team_members
GRAPHQL

response = Github::Graphql::ExecuteQuery.(query, %i[organization team childTeams])
response[0][:nodes].filter_map do |node|
next unless track_slugs.include?(node[:name])
response.flat_map do |nodes|
nodes[:nodes].filter_map do |node|
next unless track_slugs.include?(node[:name])

[node[:name], node.dig(:members, :nodes).pluck(:login)]
end.to_h
[node[:name], node.dig(:members, :nodes).pluck(:login)]
end
end.sort.to_h
end

memoize
Expand Down Expand Up @@ -108,7 +110,7 @@ def track_slugs = tracks.pluck(:slug)
memoize
def rep_cutoff_date = Time.zone.today - LAST_NUMBER_OF_MONTHS_FOR_REP.months

CACHE_KEY = "Track::RetrieveMaintainersStatus/3".freeze
CACHE_KEY = "Track::RetrieveMaintainersStatus/4".freeze
CACHE_EXPIRY = 1.day.freeze
private_constant :CACHE_KEY, :CACHE_EXPIRY
end

0 comments on commit 2933e5c

Please sign in to comment.