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

Fix pagination of track team members #7055

Merged
merged 1 commit into from
Sep 4, 2024
Merged
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
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
Loading