246 Commits

Author SHA1 Message Date
Jimmy Berry
b2ba0730de stagingapi: enhance supersede target_pkgs to skip source project check.
This creates a facility for forcing a request, that was ignored due to
the source check, to supersede the existing one.
2017-04-19 18:09:25 -05:00
Jimmy Berry
567d6d7950 Merge pull request #831 from jberry-suse/obsolete-skip-superseded
unselect: filter superseded when using --cleanup.
2017-04-19 16:54:52 -05:00
Jimmy Berry
f79e35caeb stagingapi: correct project_status_build_percent() formula.
final: packages in final state (not final count ie total)
tobuild: packages remaining to build
2017-04-19 16:08:39 -05:00
Jimmy Berry
9135f91620 unselect: filter superseded when using --cleanup. 2017-04-19 14:55:42 -05:00
Jimmy Berry
446a30dde0 request_splitter: switch from build percentage to staging age for merge.
Using build percentage is sub-optimal since many events can reset the
percentage which can result in additional requests being merged into the
staging. A better metric is the time since the first request was added to
the staging (the age of the staging). Unfortunately, this is not trivial to
determine especially given that the original request may be superseded or
unstaged entirely. As such the datetime at which the staging was activated
is stored in the staging pseudometa. A max age is then used to allow for
merging up until that point.
2017-04-14 17:11:30 -05:00
Jimmy Berry
06d93b7344 stagingapi: get_open_requests() provide query_extra option. 2017-04-12 17:32:43 -05:00
Jimmy Berry
8109772372 stagingapi: get_open_requests(): replace query string with dictionary. 2017-04-12 17:32:38 -05:00
Jimmy Berry
27c0db5a78 stagingapi: rebuild_broken(): ignore unresolvable packages. 2017-04-10 23:24:12 -05:00
Jimmy Berry
043dad76db stagingapi: correct supersede call to IgnoreCommand. 2017-04-06 16:27:11 -05:00
Ludwig Nussel
37499194ce Merge pull request #783 from jberry-suse/select-move-deactivate
osc-staging: handle `select --move` cleanup of empty source project.
2017-04-05 18:22:35 +02:00
Ludwig Nussel
5eae68a0d9 Merge pull request #784 from jberry-suse/adi-accept-comment
adi: create accept comment to be consistent with letter stagings. (and cleanups)
2017-04-05 18:21:51 +02:00
Jimmy Berry
1dfa8d2568 stagingapi: provide accept_status_comment() based on accept command. 2017-03-28 23:01:33 -05:00
Jimmy Berry
5a2cd2dc9a osc-staging: handle select --move cleanup of empty source project.
- handle build disable in select command just like comment instead of
  stagingapi move_between_project() for consistency and to reduce double
  checking the same information via extra API calls
- build_switch_staging_project() provides target_flag parameter rather
  than trying to figure out flag value since caller has the context to
  know and again reduces API calls
- build_switch_staging_project() checking conditions are essentially
  checking if True is True since non-adi projects will always have ring
  packages or rings disabled entirely. The condition of interest is
  non-empty. Additionally adi projects are removed if empty so not a
  terribly useful distinction to make.
- provide helper update_status_or_deactivate() to handle common logic
  and replace in calling locations
2017-03-28 22:33:35 -05:00
Jimmy Berry
5185a7f569 stagingapi: invalidate get_open_requests() memoize cache after supersede. 2017-03-28 19:52:43 -05:00
Ludwig Nussel
a85e077925 Merge pull request #766 from jberry-suse/supersede-leap
refactor supersede logic and handle different source projects (additional cleanups)
2017-03-22 18:21:35 +01:00
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
e41c58cb3b stagingapi: refactor supersede logic and handle different source projects.
Primarily an issue for Leap in that requests originating from different
source projects may be submitted for the same package at once. Instead of
always superseding the previous request the request will only be
superseded if it originates from the same project.

If different sources md5s are found the request will be ignored and left
for manual review and an identical request will be declined.
2017-03-17 17:23:30 -05:00
Jimmy Berry
01868da548 stagingapi: do not attempt to supersede ignored requests. 2017-03-17 17:20:06 -05:00
Jimmy Berry
6669190e98 stagingapi: simplify finding action in superseded_request(). 2017-03-17 17:18:47 -05:00
Jimmy Berry
f5115930bc stagingapi: provide source_info_request() helper. 2017-03-17 17:17:58 -05:00
Jimmy Berry
8a33032c96 stagingapi: provide source_info() from ReviewBot. 2017-03-17 17:17:39 -05:00
Jimmy Berry
e1626db5e7 stagingapi: @memoize to get_ignored_requests() and get_open_requests().
Based on usage neither of these are refreshed during a single run, but
are called multiple times in function chains.
2017-03-17 17:16:49 -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
791d25046d stagingapi: correct spelling supseded_request() -> superseded_request(). 2017-03-16 18:33:40 -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