Skip to content

Commit f705f9a

Browse files
committed
Add pipeline resilience and frontend work
1 parent 9060f6f commit f705f9a

59 files changed

Lines changed: 1295 additions & 286 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
from django.db import migrations, models
2+
3+
4+
class Migration(migrations.Migration):
5+
dependencies = [
6+
("content", "0002_content_newsletter_promotion"),
7+
]
8+
9+
operations = [
10+
migrations.AddField(
11+
model_name="content",
12+
name="pipeline_state",
13+
field=models.CharField(
14+
choices=[
15+
("pending", "Pending"),
16+
("processing", "Processing"),
17+
("completed", "Completed"),
18+
("awaiting_review", "Awaiting Review"),
19+
("archived", "Archived"),
20+
("duplicate", "Duplicate"),
21+
],
22+
db_index=True,
23+
default="pending",
24+
max_length=32,
25+
),
26+
),
27+
]

‎content/models.py‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@ class FeedbackType(models.TextChoices):
1111
DOWNVOTE = "downvote", "Downvote"
1212

1313

14+
class ContentPipelineState(models.TextChoices):
15+
"""High-level processing state for one content item in the AI pipeline."""
16+
17+
PENDING = "pending", "Pending"
18+
PROCESSING = "processing", "Processing"
19+
COMPLETED = "completed", "Completed"
20+
AWAITING_REVIEW = "awaiting_review", "Awaiting Review"
21+
ARCHIVED = "archived", "Archived"
22+
DUPLICATE = "duplicate", "Duplicate"
23+
24+
1425
class Content(models.Model):
1526
"""Stores an ingested content item that may appear in a newsletter."""
1627

@@ -47,6 +58,12 @@ class Content(models.Model):
4758
duplicate_signal_count = models.IntegerField(default=0)
4859
is_reference = models.BooleanField(default=False)
4960
is_active = models.BooleanField(default=True)
61+
pipeline_state = models.CharField(
62+
max_length=32,
63+
choices=ContentPipelineState.choices,
64+
default=ContentPipelineState.PENDING,
65+
db_index=True,
66+
)
5067
newsletter_promotion_at = models.DateTimeField(null=True, blank=True)
5168
newsletter_promotion_by = models.ForeignKey(
5269
settings.AUTH_USER_MODEL,

0 commit comments

Comments
 (0)