Skip to content

Post rebase and rebuild failure feedback to Jira on the final retry - #611

Merged
majamassarini merged 3 commits into
packit:mainfrom
majamassarini:rebase-rebuild-final-retry-error-comment
Jun 22, 2026
Merged

majamassarini merged 3 commits into
packit:mainfrom
majamassarini:rebase-rebuild-final-retry-error-comment

Conversation

@majamassarini

Copy link
Copy Markdown
Member

Apply the same error feedback pattern from PR #603 to the rebase and rebuild agents. When a task crashes (exception path) and exhausts all retries, post the error message to Jira if the task was user-triggered.

This ensures users get feedback for unexpected crashes that never reach the workflow's comment_in_jira step. Graceful failures (workflow-level) already post comments via the workflow, so we skip comment_text there to avoid double-commenting.

Related: #603

Assisted-by: Claude Sonnet 4.5 noreply@anthropic.com

Apply the same error feedback pattern from PR packit#603 to the rebase and
rebuild agents. When a task crashes (exception path) and exhausts all
retries, post the error message to Jira if the task was user-triggered.

This ensures users get feedback for unexpected crashes that never reach
the workflow's comment_in_jira step. Graceful failures (workflow-level)
already post comments via the workflow, so we skip comment_text there
to avoid double-commenting.

Related: packit#603

Assisted-by: Claude Sonnet 4.5 <noreply@anthropic.com>

@gemini-code-assist gemini-code-assist Bot left a comment

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.

Code Review

This pull request updates both rebase_agent.py and rebuild_agent.py to post a final failure feedback comment to Jira when a user-triggered run exhausts all retry attempts on a crash path, while avoiding double-commenting on graceful failure paths. The reviewer suggested deduplicating the list of Jira issues in rebuild_agent.py using dict.fromkeys() to prevent posting duplicate comments on the same issue.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread ymir/agents/rebuild_agent.py Outdated
Use dict.fromkeys() to deduplicate all iterations over
rebuild_data.all_jira_issues and all_issues to prevent:
- Posting duplicate comments on the same issue
- Redundant label updates on the same issue
- Triggering multiple email notifications to stakeholders

This is a defensive measure to handle edge cases where the issue list
might inadvertently contain duplicates.

Assisted-by: Claude Sonnet 4.5 <noreply@anthropic.com>
@majamassarini

Copy link
Copy Markdown
Member Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

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.

Code Review

This pull request adds final failure feedback reporting to Jira for both the rebase and rebuild agents during user-triggered runs, and deduplicates Jira issue keys in the rebuild agent to prevent redundant operations. A critical feedback item was raised regarding the rebase agent, where a plain string is passed to the retry function on graceful failure instead of a serialized ErrorData JSON object, which could lead to downstream parsing errors in the Redis error queue.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread ymir/agents/rebase_agent.py Outdated
@majamassarini

Copy link
Copy Markdown
Member Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

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.

Code Review

This pull request updates the backport, rebase, and rebuild agents to improve retry logic, deduplicate Jira issue keys using dict.fromkeys, and post final failure feedback to Jira once the final retry attempt is exhausted. The review feedback highlights two critical issues in backport_agent.py and rebase_agent.py where instantiating ErrorData with potentially None error values inside an else block could raise an unhandled AttributeError or Pydantic ValidationError, leading to a worker process crash. Code suggestions have been provided to robustly handle these cases with fallback values.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread ymir/agents/backport_agent.py
Comment thread ymir/agents/rebase_agent.py
@majamassarini
majamassarini force-pushed the rebase-rebuild-final-retry-error-comment branch from 46cc5a0 to e68e962 Compare June 19, 2026 12:34
@majamassarini

Copy link
Copy Markdown
Member Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

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.

Code Review

This pull request improves error handling, retry mechanisms, and Jira notifications across the backport, rebase, and rebuild agents. It introduces structured ErrorData serialization, posts final failure feedback to Jira on exhausted retries for user-triggered tasks, and deduplicates Jira issue keys to prevent redundant operations. Feedback points out a potential ValidationError in rebuild_agent.py if state.rebuild_error is None, suggesting a fallback string to ensure robustness.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread ymir/agents/rebuild_agent.py
In the graceful failure path (workflow-level failures), wrap the error
string in an ErrorData object before passing to retry(). The error queue
expects serialized ErrorData JSON, not plain strings.

This matches the pattern used in:
- The exception/crash path in all agents
- rebuild_agent.py graceful failure path (already correct)

Without this fix, downstream consumers of the error queue would fail to
parse plain string payloads.

Assisted-by: Claude Sonnet 4.5 <noreply@anthropic.com>
@majamassarini
majamassarini force-pushed the rebase-rebuild-final-retry-error-comment branch from e68e962 to d89ccb9 Compare June 19, 2026 12:39
@majamassarini

Copy link
Copy Markdown
Member Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

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.

Code Review

This pull request updates the backport, rebase, and rebuild agents to improve error reporting and failure feedback in Jira. Key changes include wrapping retry errors in serialized ErrorData objects, posting final failure comments to Jira on exhausted retry attempts for user-triggered tasks, and deduplicating Jira issue keys using dict.fromkeys to prevent duplicate operations. I have no feedback to provide as there are no review comments.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@nforro nforro left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants