224 Commits

Author SHA1 Message Date
Ludwig Nussel
79a193ab78 Merge pull request #770 from jberry-suse/cleanup-obsolete-untracked
support --cleanup for obsolete and untracked requests in unselect and repair commands
2017-03-20 15:40:17 +01:00
Jimmy Berry
8ebe94bc5f stagingapi: get_ignored_requests() handle empty file. 2017-03-18 21:04:54 -05:00
Jimmy Berry
3505736fe0 stagingapi: project_status_requests() to extract all requests of type. 2017-03-18 18:06:51 -05:00
Jimmy Berry
b4abfd8b58 stagingapi: refactor _get_staged_requests() to use project_status(). 2017-03-16 23:16:26 -05:00
Jimmy Berry
e17ee8cd53 stagingapi: handle empty string in load_prj_pseudometa(). 2017-03-16 22:42:28 -05:00
Jimmy Berry
19a6d60c78 stagingapi: allow project_status() to utilize aggregate backend call. 2017-03-16 22:11:12 -05:00
Jimmy Berry
7580e5504d stagingapi: allow staging to be None in project_status() to return all. 2017-03-16 14:35:12 -05:00
Jimmy Berry
8b5dc5d7c8 accept: refactor staging cleanup into stagingapi. 2017-03-14 23:02:52 -05:00
Jimmy Berry
1b638a533b osc-staging: provide rebuild_check() to conditionally rebuild failures. 2017-03-14 00:24:23 -05:00
Jimmy Berry
13b7ae9d8a osc-staging: provide rebuild command.
Often packages will fail to build after becoming stuck or other false
negative cases and need to have a rebuild triggered. The process can be
tedious if several packages failed in various stages.
2017-03-08 16:17:31 -06:00
Ludwig Nussel
19a37c0553 Merge pull request #702 from jberry-suse/select-merge-and-strategies
Select automation: merge and strategies
2017-03-08 18:54:14 +01:00
Jimmy Berry
7bc9010314 stagingapi: extract_staging_short() correction for non-letter parse. 2017-03-03 15:07:32 -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
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
55c4382248 stagingapi: update_status_comments() include link to dashboard. 2017-02-10 11:48:59 -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
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
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
Ludwig Nussel
3119bec1e1 Allow to force individual package queries for devel project 2016-10-17 11:35:21 +02:00
Ludwig Nussel
7a19cf19fb Merge pull request #526 from lnussel/master
Handle separate lookup file in :NonFree
2016-06-14 14:29:31 +02:00
Ludwig Nussel
b505e7e7d8 Create empty dict even for projects without packages
cross OBS instance search doesn't seem to work so get_devel_project would
crash

closes #529
2016-06-14 14:05:17 +02:00
8c649111d9 Supeseding the request only when it was an reasonable type
Supeseding in stagin tool mainly works for submit/delete type request,
ie. supesede each other. The rest of type should not the case here.
2016-06-13 17:30:08 +08:00
335089ac61 Displays as Ring0 package if the subpackage was linked to Ring1
If the package was linked to Ring1 from Ring1, staging list command
should display it as Ring0 package ie. it's only be able to puts in
ring0 staging project. This is work out
https://progress.opensuse.org/issues/8266
2016-06-13 16:54:01 +08:00
Ludwig Nussel
bddcc12c8d Fix accept logic to actually work 2016-06-09 13:15:01 +02:00
Ludwig Nussel
4c43fe5c87 Group staging list by devel project 2016-06-07 15:12:02 +02:00
Ludwig Nussel
f2db5cdb5e Use implicit whitespace split 2016-06-07 15:12:02 +02:00
Ludwig Nussel
8857e79813 Print warning when staging with build disabled 2016-06-07 15:11:26 +02:00
Ludwig Nussel
082f3a9a52 Fixup cleanup_rings a bit 2016-06-07 14:44:42 +02:00
d70f80cbd2 Autocleanup: Make list of packages to retain configurable 2016-06-02 16:37:32 +02:00
5c8aa3944f stagingapi: Add list_packages method
* Lists all the packages in a project

and use the new API call in check_pkgs
2016-05-31 15:05:36 +02:00
Ludwig Nussel
28831300fc Defer initialization of ring packages
some users of the staging api don't need to access rings, so defer
initialization to first use.
2016-05-09 17:32:40 +02:00
8fa6783c3f Do not check totest on SLE
If release-notes-sles is existed then it is not openSUSE Factory but
SLE, hence do not check totest and openSUSE-release.rpm on it.

And add try/except protection in get_binary_version otherwise it will
crashes in case the package is not existed.
2016-03-25 18:55:36 +08:00
9a03a60f62 Fix PUT data never send 2016-02-18 18:25:51 +08:00
Ludwig Nussel
8c53f9f8f0 don't use recursive retry
don't use recursion and don't hammer server
2016-02-05 16:26:16 +01:00
Ludwig Nussel
11b25be352 Merge pull request #444 from DimStar77/accept-ready_check
staging accept: check if /totest is properly synced before changing /…
2015-12-21 16:29:05 +01:00
ce218979c4 staging accept: check if /totest is properly synced before changing /standard 2015-11-30 11:22:50 +01:00
37af83e927 Check subproject is exist before delete package
It's workaound for https://progress.opensuse.org/issues/9646, suppose it
is adi staging in case current project doesn't have ":DVD" subproject,
and the package is exist in current project.
2015-11-24 19:36:04 +08:00
0daad0fd1c auto-superseding in adi command 2015-11-19 20:23:10 +08:00
a3f59150af Do not superseding requests with list command
Do not superseding requests with list command, but if had the permission
of staging, can executing with --supersede argument, or even against
specific requests.
2015-10-01 19:59:40 +08:00