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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

GitHub App: faster migration page #12186

wants to merge 1 commit into from

Conversation

stsewd
Copy link
Member

@stsewd stsewd commented May 19, 2025

For some things, we are returning lists of objects, so no lazy iteration is possible for those. So I'm loading those only when the proper step needs them.

@stsewd stsewd requested a review from a team as a code owner May 19, 2025 17:51
@stsewd stsewd requested a review from humitos May 19, 2025 17:51
stsewd added a commit to readthedocs/ext-theme that referenced this pull request May 19, 2025
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))
Copy link
Member

Choose a reason for hiding this comment

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

It seems that _get_projects_missing_missing_migration and get_valid_projects_missing_migration are the same -- in particular based on its docstring.

However, one returns all the projects and the other only returns the projects that has_installation and is_admin. Can we update the docstring to reflect this?

There is some confusion because we are talking about "admin" permission on the Project object but also "admin" permission on the GitHub repository. We should clarify what we refer to on each case.

Copy link
Member

Choose a reason for hiding this comment

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

It would be good to test that installation_target_groups, migration_targets and has_projects_pending_migration are not present on the steps where they are not needed. Something like:

assert migration_targets not in context

should be enough, I think.

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