Skip to content

Fbe.unmask_repos silently ignores a wildcard mask written with a space after the comma #619

Description

@morphqdd

What happens

Fbe.unmask_repos (lib/fbe/unmask_repos.rb:73) splits options.repositories by comma and uses each mask verbatim — no strip. A space after a comma, which is how humans naturally write lists, corrupts the mask:

opts = Judges::Options.new({'testing' => true, 'repositories' => 'yegor256/factbase, Yegor256/*'})
Fbe.unmask_repos(options: opts, global: {}, loog: Loog::NULL)
# => ["yegor256/factbase"]

The wildcard mask " Yegor256/*" is silently dropped: Fbe.mask_to_regex escapes the leading space into the regex (/\A\ Yegor256\/.*\z/i), which matches no real full_name, so the whole repository group quietly disappears from the scan — no error, no warning.

An exact-name mask is even worse off: 'a/b, c/d' pushes " c/d" into the list as-is, and the archived-repos filter then calls octo.repository(" c/d"), which on the real GitHub API fails — crashing the judge with a cryptic Octokit error instead of pointing at the stray space.

What should happen

Masks should be whitespace-tolerant: masks = options.repositories.split(',').map(&:strip).reject(&:empty?) (the reject also guards against a double comma, which today pushes an empty string into the repo list). A mask written as "a/b, c/*" should behave exactly like "a/b,c/*".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions