#421 Extend allowed_scms format to allow explicit blocks
Merged by mikem. Opened by mikem.
mikem/koji scm-deny  into  master

Download 421.patch

See the updated docstring for details. This change adds the ability to have entries like:

!host:repository

Which would explicitly block a host:repository pattern. This allows for somewhat more robust rules. In particular, it provides the option
to block specific subtrees of a host, but allow from it otherwise. E.g.

!my_pagure:forks/*
my_pagure:*:no

also included: unit tests for the SCM class

@pingou this should cover that one issue we were discussing

Should we warn so admins can see in the logs that something is wrong in the config?

Nevermind, we're already warning :)

If you want to follow pep8 you'll need to remove one line here :)

Completely nitpicking, but confused me for about half a second, maybe we could name the variable "configuration" rather than "allowed".

Couple of nitpicks but nothing major or blocking for me.

:ship: it!

1 new commit added

  • rename variable in unit test. clarify docstring

The variable in the tests was named to match the parameter in the call, but I suppose config is more accurate. I'd change it there too, but I'd rather not change a function signature in the library (apart from extension) for something like this.

Does it make sense to mention it in docs in addition to code?

1 new commit added

  • update docs for allowed_scms

rebased

Pull-Request has been merged by mikem

Does this also let us filter based on branches?

Does this also let us filter based on branches?

No, this check only considers the path. The revision is in the url fragment, and interpreting that correctly is much more complicated.

Metadata