kojismokydingo.sift.builds¶
Koji Smoky Dingo - Sifty Dingo filtering for Koji Builds
This module provides sieves for filtering through koji build info dicts.
- author:
Christopher O'Brien <obriencj@gmail.com>
- license:
GPL v3
- class CGImportedSieve(sifter, *tokens)[source]¶
Bases:
MatcherSieveusage:
(cg-imported [CGNAME...])Passes build infos that have been produced via a cg-import by any of the named content generators. If no CGs are named, then passes build infos that have been produced by any content generator.
- check(session, binfo)[source]¶
Override to return True if the predicate matches the given info dict.
This is used by the default
runimplementation in a filter. Only the info dicts which return True from this method will be included in the results.- Parameters:
info -- The info dict to be checked.
- name = 'cg-imported'¶
- class CompareLatestIDSieve(sifter, comparison, tag)[source]¶
Bases:
CompareLatestSieveusage:
`(compare-latest-id OP TAG)`Filters for builds which have an ID which compares against the latest build of the same package from TAG.
Valid comparison ops are:
==!=>>=<<=
example:
`(compare-latest-id >= foo-1.0-released)`will filter for builds which have an ID that is greater-than-or-equal-to the ID of the latest build of the same package name in the foo-1.0-released tag.- check(session, binfo)[source]¶
Override to return True if the predicate matches the given info dict.
This is used by the default
runimplementation in a filter. Only the info dicts which return True from this method will be included in the results.- Parameters:
info -- The info dict to be checked.
- comparison_key = operator.itemgetter('id')¶
- name = 'compare-latest-id'¶
- class CompareLatestNVRSieve(sifter, comparison, tag)[source]¶
Bases:
CompareLatestSieveusage:
`(compare-latest-nvr OP TAG)`Filters for builds which have an NVR which compares against the latest build of the same package from TAG.
Valid comparison ops are:
==!=>>=<<=
example:
`(compare-latest-nvr >= foo-1.0-released)`will filter for builds which have an NVR that is greater-than-or-equal-to the NVR of the latest build of the same package name in the foo-1.0-released tag.- check(session, binfo)[source]¶
Override to return True if the predicate matches the given info dict.
This is used by the default
runimplementation in a filter. Only the info dicts which return True from this method will be included in the results.- Parameters:
info -- The info dict to be checked.
- comparison_key¶
alias of
BuildNEVRCompare
- name = 'compare-latest-nvr'¶
- class EVRCompareEQ(sifter, version)[source]¶
Bases:
EVRCompareUsage:
(== VER)VERcan be in any of the following formsEPOCH:VERSIONEPOCH:VERSION-RELEASEVERSIONVERSION-RELEASE
If
EPOCHis omitted, it is presumed to be0. IfRELEASEis omitted, it is presumed to be equivalent.Passes builds whose EVR compares as requested.
- name = '=='¶
- class EVRCompareGE(sifter, version)[source]¶
Bases:
EVRCompareUsage:
(>= VER)VERcan be in any of the following formsEPOCH:VERSIONEPOCH:VERSION-RELEASEVERSIONVERSION-RELEASE
If
EPOCHis omitted, it is presumed to be0. IfRELEASEis omitted, it is presumed to be equivalent.Passes builds whose EVR compares as requested.
- name = '>='¶
- class EVRCompareGT(sifter, version)[source]¶
Bases:
EVRCompareUsage:
(> VER)VERcan be in any of the following formsEPOCH:VERSIONEPOCH:VERSION-RELEASEVERSIONVERSION-RELEASE
If
EPOCHis omitted, it is presumed to be0. IfRELEASEis omitted, it is presumed to be equivalent.Passes builds whose EVR compares as requested.
- name = '>'¶
- class EVRCompareLE(sifter, version)[source]¶
Bases:
EVRCompareUsage:
(<= VER)VERcan be in any of the following formsEPOCH:VERSIONEPOCH:VERSION-RELEASEVERSIONVERSION-RELEASE
If
EPOCHis omitted, it is presumed to be0. IfRELEASEis omitted, it is presumed to be equivalent.Passes builds whose EVR compares as requested.
- name = '<='¶
- class EVRCompareLT(sifter, version)[source]¶
Bases:
EVRCompareUsage:
(< VER)VERcan be in any of the following formsEPOCH:VERSIONEPOCH:VERSION-RELEASEVERSIONVERSION-RELEASE
If
EPOCHis omitted, it is presumed to be0. IfRELEASEis omitted, it is presumed to be equivalent.Passes builds whose EVR compares as requested.
- name = '<'¶
- class EVRCompareNE(sifter, version)[source]¶
Bases:
EVRCompareUsage:
(!= VER)VERcan be in any of the following formsEPOCH:VERSIONEPOCH:VERSION-RELEASEVERSIONVERSION-RELEASE
If
EPOCHis omitted, it is presumed to be0. IfRELEASEis omitted, it is presumed to be equivalent.Passes builds whose EVR compares as requested.
- name = '!='¶
- class EVRHigh(sifter, count=1)[source]¶
Bases:
EVRSortedusage: (evr-high [count: COUNT])
Filters to only the builds which are the higest EVR of their given package name.
COUNT if specified is the number of highest EVR builds to return. Default is 1
- name = 'evr-high'¶
- class EVRLow(sifter, count=1)[source]¶
Bases:
EVRSortedusage: (evr-low [count: COUNT])
Filters to only the builds which are the lowest EVR of their given package name.
COUNT if specified is the number of lowest EVR builds to return. Default is 1
- name = 'evr-low'¶
- class EpochSieve(sifter, *exprs)[source]¶
Bases:
ItemSieveUsage:
(epoch EPOCH [EPOCH...])filters for dict infos whose
epochkey matches any of the given EPOCH matchers.- field = 'epoch'¶
- name = 'epoch'¶
- class ImportedSieve(sifter, *tokens, **options)[source]¶
Bases:
SieveUsage:
(imported)filters for build info dicts whose task ID is empty or null.
- Parameters:
sifter (Sifter)
- check(session, binfo)[source]¶
Override to return True if the predicate matches the given info dict.
This is used by the default
runimplementation in a filter. Only the info dicts which return True from this method will be included in the results.- Parameters:
info -- The info dict to be checked.
- name = 'imported'¶
- class InheritedSieve(sifter, tagname, *tagnames)[source]¶
Bases:
IntStrSieveusage: (inherited TAG [TAG...])
Matches builds which are tagged into any of the given tags or their parent tags. Each TAG must be a tag name or tag ID, patterns are not allowed.
- check(session, binfo)[source]¶
Override to return True if the predicate matches the given info dict.
This is used by the default
runimplementation in a filter. Only the info dicts which return True from this method will be included in the results.- Parameters:
info -- The info dict to be checked.
- get_info_cache(binfo)[source]¶
Gets a cache dict from the sifter using the name of this sieve and the sifter's designated key for the given info dict. The default sifter key will get the "id" value from the info dict.
The same cache dict will be returned for this info dict until the sifter has its
resetmethod invoked.
- name = 'inherited'¶
- class LatestMavenSieve(sifter, tagname, *tagnames)[source]¶
Bases:
IntStrSieve,CacheMixinusage:
(latest-maven TAG [TAG...])Passes build infos that have btype maven and are the build of their GAV in any of the tags.
- check(session, binfo)[source]¶
Override to return True if the predicate matches the given info dict.
This is used by the default
runimplementation in a filter. Only the info dicts which return True from this method will be included in the results.- Parameters:
info -- The info dict to be checked.
- name = 'latest-maven'¶
- class LatestSieve(sifter, tagname, *tagnames)[source]¶
Bases:
IntStrSieve,CacheMixinusage:
(latest TAG [TAG...])Passes build infos that are the latest build of their package name in any of the tags.
- check(session, binfo)[source]¶
Override to return True if the predicate matches the given info dict.
This is used by the default
runimplementation in a filter. Only the info dicts which return True from this method will be included in the results.- Parameters:
info -- The info dict to be checked.
- name = 'latest'¶
- class NVRSieve(sifter, *exprs)[source]¶
Bases:
ItemSieveUsage:
(nvr NVR [NVR...])filters for dict infos whose
nvrkey matches any of the given NVR matchers.- field = 'nvr'¶
- name = 'nvr'¶
- class NameSieve(sifter, *exprs)[source]¶
Bases:
ItemSieveUsage:
(name NAME [NAME...])filters for dict infos whose
namekey matches any of the given NAME matchers.- field = 'name'¶
- name = 'name'¶
- class OwnerSieve(sifter, user, *users)[source]¶
Bases:
IntStrSieveUsage:
(owner USER [USER...])`filters for builds whose
owner_nameorowner_idkey matches any of the given USERs.The users will be validated at the time of the sieve's first invocation, which may result in a NoSuchUser error.
- check(session, binfo)[source]¶
Override to return True if the predicate matches the given info dict.
This is used by the default
runimplementation in a filter. Only the info dicts which return True from this method will be included in the results.- Parameters:
info -- The info dict to be checked.
- name = 'owner'¶
- class PkgAllowedSieve(sifter, tagname, *tagnames)[source]¶
Bases:
PkgListSieveusage:
(pkg-allowed TAG [TAG...])Matches builds which are have their package listing present and not blocked in any of the given tags or their parents.
- check(session, binfo)[source]¶
Override to return True if the predicate matches the given info dict.
This is used by the default
runimplementation in a filter. Only the info dicts which return True from this method will be included in the results.- Parameters:
info -- The info dict to be checked.
- name = 'pkg-allowed'¶
- class PkgBlockedSieve(sifter, tagname, *tagnames)[source]¶
Bases:
PkgListSieveusage:
(pkg-blocked TAG [TAG...])Matches builds which are have their package name blocked in any of the given tags or their parents.
- check(session, binfo)[source]¶
Override to return True if the predicate matches the given info dict.
This is used by the default
runimplementation in a filter. Only the info dicts which return True from this method will be included in the results.- Parameters:
info -- The info dict to be checked.
- name = 'pkg-blocked'¶
- class PkgUnlistedSieve(sifter, tagname, *tagnames)[source]¶
Bases:
PkgListSieveusage:
(pkg-unlisted TAG [TAG...])Matches builds which have their package name unlisted (neither allowed nor blocked) in any of the given tags or their parents.
- check(session, binfo)[source]¶
Override to return True if the predicate matches the given info dict.
This is used by the default
runimplementation in a filter. Only the info dicts which return True from this method will be included in the results.- Parameters:
info -- The info dict to be checked.
- name = 'pkg-unlisted'¶
- class ReleaseSieve(sifter, *exprs)[source]¶
Bases:
ItemSieveUsage:
(release REL [REL...])filters for dict infos whose
releasekey matches any of the given REL matchers.- field = 'release'¶
- name = 'release'¶
- class SignedSieve(sifter, *tokens)[source]¶
Bases:
MatcherSieveusage:
(signed [KEY...])Passes builds which have RPMs signed with any of the given keys. If no keys are specified then passes builds which have RPMs signed with any key at all.
- check(session, binfo)[source]¶
Override to return True if the predicate matches the given info dict.
This is used by the default
runimplementation in a filter. Only the info dicts which return True from this method will be included in the results.- Parameters:
info -- The info dict to be checked.
- name = 'signed'¶
- class StateSieve(sifter, name, *names)[source]¶
Bases:
SieveUsage:
(state BUILD_STATE [BUILD_STATE...])filters for dict infos whose
statekey matches any of the given koji build states. Build states may be specified as either an integer or one of the following strings or symbolsBUILDINGCOMPLETEDELETEDFAILEDCANCELED
- check(session, info)[source]¶
Override to return True if the predicate matches the given info dict.
This is used by the default
runimplementation in a filter. Only the info dicts which return True from this method will be included in the results.- Parameters:
info -- The info dict to be checked.
- name = 'state'¶
- class TaggedSieve(sifter, *tokens)[source]¶
Bases:
MatcherSieveusage: (tagged [TAG...])
If no TAG patterns are specified, matches builds which have any tags at all.
If TAG patterns are specified, then only matches builds which have a tag that matches any of the given patterns.
- check(session, binfo)[source]¶
Override to return True if the predicate matches the given info dict.
This is used by the default
runimplementation in a filter. Only the info dicts which return True from this method will be included in the results.- Parameters:
info -- The info dict to be checked.
- name = 'tagged'¶
- class TypeSieve(sifter, btype, *btypes)[source]¶
Bases:
MatcherSieveusage:
(type BTYPE [BTYPE...])Passes build infos that have archives of the given btype. Normal btypes are rpm, maven, image, and win.
- check(session, binfo)[source]¶
Override to return True if the predicate matches the given info dict.
This is used by the default
runimplementation in a filter. Only the info dicts which return True from this method will be included in the results.- Parameters:
info -- The info dict to be checked.
- name = 'type'¶
- class VersionSieve(sifter, *exprs)[source]¶
Bases:
ItemSieveUsage:
(version VER [VER...])filters for dict infos whose
versionkey matches any of the given VER matchers.- field = 'version'¶
- name = 'version'¶
- build_info_sieves()[source]¶
A new list containing the default build-info sieve classes.
This function is used by
build_info_sifterwhen creating itsSifterinstance.
- build_info_sifter(source, params=None)[source]¶
Create a Sifter from the source using the default build-info Sieves.
- sift_builds(session, src_str, build_infos, params=None)[source]¶
Filter a group of build infos with a sieve compiled from the given source string.
- Parameters:
- Returns:
mapping of flags to matching build info dicts
- Return type: