715 Commits

Author SHA1 Message Date
Jimmy Berry
a6d7716eb0 osclib: wrap ignored request reason with str() to handle None. 2017-03-03 14:57:16 -06:00
Jimmy Berry
c6b37d60ab osc-staging: provide --cleanup option for unignore. 2017-03-02 15:38:12 -06:00
Jimmy Berry
27a6772dce request_splitter: add strategy_do_non_bootstrapped().
Utilize in select command to fallback to none strategy and also excluded
packages that require bootstrapping.
2017-03-01 01:08:23 -06:00
Jimmy Berry
17147acb15 request_splitter: add @postponed concept.
This allows for high priority strategies that were unable to be staged
this round to be postponed until there is a staging available.
2017-03-01 01:08:23 -06:00
Jimmy Berry
ad4d93a5b4 request_splitter: rework internals to support merge and strategies.
- reworked internal representation of stagings to be more flexible
- new considerable staging state of mergeable based on set of conditions
- multiple proposal stages can be combined to create one proposal
- proposals may now fail to find every group a home without stopping
- splitter_info is stored when first request in an empty staging is staged
  to allow for automated merging into that staging
- strategy concept introduced along with several strategies
- strategy_try() concept for applying multiple strategies and keeping
  desirable groups which provides a solid basis for making smart decisions
- merge() introduced for merging new requests into existing stagings
- various internal cleanups along the way

functionality exposed via osc-staging:
- new options: --merge, --try-strategies, --strategy
- splitter info written when not merging

