Added github config options

2 new options were added:

* github_user
* github_password

Github allows only 60 requests per hour for unauthenticated requests
Sometimes it is not enough.
The limit for registered users is 5000 requests per hour.
New options were added to handle requests limit.

Change-Id: I6813b80a6612f19a43646dc14e1e6110f5753c5e
This commit is contained in:
Sergey Nikitin 2019-03-09 18:11:24 +04:00
parent ab22641d51
commit dd8a60ffad
4 changed files with 19 additions and 1 deletions

View File

@ -17,6 +17,8 @@ usage: stackalytics-processor [-h] [--config-dir DIR] [--config-file PATH]
[--sources-root SOURCES_ROOT]
[--ssh-key-filename SSH_KEY_FILENAME]
[--ssh-username SSH_USERNAME]
[--github-login GITHUB_LOGIN]
[--github-password GITHUB_PASSWORD]
[--syslog-log-facility SYSLOG_LOG_FACILITY]
[--translation-team-uri TRANSLATION_TEAM_URI]
[--use-journal] [--use-syslog]
@ -89,6 +91,10 @@ optional arguments:
SSH key for gerrit review system access
--ssh-username SSH_USERNAME
SSH username for gerrit review system access
--github-login GITHUB_LOGIN
Login for github access (string value)
--github-password GITHUB_PASSWORD
Password for github access
--syslog-log-facility SYSLOG_LOG_FACILITY
Syslog facility to receive log lines. This option is
ignored if log_config_append is set.

View File

@ -185,3 +185,9 @@
# How many times to retry after Gerrit errors (integer value)
#gerrit_retry = 10
# Login for github access (string value)
#github_login = login
# Password for github access (string value)
#github_password = password

View File

@ -46,6 +46,10 @@ PROCESSOR_OPTS = [
help='SSH key for gerrit review system access'),
cfg.StrOpt('ssh-username', default='user',
help='SSH username for gerrit review system access'),
cfg.StrOpt('github-login', default=None,
help='Login for github access'),
cfg.StrOpt('github-password', default=None,
help='Password for github access'),
cfg.StrOpt('translation-team-uri',
default='https://git.openstack.org/cgit/openstack/i18n/'
'plain/tools/zanata/translation_team.yaml',

View File

@ -102,7 +102,9 @@ def _retrieve_project_list_from_gerrit(project_source):
def _retrieve_project_list_from_github(project_source):
LOG.info('Retrieving project list from GitHub')
github = MainClass.Github(timeout=60)
github = MainClass.Github(timeout=60,
login_or_token=CONF.github_login,
password=CONF.github_password)
organization = project_source['organization']
LOG.debug('Get list of projects for organization %s', organization)