SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit ff31142b authored by George Katsikas's avatar George Katsikas :goat:
Browse files

add event to production stream on repo creation

fix skipping streams if they are in stasis
parent f95e9ae8
No related branches found
No related tags found
No related merge requests found
...@@ -23,7 +23,7 @@ import tarfile ...@@ -23,7 +23,7 @@ import tarfile
from base64 import b64encode from base64 import b64encode
from production.models import ProofsRepository from production.models import ProofsRepository, ProductionUser, ProductionEvent
class Command(BaseCommand): class Command(BaseCommand):
...@@ -144,6 +144,15 @@ class Command(BaseCommand): ...@@ -144,6 +144,15 @@ class Command(BaseCommand):
} }
) )
# Add event to the production stream
if system_user := ProductionUser.objects.get(user__username="system"):
ProductionEvent.objects.create(
stream=repo.stream,
event="status",
comments=f"Created git repository for proofs.",
noted_by=system_user,
)
self.stdout.write( self.stdout.write(
self.style.SUCCESS(f"Created git repository at {repo.git_path}") self.style.SUCCESS(f"Created git repository at {repo.git_path}")
) )
...@@ -498,9 +507,11 @@ class Command(BaseCommand): ...@@ -498,9 +507,11 @@ class Command(BaseCommand):
# Create the repos # Create the repos
repos_to_be_created = repos.filter( repos_to_be_created = repos.filter(
status=ProofsRepository.PROOFS_REPO_UNINITIALIZED status=ProofsRepository.PROOFS_REPO_UNINITIALIZED
stream__in_stasis=False
) )
for repo in repos_to_be_created: for repo in repos_to_be_created:
# Skip repos whose streams that are in stasis
if repo.stream.in_stasis:
continue
try: try:
self._create_git_repo(repo) self._create_git_repo(repo)
repo.status = ProofsRepository.PROOFS_REPO_CREATED repo.status = ProofsRepository.PROOFS_REPO_CREATED
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment