This PR addresses the second part of #216.
I have some concerns that by removing the PackageSpecificBuild and FedoraAtomicCi rules, we'll break existing use-cases. Do we know where these rules are used, if at all?
PackageSpecificBuild
FedoraAtomicCi
As far as we know those are the policies in Greenwave's instances: (1) https://greenwave-web-greenwave.app.os.fedoraproject.org/api/v1.0/policies (2) https://greenwave.engineering.redhat.com/api/v1.0/policies
The first one looks fine. The second one has some "PackageSpecificBuild", but we could consequently change the policies submitting a PR for that.
LGTM
rebased onto c269f8c5bb76ee399da70196511e4554147b0b76
Thanks @gnaponie! That won't be hard to change then.
if self.packages and not any(fnmatch(name, package) for package in self.packages): return []
FedoraAtomicCi is used in Fedora staging instance of Greenwave (see configmap.yml) - not sure if there are still any plans to use it in prod.
Good call. We should check also stage instances.
I thought about this approach, but you end up running fnmatch for every entry in self.packages when it may not be necessary. I'm fine with changing it to this though since self.packages should remain small.
fnmatch
self.packages
In this case, the argument in any() is generator - it'll stop taking next item when it gets the first truthy value.
any()
I didn't know it was a generator. I'll refactor this then to use that. It's much cleaner.
2 new commits added
Replace PackageSpecificBuild with a packages whitelist on the policy
Add .vscode/ to .gitignore
@lholecek and @gnaponie, I addressed the comment in the PR. This is ready for review again.
+1
looks good. But... let's wait to merge it? Or let's merge it but let's remember not to release it.
@gnaponie if merge it, we can start the process of migrating the old policies this week. Do we need to check if any of the remote rules use PackageSpecificBuild?
@mprahl I would before ask to Miroslav, I think he (and his team) is only one using it at the moment.
Commit 1becc01c fixes this pull-request
Pull-Request has been merged by gnaponie
This PR addresses the second part of #216.
I have some concerns that by removing the
PackageSpecificBuildandFedoraAtomicCirules, we'll break existing use-cases. Do we know where these rules are used, if at all?