stagingapi: add set_splitter_info_in_prj_pseudometa().
2017-03-01 01:08:23 -06:00
Jimmy Berry
67d274e6eb request_splitter: extract is_staging_bootstrapped(). 2017-03-01 01:08:23 -06:00
Jimmy Berry
4d08331250 request_splitter: rework stagings_load() to be public facing.
Notify user and exit early if not stagings worth considering.
2017-03-01 01:08:23 -06:00
Jimmy Berry
3d3f0469a4 request_splitter: only supliment a request once. 2017-03-01 01:08:23 -06:00
Jimmy Berry
2a1b221e44 stagingapi: provide project_status_build_{percent,sum,sum_repos}(). 2017-03-01 01:08:22 -06:00
Jimmy Berry
e8008c4ee6 stagingapi: break out project_status() from check_project_status().
The status information can be useful outside of just checking acceptable.
2017-03-01 01:08:22 -06:00
Jimmy Berry
8198193196 stagingapi: utilize get_prj_meta() in set_prj_pseudometa(). 2017-03-01 01:08:16 -06:00
Jimmy Berry
172012f2c4 stagingapi: break out load() from get_prj_pseudometa().
The project meta can also be returned by other calls and can be handy to
load separately rather than make a needless API call.
2017-03-01 01:05:51 -06:00
Jimmy Berry
bfde256a6d stagingapi: drop prefix assignment in get_staging_projects_short(). 2017-03-01 01:05:51 -06:00
Jimmy Berry
be31ce05e4 stagingapi: get_staging_projects_short() exclude non-letter stagings. 2017-03-01 01:05:51 -06:00
Jimmy Berry
02b4958fe0 stagingapi: add clear_prj_pseudometa() and call after accept.
This ensures that the pseudometa data is fully reset and allows for
optional information to be added without risk of leaving it behind.
2017-03-01 01:04:57 -06:00
916a56764f
Add a link to the dashboard of the respective adi project being created 2017-02-22 11:02:38 +01:00
Jimmy Berry
8ebf07b139 unselect: suggest marking a request ignored if eligible to restage. 2017-02-15 21:46:28 -06:00
Ludwig Nussel
10d4abb077 Merge pull request #683 from jberry-suse/update_status_comments-dashboard
stagingapi: update_status_comments() include link to dashboard.
2017-02-15 09:56:32 +01:00
9a322d712e adi: Do not update status comment per request but project 2017-02-13 18:11:20 +08:00
Jimmy Berry
55c4382248 stagingapi: update_status_comments() include link to dashboard. 2017-02-10 11:48:59 -06:00
Jimmy Berry
997f929ad4 adi: map wanted_requests to str() before passing to splitter. 2017-02-10 10:05:38 -06:00
Jimmy Berry
ef5de87c5d request_splitter: delete requests should always be considered in a ring. 2017-02-08 13:54:01 -06:00
Jimmy Berry
08f2218574 request_splitter: list: remove case for delete request without ring.
This case should no longer exist as non-ring requests will have already
be separated out of this loop.
2017-02-08 13:20:36 -06:00
Jimmy Berry
9f28923ba5 request_splitter: non-ring projects consider all requests in rings. 2017-02-08 13:19:08 -06:00
Jimmy Berry
3de3cae13a request_splitter: utilize ring attribute rather then lookup again. 2017-02-08 13:18:21 -06:00
Jimmy Berry
404a3efe58 request_splitter: rather than an empty group name use 00.
Sorts to the top and is consistent with old behavior.
2017-02-08 13:15:52 -06:00
Ludwig Nussel
a8c2f7840b Merge pull request #654 from jberry-suse/avoid-search-package
stagingapi: Avoid search/package query to determine devel project.
2017-02-06 15:54:57 +01:00
Ludwig Nussel
4341464914 Merge remote-tracking branch 'jberry/remove-source-devel' into jb 2017-02-06 15:51:48 +01:00
1a16a07cc0 Return None if has not action/source 2017-02-06 17:05:40 +08:00
Ludwig Nussel
163d244084 Merge pull request #664 from nilxam/mkdir_repair
Re-create adi staging if the opened review project is not exist
2017-02-02 14:21:49 +01:00
ee3eb953d4 Re-create adi staging if the opened review project is not exist 2017-02-02 15:47:26 +08:00
daa7c37f3a
Trigger source service for _product in :zSystems on accept 2017-02-01 22:21:14 +01:00
Jimmy Berry
38dbf5b99a request_splitter: refactor to remove target_package param for suppliment(). 2017-02-01 08:09:15 -06:00
Jimmy Berry
f42358eaad request_splitter: move @devel_project to action/target.
With the source no longer being checked for devel project and the fact
that delete requests and such will not have source, but make sense to
have a devel project moving to target makes more sense.
2017-02-01 08:09:01 -06:00
Jimmy Berry
550ab59e4e request_splitter: replace incorrect devel project lookup copied from adi.
Instead of checking action/source the action/target should be used.
2017-02-01 08:08:34 -06:00
Jimmy Berry
a09d6a6c32 stagingapi: Avoid search/package query to determine devel project.
The search/package query is typically very slow and can spend several
minutes timing out. The concept of loading all package meta data at once
is attractive, but given that the query regularly increases the runtime
of the script by an order of magnitude or more making individual calls
seems advantageous. These calls are already included in the cache which
means the initial request avoids the 10+ minute wait and repetitive calls
have no additional cost.
2017-01-31 20:15:23 -06:00
Jimmy Berry
5b7971860e Remove future warning revealed by using future print function. 2017-01-24 22:34:27 -06:00
Jimmy Berry
1fe9b5be19 Provide proposal based select using RequestSplitter.
See select documentation for usage details.
2017-01-24 22:34:15 -06:00
Jimmy Berry
eb58d336d3 Provide StagingAPI.get_prj_meta(). 2017-01-24 22:21:53 -06:00
Jimmy Berry
641c550023 Provide StagingAPI short-hand staging name API.
- extract_staging_short().
- prj_from_short()
- get_staging_projects_short()
2017-01-24 22:21:53 -06:00
Jimmy Berry
69f662685c Add RequestSplitter for common filtering and grouping or requests.
- re-implement list and adi commands using RequestSplitter
- numerous small cleanups and clarity improvements
- notably, adi now prints similar output to select when adding requests
- lxml is needed to provide more fully-featured xpath implementation
2017-01-24 22:21:10 -06:00
Jimmy Berry
6a521fc063 Correct indentation level of in requests_ignored check.
In the previous state this worked for any project except factory, now it
works on factory too.
2017-01-12 16:14:33 -06:00
Jimmy Berry
b25fda9b47 Provide ignore/unignore request staging commands.
It is not uncommon for a request to be in a pending state which requires
action beyond the scope of the staging workflow, but does not make sense
to deny the request. For lack of a "postponed" or "pending" state on OBS
a sudo-state of "ignore" is provided for the staging workflow. The ignore
state will remove a request from the "list" and "adi" commands so as not
to be accidentally staged. This avoids the need for keeping a context of
what requests should be ignored in one's memory.

It is expected that an ignored request will have comments reflecting what
is to be done or one should be added via the -m option of ignore command.
2017-01-11 18:32:23 -06: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
Jimmy Berry
f75e9bdaf3 adi_command: whitespace cleanup.
Tabs vs spaces is even scarier in python.
2016-12-29 16:27:11 -06:00
Jimmy Berry
6e0f2165e0 Indicate select command progress. 2016-12-06 16:40:05 -06:00
Ludwig Nussel
556f9b6b2d Merge pull request #608 from lnussel/adi
Improve adi list output
2016-12-06 15:39:46 +01:00
Ludwig Nussel
7ec1c1955b Improve adi list output 2016-12-06 12:59:47 +01:00
Ludwig Nussel
077d3b66f6 Split config for Leap
Leap doesn't have ppc in staging so split defaults so we don't need
an .oscrc
2016-12-06 12:57:00 +01:00
e6ecb0cbee Import http_POST for accept_command
Since commit 295fcd we newly also require http_POST in order to
put a new file in place after accepting.

Also add quotes around the fakepkgname when injecting it into the kiwi file.
2016-11-16 13:45:27 +01:00