Skip to content

GitHub App: faster migration page #12186

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 27, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
12 changes: 11 additions & 1 deletion readthedocs/oauth/migrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def get_migrated_projects(user):
)


def get_valid_projects_missing_migration(user):
def get_valid_projects_missing_migration(user) -> Iterator[Project]:
"""
Get all projects that the user can migrate to the GitHub App.

Expand Down Expand Up @@ -296,6 +296,16 @@ def get_migration_targets(user) -> list[MigrationTarget]:
return targets


def has_projects_pending_migration(user) -> bool:
"""
Check if the user has any projects pending migration to the GitHub App.

This includes all projects that are connected to the old GitHub OAuth App,
where the user has admin permissions and the GitHub App is installed.
"""
return any(_get_projects_missing_migration(user))


def get_old_app_link() -> str:
"""
Get the link to the old GitHub OAuth App settings page.
Expand Down
Loading