Fbe.unmask_repos (lib/fbe/unmask_repos.rb:71-104) builds the repos array by iterating every non-exclusion mask independently and appending matches, with no deduplication anywhere in the pipeline (not after the inclusion loop, not after the exclusion loop, not before the final repos.each/return).
What happens: when options.repositories contains an exact repo name and a wildcard mask that also matches that same repo — e.g. "yegor256/factbase,Yegor256/*" — the repo is appended once by the exact-name branch (repos << mask; next) and again by the wildcard branch (re.match? loop over organization_repositories), and both copies survive to the end.
Reproduced directly:
opts = Judges::Options.new({'testing' => true, 'repositories' => 'yegor256/factbase,Yegor256/*'})
list = Fbe.unmask_repos(options: opts, global: {}, loog: Loog::NULL)
# => ["yegor256/judges", "yegor256/factbase", "yegor256/factbase"]
list.size # => 3
list.uniq.size # => 2
yegor256/factbase appears twice. Since the method's block form does repos.each { |repo| ...; yield(repo) }, a caller using overlapping masks gets the same repository yielded (and processed — extra API calls, extra judge-fact writes, etc.) twice per run for no legitimate reason.
What should happen: repos should contain each matching repository exactly once regardless of how many masks (exact or wildcard) happen to match it — e.g. repos.uniq! before the emptiness check / return.
Fbe.unmask_repos(lib/fbe/unmask_repos.rb:71-104) builds thereposarray by iterating every non-exclusion mask independently and appending matches, with no deduplication anywhere in the pipeline (not after the inclusion loop, not after the exclusion loop, not before the finalrepos.each/return).What happens: when
options.repositoriescontains an exact repo name and a wildcard mask that also matches that same repo — e.g."yegor256/factbase,Yegor256/*"— the repo is appended once by the exact-name branch (repos << mask; next) and again by the wildcard branch (re.match?loop overorganization_repositories), and both copies survive to the end.Reproduced directly:
yegor256/factbaseappears twice. Since the method's block form doesrepos.each { |repo| ...; yield(repo) }, a caller using overlapping masks gets the same repository yielded (and processed — extra API calls, extra judge-fact writes, etc.) twice per run for no legitimate reason.What should happen:
reposshould contain each matching repository exactly once regardless of how many masks (exact or wildcard) happen to match it — e.g.repos.uniq!before the emptiness check / return.