Skip to content

fix(gitee): map PR and issue states to domain statuses - #9456

Open
ShivamSharma43 wants to merge 1 commit into
apache:mainfrom
ShivamSharma43:fix/gitee-status-mapping
Open

ShivamSharma43 wants to merge 1 commit into
apache:mainfrom
ShivamSharma43:fix/gitee-status-mapping

Conversation

@ShivamSharma43

Copy link
Copy Markdown
Contributor

Summary

The Gitee converters don't map Gitee states to the domain status values.

  • convertPullRequests copied the raw state into pull_requests.status, so Gitee PRs got lowercase open/closed/merged instead of code.OPEN/code.CLOSED/code.MERGED, which the GitHub, GitLab, Bitbucket Server and Azure DevOps converters write. Comparisons against the domain values miss them, e.g. PullRequest.ConvertStatusToIncidentStatus() and the PostgreSQL dashboards that filter on status = 'MERGED'.
  • convertIssues mapped every state other than closed to TODO. Gitee issues can also be progressing (now IN_PROGRESS) and rejected (now DONE; Gitee sets finished_at for these, which the extractor already uses as the resolution date and for lead time).

Both converters now keep the Gitee state in original_status, which was left empty. Unknown issue states still fall back to TODO as before; an unknown PR state is passed through unchanged.

Does this close any open issues?

Closes #9454

Screenshots

N/A

Other Information

  • New status_convertor_test.go covers both mappings. With the old logic it fails (progressing/rejected give TODO; PR states stay lowercase).
  • go test ./plugins/gitee/..., go vet ./plugins/gitee/... and gofmt are clean. The Gitee plugin has no e2e tests.
  • State values were checked against the public Gitee v5 API (/repos/mindspore/mindspore/issues?state=progressing|rejected, /pulls?state=merged); not run as a full pipeline against a Gitee server.
  • No migration: rows are rewritten the next time the convert subtasks run.
  • Suggested label: pr-type/bug-fix.
  • This PR was prepared with AI assistance (Claude Code). The commit carries a Co-Authored-By: trailer.

🤖 Generated with Claude Code

convertPullRequests copied Gitee's lowercase open/closed/merged into
pull_requests.status instead of code.OPEN/CLOSED/MERGED, and
convertIssues mapped every state other than closed to TODO, so
progressing issues were not IN_PROGRESS and rejected issues were not
DONE. Map the states explicitly and keep the Gitee value in
original_status.

Closes apache#9454

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 26, 2026 08:08

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

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.

[Bug][Gitee] PR and issue states are not mapped to domain statuses

2 participants