Skip to content

Commit 57252e4

Browse files
committed
feat(2397): no emojis
1 parent 2cb9045 commit 57252e4

4 files changed

Lines changed: 45 additions & 29 deletions

File tree

versions/models.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -233,18 +233,17 @@ def whats_new_items(self):
233233
"""Parse `whats_new` markdown bullets into a list of {title, description}
234234
dicts for the v3 release-highlights card.
235235
236-
Tolerant of the variants the LLM emits in practice:
237-
- `- 🆕 **New libraries** — sentence`
238-
- `* 🆕 **New libraries:** sentence`
239-
- `🆕 **New libraries:** sentence` (no leading marker)
240-
Trailing `:` inside the label is stripped; the emoji is required.
236+
Accepts the Markdown unordered-list bullets the LLM is instructed
237+
to emit; a leading ``-`` or ``*`` marker is required:
238+
- `- **New libraries** — sentence`
239+
- `* **New libraries:** sentence`
240+
Trailing `:` inside the label is stripped.
241241
"""
242242
if not self.whats_new:
243243
return []
244244
items = []
245245
bullet_re = re.compile(
246-
r"^\s*(?:[-*]\s+)?"
247-
r"(?P<emoji>\S+)\s+"
246+
r"^\s*[-*]\s+"
248247
r"\*\*(?P<label>[^*]+?)\*\*"
249248
r"\s*[:—–\-]?\s*"
250249
r"(?P<text>.+)$"
@@ -253,14 +252,13 @@ def whats_new_items(self):
253252
match = bullet_re.match(line)
254253
if not match:
255254
continue
256-
emoji = match.group("emoji").strip()
257255
label = match.group("label").strip().rstrip(":").strip()
258256
text = match.group("text").strip()
259257
if not text:
260258
continue
261259
items.append(
262260
{
263-
"title": f"{emoji} {label}".strip(),
261+
"title": label,
264262
"description": text,
265263
}
266264
)

versions/tasks.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -635,8 +635,11 @@ def skip_tag(name, new=False):
635635
636636
Rules:
637637
638-
Return a maximum of 5 bullets, each with an emoji, a bold category label,
638+
Return the output as a Markdown unordered list: every line must begin
639+
with "- " and there must be no other lines
640+
Return a maximum of 5 bullets, each with a bold category label,
639641
and a single sentence of no more than 20 words
642+
Do not use emoji anywhere in the output
640643
Do not name or highlight specific libraries — speak to the ecosystem as a whole
641644
Only include a bullet if there is relevant content in the release note to
642645
support it
@@ -651,8 +654,8 @@ def skip_tag(name, new=False):
651654
652655
Input: release note
653656
654-
Output: Return only the bullets. No preamble, no explanation,
655-
no additional commentary.
657+
Output: Return only the Markdown unordered list. No preamble, no
658+
explanation, no additional commentary.
656659
"""
657660
).strip()
658661

versions/tests/test_ai_tasks.py

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99

1010

1111
SAMPLE_OUTPUT = (
12-
"- 🆕 **New libraries** — Three new libraries broaden coverage of "
12+
"- **New libraries** — Three new libraries broaden coverage of "
1313
"scientific computing and modern C++ patterns.\n"
14-
"- **Performance improvements** — Compile-time and runtime gains "
14+
"- **Performance improvements** — Compile-time and runtime gains "
1515
"are reported across multiple core components.\n"
16-
"- 🔒 **Security & reliability** — Several stability and correctness "
16+
"- **Security & reliability** — Several stability and correctness "
1717
"fixes land in this release.\n"
1818
)
1919

@@ -111,11 +111,10 @@ def test_whats_new_items_parses_bullets(version):
111111

112112
items = version.whats_new_items
113113
assert len(items) == 3
114-
assert items[0]["title"].startswith("🆕")
115-
assert "New libraries" in items[0]["title"]
114+
assert items[0]["title"] == "New libraries"
116115
assert items[0]["description"].startswith("Three new libraries")
117-
assert items[1]["title"].startswith("⚡")
118-
assert items[2]["title"].startswith("🔒")
116+
assert items[1]["title"] == "Performance improvements"
117+
assert items[2]["title"] == "Security & reliability"
119118

120119

121120
@pytest.mark.django_db
@@ -129,29 +128,45 @@ def test_whats_new_items_ignores_non_bullet_lines(version):
129128
Version.objects.filter(pk=version.pk).update(
130129
whats_new=(
131130
"Some preamble that should be ignored.\n"
132-
"- 🆕 **New libraries** — One library added.\n"
131+
"- **New libraries** — One library added.\n"
133132
"Trailing line without bullet.\n"
134133
)
135134
)
136135
version.refresh_from_db()
137136
items = version.whats_new_items
138137
assert len(items) == 1
139-
assert items[0]["title"] == "🆕 New libraries"
138+
assert items[0]["title"] == "New libraries"
140139

141140

142141
@pytest.mark.django_db
143-
def test_whats_new_items_parses_dashless_colon_format(version):
144-
"""Real LLM output sometimes omits the bullet marker and puts the colon
145-
inside the bold label — the parser must accept that."""
142+
def test_whats_new_items_parses_colon_in_label(version):
143+
"""A colon inside the bold label is stripped; the bullet marker is
144+
still required."""
146145
Version.objects.filter(pk=version.pk).update(
147146
whats_new=(
148-
"📦 **New libraries:** One new library introduces open-method support.\n"
149-
" **Performance improvements:** Container redesigns deliver speed gains.\n"
147+
"- **New libraries:** One new library introduces open-method support.\n"
148+
"* **Performance improvements:** Container redesigns deliver speed gains.\n"
150149
)
151150
)
152151
version.refresh_from_db()
153152
items = version.whats_new_items
154153
assert len(items) == 2
155-
assert items[0]["title"] == "📦 New libraries"
154+
assert items[0]["title"] == "New libraries"
156155
assert items[0]["description"].startswith("One new library")
157-
assert items[1]["title"] == "⚡ Performance improvements"
156+
assert items[1]["title"] == "Performance improvements"
157+
158+
159+
@pytest.mark.django_db
160+
def test_whats_new_items_ignores_dashless_lines(version):
161+
"""Lines without a leading bullet marker are not list items and are
162+
skipped."""
163+
Version.objects.filter(pk=version.pk).update(
164+
whats_new=(
165+
"**New libraries:** This line has no bullet marker.\n"
166+
"- **Performance improvements** — This one does.\n"
167+
)
168+
)
169+
version.refresh_from_db()
170+
items = version.whats_new_items
171+
assert len(items) == 1
172+
assert items[0]["title"] == "Performance improvements"

versions/tests/test_commands.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def version_with_notes_and_summary(db):
3030
name="boost-1.85.0",
3131
active=True,
3232
fully_imported=True,
33-
whats_new="- 🆕 **New libraries** — already populated.",
33+
whats_new="- **New libraries** — already populated.",
3434
)
3535
baker.make(
3636
RenderedContent,

0 commit comments

Comments
 (0)