mirror of
https://github.com/RayLabsHQ/gitea-mirror.git
synced 2026-05-07 21:17:16 -05:00
[PR #218] [MERGED] fix: gracefully handle SAML-protected orgs during GitHub import #1090
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/RayLabsHQ/gitea-mirror/pull/218
Author: @arunavo4
Created: 3/6/2026
Status: ✅ Merged
Merged: 3/7/2026
Merged by: @arunavo4
Base:
main← Head:fix/graceful-saml-org-import📝 Commits (1)
8f76f33fix: gracefully handle SAML-protected orgs during GitHub import (#217)📊 Changes
4 files changed (+151 additions, -43 deletions)
View changed files
📝
src/components/config/ConfigTabs.tsx(+21 -9)📝
src/components/organizations/OrganizationsList.tsx(+17 -5)📝
src/lib/github.ts(+38 -21)📝
src/pages/api/sync/index.ts(+75 -8)📄 Description
Summary
Closes #217
status: "failed"and the actual GitHub error message, while the rest of the import (repos, starred repos, other orgs) proceeds normally.Changes
src/lib/github.ts—getGithubOrganizationscatches 403 errors per-org instead of failing entirely. Returns both successful orgs and failed orgs with the GitHub error message.src/pages/api/sync/index.ts— Inserts failed orgs into DB withstatus: "failed"+errorMessage. On re-import, recovers previously failed orgs that now succeed. Only updates error message for orgs already in failed state (never overwrites"mirrored"or other good states).src/components/config/ConfigTabs.tsx— Shows toast warnings for failed orgs ("2 orgs failed to import…") and success toasts for recovered orgs on re-import.src/components/organizations/OrganizationsList.tsx— Displays the GitHub error message on failed org cards. Shows "Re-import from Settings" button for import-failed orgs (vs existing "Retry Mirror" for mirror-failed orgs). Users can also ignore or delete failed orgs via the existing dropdown menu.User flow
Test plan
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.