The two slowest staging API calls are for information that rarely changes.
By caching the result the commands typically execute over twice as fast.
Going further can see improvements of an order of magnitude or more by
caching almost all the GET requests.
In contrast to osclib/memoize.py this cache operates at the HTTP request
level. This has several advantages:
- Caches the expensive part (ie the HTTP request). There are a number of
functions in osc.core and elsewhere that make the same API request, but
process the result differently which would require multiple API calls
using memoize.
- Handles cases were a loader function uses class attributes as input and
output and thus no relevant method parameters or return. An important
example is StagingAPI._generate_ring_packages().
- Storage is project aware which allows caches to be deleted when a project
is known to have changed.
- Due to project awareness, can utilize OBS /statistics/latest_updated API
call to determine which projects need to be expired.
The cache file structure is as follows:
- hostname(apiurl)
- project
- sha1(url)
- sha1(url)
See Cache.PATTERNS for changing the time to live (ttl) or add patterns to
be cached.
If only the review by a factory staging project is left in state new and
all others are in state accepted it means legal, opensuse-review team
etc have completed. So it's safe to consider such a request accepted for
inclusion into Factory. So let's not waste time waiting for the next
Factory checkin round.
- Now it looks for correctly formed tags (not only 'bnc#' but 'bnc#[0-9]+' and so on)
- It doesn't look in the request description anymore, now it checks that
tags appear in the diff of the modified .changes files (and there must be at least
one .changes file being modified)
- The tests have been reworked from scratch, now they're more complete, cleaner and nicer
factory-source checks if submissions contain sources already accepted in
Factory. maintbot makes sure maintenance submissions are authored by the
Factory package maintainer.
Both are based on a new generic ReviewBot.py class that can serve as
common framework for review bots.