54 Commits

Author SHA1 Message Date
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
Ludwig Nussel
26ac754a0a Include review message in verbose output 2016-06-10 10:59:36 +02:00
Ludwig Nussel
d16194caea Use decline message also on fallback
In fallback mode the bot would laccept a request on failure. It should also put the failure message in that case.
2016-06-07 15:12:02 +02:00
Ludwig Nussel
e4ab75ce7d Implement default action
The default action can be reimplemented by bots to e.g. auto fail or
auto accept.
2016-06-01 13:59:35 +02:00
Ludwig Nussel
ee9c194301 Fix review-mode
setup_checker gets reimplemented in subclasses. So implement the
review-mode in a way that doesn't require every bot to copy the code
2016-03-17 16:16:36 +01:00
Ludwig Nussel
f6c5d55eeb Fix review concerns 2016-03-10 14:08:38 +01:00
Ludwig Nussel
fcdc95ca16 Implement configurable review mode
The new parameter --review-mode allows to specify how the review bot should handle obs reviews

normal: accept review if check is good, decline if bad
no: don't accept or decline requests
accept: always accept review, even if check fails
fallback-onfail: accept review and set other user or group as review if check fails
fallback-always: always accept review and set other user or group as reviewer afterwards
2016-03-09 14:21:48 +01:00
Ludwig Nussel
1106da20cc move by project function to ReviewBot 2015-11-23 16:09:22 +01:00
Ludwig Nussel
152800dd6a configure level in global logger
when the level is in the global logger other modules that also use
logging inherit it.
2015-11-23 16:08:39 +01:00
Ludwig Nussel
575cfeb9ed reset list of requests on each run 2015-10-05 10:49:45 +02:00
Ludwig Nussel
efbcd75064 move check by project function to ReviewBot 2015-09-29 08:44:30 +02:00
6f7e3f2a02 Fixes the logic error in checkTagNotRequired() 2015-07-09 20:04:31 +08:00
Ludwig Nussel
7cbedd5e19 patchinfos have no release project! 2015-05-28 13:08:36 +02:00
Ludwig Nussel
e69a762f4d runner function for intervals 2015-05-28 13:08:29 +02:00
Ludwig Nussel
8c75e543e1 include request id in log 2015-05-28 13:08:15 +02:00
Ludwig Nussel
237fbd4b71 properly call parent function get_optparser 2015-05-28 13:07:51 +02:00
Ludwig Nussel
47b09f6601 fix maintenance incident request handling 2015-05-28 13:07:11 +02:00
Ludwig Nussel
d5ce84929d introduce DEFAULT_REVIEW_MESSAGES for easier reset to default 2015-05-28 13:06:50 +02:00
Ludwig Nussel
70536d74c7 use memoize to cache source info
used by get_originproject
2015-05-28 13:06:10 +02:00
Ludwig Nussel
a4bf2657d4 refactor _get_verifymd5 to get_sourceinfo 2015-05-28 13:04:08 +02:00
Stephan Kulow
2219c51a30 check group in can_accept_review 2015-03-27 15:12:52 +01:00