Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions ymir/agents/backport_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -815,8 +815,6 @@ async def extract_source_changelog(
continue

for line in entry.content:
if re.match(r"^\s*[-\*]?\s*(resolves|related):", line, re.IGNORECASE):
continue
if line not in seen:
seen.add(line)
collected_lines.append(line)
Comment on lines 818 to 820
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Removing the filtering of Resolves/Related lines while maintaining the seen deduplication logic can lead to malformed changelogs when multiple commits are combined. If different commits have different JIRA references, all of them will be collected. For example, combining two commits might result in a list like this being passed to the LogAgent:

- Fix feature A
- Resolves: RHEL-1
- Fix feature B
- Resolves: RHEL-2

When the LogAgent processes this with the instruction to "Only replace... with <JIRA_ISSUES>", it will likely produce multiple identical Resolves lines for the current JIRA (e.g., two - Resolves: RHEL-3 lines), which is incorrect for RPM changelogs. Consider either continuing to strip these lines here or updating the LogAgent instructions to handle consolidation.

Expand Down
4 changes: 2 additions & 2 deletions ymir/agents/log_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ def get_instructions() -> str:

If a source changelog message is provided in the prompt, use those lines as the
exact changelog message content. Keep the descriptive lines exactly as-is — do not
rephrase, summarize, or add to them. Add the Resolves/Related line
for <JIRA_ISSUES>, matching the style of existing changelog entries.
rephrase, summarize, or add to them. Only replace the Jira issue references
in any Resolves/Related lines with <JIRA_ISSUES>.
Comment on lines +46 to +47
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The updated instructions for the LogAgent when a source_changelog is provided introduce several risks:

  1. Missing Resolves line: If the source changelog doesn't happen to contain a Resolves or Related line, the agent is not explicitly instructed to add one, which could result in an invalid RHEL changelog entry.
  2. Redundant lines: As noted in the backport_agent.py review, combining multiple source commits can lead to multiple Resolves lines. The "Only replace" instruction doesn't account for consolidating them into a single line.
  3. Incomplete swapping: JIRA references within descriptive lines (e.g., - Fix bug (RHEL-123)) are not covered by the "Resolves/Related lines" restriction and will remain in the output, causing inconsistency.

Consider refining the instructions to ensure a single, consolidated Resolves line is present at the end, while still preserving the descriptive content.


If no source changelog message is provided, write a new entry. In general,
the entry should contain a short summary of the changes, ideally fitting on a single line,
Expand Down
Loading