This repository has been archived by the owner on Nov 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into restart-workflow-data-loss
- Loading branch information
Showing
24 changed files
with
1,115 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,7 +51,7 @@ jobs: | |
-v "$(pwd)"/tests:/opt/airflow/tests | ||
-v "$(pwd)"/requirements-test.txt:/opt/airflow/requirements-test.txt | ||
-v "$(pwd)"/data:/opt/airflow/data | ||
-v "$(pwd)"/scripts/variables/variables.json:/opt/airflow/variables.json | ||
-v "$(pwd)"/scripts:/opt/airflow/scripts | ||
-e AIRFLOW__CORE__EXECUTOR=CeleryExecutor | ||
-e AIRFLOW__DATABASE__SQL_ALCHEMY_CONN=postgresql+psycopg2://airflow:[email protected]:5432/airflow | ||
-e AIRFLOW__CELERY__RESULT_BACKEND=db+postgresql://airflow:[email protected]:5432/airflow | ||
|
@@ -61,4 +61,4 @@ jobs: | |
-e AIRFLOW__CORE__LOAD_EXAMPLES="false" | ||
-e AIRFLOW__API__AUTH_BACKENDS="airflow.api.auth.backend.basic_auth,airflow.api.auth.backend.session" | ||
registry.cern.ch/cern-sis/inspire/workflows@${{ needs.build.outputs.image-id }} | ||
bash -c "pip install -r requirements-test.txt && airflow db init && airflow variables import /opt/airflow/variables.json && pytest /opt/airflow/tests" | ||
bash -c "pip install -r requirements-test.txt && airflow db init && airflow connections import /opt/airflow/scripts/connections/connections.json && airflow variables import /opt/airflow/scripts/variables/variables.json && pytest /opt/airflow/tests" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from backoffice.workflows.api.serializers import DecisionSerializer | ||
|
||
|
||
def add_decision(workflow_id, user, action): | ||
serializer_class = DecisionSerializer | ||
data = {"workflow": workflow_id, "user": user, "action": action} | ||
|
||
serializer = serializer_class(data=data) | ||
if serializer.is_valid(raise_exception=True): | ||
serializer.save() | ||
return serializer.data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
backoffice/backoffice/workflows/migrations/0009_decision.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Generated by Django 4.2.6 on 2024-08-15 12:25 | ||
|
||
import django.db.models.deletion | ||
from django.conf import settings | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
("workflows", "0008_alter_workflow_status_alter_workflow_workflow_type"), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="Decision", | ||
fields=[ | ||
( | ||
"id", | ||
models.BigAutoField( | ||
auto_created=True, | ||
primary_key=True, | ||
serialize=False, | ||
verbose_name="ID", | ||
), | ||
), | ||
( | ||
"action", | ||
models.CharField( | ||
choices=[ | ||
("accept", "author_create_approved_dag"), | ||
("reject", "author_create_rejected_dag"), | ||
("accept_curate", "author_create_approved_dag"), | ||
], | ||
max_length=30, | ||
), | ||
), | ||
("_created_at", models.DateTimeField(auto_now_add=True)), | ||
("_updated_at", models.DateTimeField(auto_now=True)), | ||
( | ||
"user", | ||
models.ForeignKey( | ||
db_column="email", | ||
on_delete=django.db.models.deletion.CASCADE, | ||
to=settings.AUTH_USER_MODEL, | ||
to_field="email", | ||
), | ||
), | ||
( | ||
"workflow", | ||
models.ForeignKey( | ||
on_delete=django.db.models.deletion.CASCADE, | ||
to="workflows.workflow", | ||
), | ||
), | ||
], | ||
), | ||
] |
Oops, something went wrong.