9 Commits

Author SHA1 Message Date
Jimmy Berry
39ef75493d Change references to osc-plugin-factory to openSUSE-release-tools. 2018-03-16 14:58:27 -05:00
Jimmy Berry
b2861ae31a osclib/cycles: only cache target project builddepinfo to avoid excessive cache.
Keep on disk using caching mechanism to avoid keep entire graphs in memory
and expiring via existing code.
2017-11-30 16:30:16 -06:00
Jimmy Berry
31cf49a09e repo_checker: store and compare build hash to skip more aggressively. 2017-10-31 18:51:38 -05:00
Jimmy Berry
7f5fbd5b4b osclib/cache: allow ttl of 0 to prevent caching. 2017-10-24 17:55:32 -05:00
d1c4801578 Another set of low-noise flake8 cleanups 2017-10-20 20:46:44 +02:00
Jimmy Berry
5b6ad33773 cache: unquote() all URLs before processing to ensure correctness.
It seems osc.core and similar generate both quoted and unquoted URLs that
are cached separately. Additionally, urlopen() handles quoted paths
differently from os.path.*() methods which can create issues for quoted
projects.
2017-07-18 23:51:22 -05:00
Jimmy Berry
c505e838cf cache: correction to match all dashboard file requests.
With the query PUTs are not match and thus the local cache is not cleared
until the next statistics/latest_updated call.
2017-05-04 11:13:12 -05:00
Jimmy Berry
f6c31d7f59 cache: include dashboard files. 2017-05-01 17:40:33 -05:00
Jimmy Berry
cff5befed3 Provide cache for expensive and cache-able staging requests.
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.
2017-01-11 10:23:54 -06:00