From e82d4a1b9d40d098b6fa079b5e88e1d302f40ef4 Mon Sep 17 00:00:00 2001 From: Thomas Carmet Date: Fri, 14 Jul 2023 19:50:58 +0000 Subject: [PATCH] PTFE-600 fixing imports and settings --- README.md | 2 +- bert_e/server/__init__.py | 2 -- charts/bert-e/templates/secrets.yaml | 2 +- manifests/base/secrets.env | 2 +- settings.sample.yml | 6 +++--- setup.py | 13 ++----------- tox.ini | 6 ++++-- 7 files changed, 12 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 8b8cdcc4..bb49c5c7 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ All above instructions will assume you are inside the codespace environment ```shell $ cp settings.sample.yml settings.yml # Configure settings.yml to your liking -$ tox -e run +$ tox run -e run ``` ### Run local tests diff --git a/bert_e/server/__init__.py b/bert_e/server/__init__.py index ec30ec6b..4b5ec562 100644 --- a/bert_e/server/__init__.py +++ b/bert_e/server/__init__.py @@ -40,8 +40,6 @@ def setup_bert_e(settings_file, debug): """Create and configure Bert-E instance.""" settings = setup_settings(settings_file) - settings['robot_password'] = os.environ['BERT_E_GITHOST_PWD'] - settings['jira_token'] = os.environ['BERT_E_JIRA_TOKEN'] settings['backtrace'] = True bert_e = BertE(settings) diff --git a/charts/bert-e/templates/secrets.yaml b/charts/bert-e/templates/secrets.yaml index 0e0a16d3..22ed8a71 100644 --- a/charts/bert-e/templates/secrets.yaml +++ b/charts/bert-e/templates/secrets.yaml @@ -10,7 +10,7 @@ metadata: heritage: "{{ .Release.Service }}" type: Opaque data: - BERT_E_GITHOST_PWD: {{ .Values.bertE.robot.password | b64enc | quote }} + BERT_E_ROBOT_PASSWORD: {{ .Values.bertE.robot.password | b64enc | quote }} WEBHOOK_LOGIN: {{ .Values.bertE.webhook.username | b64enc | quote }} WEBHOOK_PWD: {{ .Values.bertE.webhook.password | b64enc | quote }} BERT_E_JIRA_TOKEN: {{ .Values.bertE.jira.token | b64enc | quote }} diff --git a/manifests/base/secrets.env b/manifests/base/secrets.env index 06ee6893..d5950a60 100644 --- a/manifests/base/secrets.env +++ b/manifests/base/secrets.env @@ -1,6 +1,6 @@ BERT_E_CLIENT_SECRET=vault:secret/data/bert-e#BERT_E_GITHUB_OAUTH_CLIENT_SECRET BERT_E_CLIENT_ID=vault:secret/data/bert-e#BERT_E_GITHUB_OAUTH_CLIENT_ID -BERT_E_GITHOST_PWD=vault:secret/data/bert-e#BERT_E_GITHUB_TOKEN +BERT_E_ROBOT_PASSWORD=vault:secret/data/bert-e#BERT_E_GITHUB_TOKEN BERT_E_GITHUB_TOKEN=vault:secret/data/bert-e#BERT_E_GITHUB_TOKEN BERT_E_JIRA_TOKEN=vault:secret/data/bert-e#BERT_E_JIRA_TOKEN BERT_E_JIRA_USER=vault:secret/data/bert-e#BERT_E_JIRA_USERNAME diff --git a/settings.sample.yml b/settings.sample.yml index 4ad03481..16581a5c 100644 --- a/settings.sample.yml +++ b/settings.sample.yml @@ -5,20 +5,20 @@ frontend_url: https://bert-e.mydomain.com/bitbucket/my_company/my_repository/ber # repository_host [MANDATORY]: # The git hosting provider for the repository. Either bitbucket or github. -repository_host: bitbucket +repository_host: github # repository_owner [MANDATORY]: # The name of the owner of the Bitbucket/GitHub repository to work on # # (a.k.a. Bitbucket team or GitHub organization) # -repository_owner: my_company +repository_owner: scality # repository_slug [MANDATORY]: # The slug of the Bitbucket/GitHub repository to work on # -repository_slug: my_repository +repository_slug: bert-e # robot [MANDATORY]: diff --git a/setup.py b/setup.py index 8b20e4e8..b8fb6deb 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ import os import pip -from setuptools import setup +from setuptools import setup, find_packages # Besides not advised, @@ -44,16 +44,7 @@ def requires(): url='https://github.com/scality/bert-e', license='Apache', include_package_data=True, - packages=[ - 'bert_e', - 'bert_e.jobs', - 'bert_e.lib', - 'bert_e.bin', - 'bert_e.git_host', - 'bert_e.git_host.github', - 'bert_e.workflow', - 'bert_e.workflow.gitwaterflow', - ], + packages=find_packages(), install_requires=requires(), entry_points={ 'console_scripts': [ diff --git a/tox.ini b/tox.ini index 4c12ce3e..fe883985 100644 --- a/tox.ini +++ b/tox.ini @@ -69,11 +69,13 @@ commands = coverage html [testenv:run] -passenv = BERT_E_* WEBHOOK_* +passenv = + BERT_E_* + WEBHOOK_* setenv = BERT_E_CLIENT_SECRET = {env:BERT_E_CLIENT_SECRET:'bert_e_client_secret'} BERT_E_CLIENT_ID = {env:BERT_E_CLIENT_ID:'bert_e_client_id'} - BERT_E_GITHOST_PWD = {env:GITHUB_TOKEN} + BERT_E_ROBOT_PASSWORD = {env:GITHUB_TOKEN} BERT_E_JIRA_TOKEN = {env:BERT_E_JIRA_TOKEN:'jira_token'} WEBHOOK_LOGIN = {env:WEBHOOK_LOGIN:'webhook'} WEBHOOK_PWD = {env:WEBHOOK_PWD:'webhook'}