SciPost Code Repository
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SciPost
Manage
Activity
Members
Labels
Plan
Issues
118
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SciPost
SciPost
Commits
ff31142b
Commit
ff31142b
authored
1 year ago
by
George Katsikas
Browse files
Options
Downloads
Patches
Plain Diff
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
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scipost_django/production/management/commands/advance_git_repos.py
+13
-2
13 additions, 2 deletions
...jango/production/management/commands/advance_git_repos.py
with
13 additions
and
2 deletions
scipost_django/production/management/commands/advance_git_repos.py
+
13
−
2
View file @
ff31142b
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment