Skip to content

fix: surface description publication failures - #3065

Merged
IsmaelMartinez merged 2 commits into
The-PR-Agent:mainfrom
Ricky-7-Yan:fix/issue-3057-description-publication
Sep 7, 2026
Merged

IsmaelMartinez merged 2 commits into
The-PR-Agent:mainfrom
Ricky-7-Yan:fix/issue-3057-description-publication

Conversation

@Ricky-7-Yan

Copy link
Copy Markdown
Contributor

Summary

  • define publish_description() as an exception-on-failure provider contract
  • propagate confirmed GitLab and Azure DevOps SDK failures, and reject unsuccessful Bitbucket Cloud and Gitea responses
  • report a visible publication failure from /describe and skip the final "updated" success message
  • cover the four provider boundaries and both propagate_tool_errors lifecycle modes

Closes #3057.

Validation

  • PYTHONPATH=. uv run pytest -q tests/unittest/test_pr_description_lifecycle.py tests/unittest/test_gitlab_provider.py tests/unittest/test_azure_devops_provider.py tests/unittest/test_bitbucket_provider.py tests/unittest/test_gitea_provider.py — 396 passed
  • targeted new regressions — 6 passed
  • uv run ruff check on all changed Python files — passed
  • Python AST compilation and git diff --check — passed

The full unit suite's first failure on this Windows host is the existing tests/unittest/test_artifacts.py::TestResolveArtifactPath::test_root_workspace_does_not_reject_valid_paths; it reproduces unchanged on a clean f3b385e worktree. Pre-commit could not initialize because fetching pre-commit-hooks failed twice with a GitHub port 443 connection error; its relevant Python checks were covered manually above.

@github-actions github-actions Bot added the bug label Sep 5, 2026
@Ricky-7-Yan

Copy link
Copy Markdown
Contributor Author

/agentic_review

@IsmaelMartinez IsmaelMartinez left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks, and for catching the Gitea case yourself on the issue rather than stopping at the three providers that were reported.

One inline suggestion, otherwise this is ready.

  • I walked all eleven implementations, not just the four you changed. The seven you leave alone already raise or propagate, and mosaico has no remote write that can fail, so the contract leaves nobody in a false-success state.
  • Merged onto today's main: 3729 passed against 3723, and restoring the six source files turns all six of your new tests red.
  • The suggestion is a defensive tightening of the Bitbucket status check, not a failure I reproduced.

except:
pass
return response
if response.status_code != 200:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Now that this raises rather than logging at info, the strict != 200 matters in a way it did not before: a 2xx that is not exactly 200 would abort /describe and post a failure comment on a PR that did update. I have not confirmed Bitbucket returns one here, so this is defensive, matching the raise_for_status() this file already uses at :116, :124, :509 and :653.

Suggested change
if response.status_code != 200:
if not 200 <= response.status_code < 300:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Applied in a7dded9. publish_description now accepts the full 2xx range, with regression coverage for 200, 201, and 204; non-2xx responses still raise. Re-ran the complete Bitbucket provider and description lifecycle files: 63 passed. Ruff and diff checks are clean.

@qodo-code-review

qodo-code-review Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Code Review by Qodo

Grey Divider

Sorry, something went wrong

We weren't able to complete the code review on our side. Please try again manually by commenting /agentic_review on this PR.

Grey Divider

Qodo Logo

@IsmaelMartinez IsmaelMartinez left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks, the 2xx range landed as suggested and every provider now raises where it used to log. The regression tests go red on the old code.

@IsmaelMartinez
IsmaelMartinez merged commit 6a7924f into The-PR-Agent:main Sep 7, 2026
4 checks passed
IsmaelMartinez added a commit to junnhwan/pr-agent that referenced this pull request Sep 7, 2026
The-PR-Agent#3065 builds PRDescription with __new__ and mocks _prepare_data, and The-PR-Agent#3098 reads self.data on the publish path, so main has failed two tests since both landed on 7 September.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_018DnpxBBKh17sPL8J6uZ5mJ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: /describe reports success after PR description publication fails

2 participants