174 Commits

Author SHA1 Message Date
Jimmy Berry
c71e075396 Merge pull request #1088 from jberry-suse/ReviewBot-only_replace
repo_checker: post passed comment only if previous failed comment (and debug improvements).
2017-08-24 20:48:59 -05:00
Jimmy Berry
ebd2f580ec ReviewBot: comment_write(): provide only_replace option. 2017-08-23 15:19:36 -05:00
Jimmy Berry
ca13855d2e ReviewBot: comment_write(): pull dryrun protected bit out individually. 2017-08-23 15:17:44 -05:00
Jimmy Berry
757d31cf35 ReviewBot: comment_write(): place debug_key at the end for consistency. 2017-08-23 15:15:02 -05:00
Jimmy Berry
f88e8a9297 ReviewBot: simplify logger format.
The output is rather verbose, especially inside journals, and not terribly
helpful.
2017-08-23 15:00:33 -05:00
Jimmy Berry
164b04903c ReviewBot: add_review(): remove left-over print() line. 2017-08-18 17:35:05 -05:00
Jimmy Berry
d565f46123 ReviewBot: get_devel_project(): correct error handling to only allow 404.
The original intent was clearly to allow 404 (package does not exist for
new packages), but crash on anything else. Instead it consumes all
exceptions and does nothing different even with the e.code condition.
2017-08-18 17:34:32 -05:00
Jimmy Berry
078ec68697 ReviewBot: add_review(): provide allow_duplicate parameter and default of False.
Also update calls based on default behavior change. As described in the
comment above add_review() there seems to be no reason to ever add a
duplicate review.

The check in leaper would skip unless state == declined. In such a case
the review would automatically be reopened along with the request so that
logic is unnecessary.
2017-08-15 22:18:53 -05:00
Jimmy Berry
ef93709e16 ReviewBot: add_review(): raise exception instead of returning boolean.
This ensures that calling bots crash rather than continue which can cause
non-atomic state changes that miss reviews when OBS crashes or is
unavailable.
2017-08-15 21:43:02 -05:00
Jimmy Berry
9443c3de04 ReviewBot: comment_write(): include target in debug message when too similar. 2017-08-04 13:32:07 -05:00
Jimmy Berry
cfbd479ed7 ReviewBot: comment_write(): support package. 2017-08-02 21:35:16 -05:00
Jimmy Berry
03c46f18d7 ReviewBot: provide staging_api() from repo_checker. 2017-07-18 17:06:37 -05:00
Jimmy Berry
4bc130a927 ReviewBot: comment_write(): provide identical option to allow for stricter matching. 2017-07-12 15:31:30 -05:00
Jimmy Berry
dc7e3659a4 ReviewBot: comment_write(): support writing to project. 2017-07-12 15:31:30 -05:00
Jimmy Berry
3f16de02b3 ReviewBot: include comment in __default handler if comments enabled. 2017-07-12 15:31:30 -05:00
Jimmy Berry
96d51b5ad8 ReviewBot: load requests with withfullhistory to allow for review analysis. 2017-07-12 15:31:30 -05:00
Jimmy Berry
060b50f072 ReviewBot: add comment_handler option and use in leaper. 2017-07-12 15:31:30 -05:00
Jimmy Berry
2c1a21704d ReviewBot: copy default review messages before each review. 2017-07-12 15:31:30 -05:00
Jimmy Berry
3b1c11f45c ReviewBot: provide only_one_action option and use in leaper and check_source. 2017-07-12 15:31:30 -05:00
Jimmy Berry
7bcf94a35f ReviewBot: provide request_default_return option and use in leaper. 2017-07-12 15:31:30 -05:00
518b52060b
ReviewBot: add missing yaml import for loading config file. 2017-06-23 17:07:23 +02:00
Stephan Kulow
9a418f780f
Extract patchinfo check into a function 2017-06-08 12:49:39 +02:00
Ludwig Nussel
be7c3e7c3e Handle multiple patchinfos 2017-04-28 11:50:32 +02:00
Jimmy Berry
fdbe793585 ReviewBot: always remove previous comment regardless of the state. 2017-04-25 13:38:57 -05:00
Ludwig Nussel
138a92e7f5 Add comment when adding fallback reviewer 2017-03-14 13:50:37 +01:00
Jimmy Berry
47459ccb29 CommentAPI: provide comment_find() and add_marker() from ReviewBot. 2017-03-10 00:09:27 -06:00
Stephan Kulow
f8e5662161 Do not craft encoded URL with a light heart 2017-03-03 15:16:59 -06:00
Ludwig Nussel
c6f4f4472e Merge pull request #693 from jberry-suse/leaper-unhandled
ReviewBot & leaper: provide deduplicate method for leaper comment (and other fixes)
2017-02-17 14:08:20 +01:00
Jimmy Berry
87cb5c2ab0 ReviewBot: drop duplicate import namedtuple. 2017-02-15 10:01:36 -06:00
Jimmy Berry
748fce38cc ReviewBot & leaper: provide deduplicate method for leaper comment.
Otherwise, leaper will indicate an unhandled request twice.
2017-02-15 10:01:20 -06:00
Jimmy Berry
23d4a7a6a5 ReviewBot: check_action__default() should return None not set ret. 2017-02-15 09:44:31 -06:00
Jimmy Berry
de9f94cae5 ReviewBot: extract __class__.__name__ as default for self.bot_name.
Allow future bots to change the name used to represent the bot.
2017-02-15 07:55:35 -06:00
Jimmy Berry
015d59cdc7 ReviewBot: refactor leaper comment from log functionality.
Simple interface:
- comment_handler_add(): Add handler to start recording log messages
  for comment.
- comment_write(): Write comment from log messages if not similar to
  previous comment.

See leaper.py for example usage.
2017-02-10 15:58:57 -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
aecf680f87 Implment configurable submit request references
sr# only works within the same instance. Requests referenced in a
different instance need a different prefix.
2017-02-01 11:20:27 +01:00
Jimmy Berry
60559a1f6d ReviewBot: get_devel_project() only pass on 404. 2017-01-31 20:15:52 -06:00
Jimmy Berry
604734b0f3 Provide ReviewBot.ibs to indicate if running against IBS. 2017-01-17 20:57:06 -06:00
Ludwig Nussel
7b8e003521 Make config defaults a class variable 2017-01-13 15:36:34 +01:00
Ludwig Nussel
dd26743202 Fetch request info from different api url 2017-01-11 17:43:11 +01:00
Jimmy Berry
8db3461a00 Port osc-check_source.py to ReviewBot as check_source.py.
In the process of porting many improvements and bug fixes were added. Usage
follows the standard ReviewBot format and allows for new execution styles,
but the following examples replicate previous usage.

# Review all requests assigned to factory-auto.
./check_source.py --group factory-auto review

# Review request 13370.
./check_source.py --group factory-auto id 13370

# --project translates to project command.
# No longer automatically includes $project:NonFree.
./check_source.py --group factory-auto project openSUSE:Factory

New options available are:

--ignore-devel          ignore devel projects for target package
--devel-whitelist=FILE  file containing whitelisted projects (one per line)
--review-team=GROUP     review team group added to requests with > 8 diff
--repo-checker=USER     repo checker user added after accepted review

Note that --ignore-devel used to be provided as env[IGNORE_DEVEL_PROJECTS].

Some highlights about what was cleaned up:
- cryptic variable names replaced
- replaced custom osc queries with osc.core calls where applicable
- removed the need to load package information for all packages within
  target project which cuts runtime in half for single review
- removed extraneous code that performed extra steps for no reason
  os.path.dirname(os.path.realpath(__file__.replace('.pyc', '.py')))
  os.path.dirname(os.path.realpath(__file__))
  and _checker_prepare_dir() which needlessly chdir() twice.
- one logic branch failed to cleanup checkout directory
- new flags provide additional flexibility
2017-01-10 19:33:41 -06:00
Jimmy Berry
0ec78beb93 Remove duplicate ReviewBot.do_project(). (#621) 2017-01-02 09:37:35 +01:00
Jimmy Berry
7431af4a72 Rework ReviewBot.CommandLineInterface to provide class option. (#622)
Alleviates the need for a lot of duplicate code, some of which is already
out-of-sync.
2017-01-02 09:34:13 +01:00
Jimmy Berry
c739687ac0 Remove duplicate ReviewBot.set_request_ids_project() (#620) 2017-01-02 09:24:34 +01:00
Ludwig Nussel
8132a6c5b1 Add clarifying comment 2016-08-24 16:46:57 +02:00
Ludwig Nussel
44b2741baa Merge pull request #545 from openSUSE/schedule_test_updates
Schedule test updates
2016-08-08 10:19:09 +02:00
Wolfgang Engel
db92adffd7 Ignore package patchinfo for checking 2016-08-05 15:16:39 +02:00
Stephan Kulow
d03e4f940a Implement accept-onpass review mode
For maintenance we want to have the openqa review open until the tests
are fixed - and only humans decline
2016-08-05 07:41:30 +02:00
Ludwig Nussel
b6c37df2be Change debug message it info message
for consistency with other messages
2016-07-29 10:29:38 +02:00
Stephan Kulow
cce9cf3c6a Trigger the repo runs independent of the reviews
Just use the generated build number while fetching openqa jobs. This way
we can trigger test runs even if there are no incidents to review to
verify the tests still work on maintained products
2016-07-28 15:26:14 +02:00
Ludwig Nussel
b5bafc4299 Log exception with traceback
Helps to find place where the loop dies
2016-06-17 10:59:29 +02:00