Make microanntate generator task upload the DB version to S3

This way, even if the task times out, we don't lose the work done so far.
N.B.: We'll need to also update the DB URLs, when the bugbug S3 bucket is made public.
This commit is contained in:
Marco Castelluccio 2020-02-12 13:43:37 +01:00
Родитель caa10dc2e8
Коммит 52a5a7335c
2 изменённых файлов: 7 добавлений и 1 удалений

Просмотреть файл

@ -38,6 +38,7 @@ tasks:
scopes:
- "docker-worker:cache:bugbug-mercurial-repository"
- "secrets:get:project/relman/bugbug/production"
- "auth:aws-s3:read-write:communitytc-bugbug/*"
routes:
- notify.email.release-mgmt-analysis@mozilla.com.on-failed
- notify.irc-channel.#bugbug.on-failed
@ -77,6 +78,7 @@ tasks:
scopes:
- "docker-worker:cache:bugbug-mercurial-repository"
- "secrets:get:project/relman/bugbug/production"
- "auth:aws-s3:read-write:communitytc-bugbug/*"
routes:
- notify.email.release-mgmt-analysis@mozilla.com.on-failed
- notify.irc-channel.#bugbug.on-failed
@ -117,6 +119,7 @@ tasks:
scopes:
- "docker-worker:cache:bugbug-mercurial-repository"
- "secrets:get:project/relman/bugbug/production"
- "auth:aws-s3:read-write:communitytc-bugbug/*"
routes:
- notify.email.release-mgmt-analysis@mozilla.com.on-failed
- notify.irc-channel.#bugbug.on-failed

Просмотреть файл

@ -9,7 +9,7 @@ import tenacity
from microannotate import generator
from bugbug import db, repository
from bugbug.utils import ThreadPoolExecutorResult, get_secret
from bugbug.utils import ThreadPoolExecutorResult, get_secret, upload_s3
basicConfig(level=INFO)
logger = getLogger(__name__)
@ -90,6 +90,9 @@ class MicroannotateGenerator(object):
stop=tenacity.stop_after_attempt(5),
)()
# We are not using db.upload as we don't need to upload the git repo.
upload_s3([f"{db_path}.version"])
def init_git_repo(self):
subprocess.run(["git", "init", self.git_repo_path], check=True)