Skip to content

[BUG]: github_repository_collaborators much slower than github_team_repository/github_repository_collaborator #2149

Closed

Description

@pascal-hofmann

Expected Behavior

We recently switched from using github_team_repository and github_repository_collaborator to github_repository_collaborators, because we wanted to have authoritative management of collaborators. We also expected that this would bring us some performance improvements, because we could reduce the number of resources by a lot.

Actual Behavior

  • We had 2910 github_team_repository resources and 56 github_repository_collaborator resources.
  • After the switch the same things are managed by 637 github_repository_collaborators resources (one per repo).

Even though we have 2329 resources less, the terraform run now takes much longer than before (total run time is up from 6 minutes to 15 minutes.)

We also run into rate limiting issues sporadically, which was not the case before.

Terraform Version

Terraform v1.5.7
on darwin_amd64

  • provider registry.terraform.io/hashicorp/aws v5.21.0
  • provider registry.terraform.io/hashicorp/http v3.4.0
  • provider registry.terraform.io/hashicorp/vault v3.21.0
  • provider registry.terraform.io/integrations/github v5.40.0

Running against GHES 3.9.9 with parallel_requests = true.

Affected Resource(s)

  • github_repository_collaborators

Terraform Configuration Files

The resources are part of a bigger terraform project (used to managed our whole github organization) and we create the resources based on content fetched via HTTP plus some yaml configs, so it's too big to paste here.

Steps to Reproduce

No response

Debug Output

No response

Panic Output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. added
    Status: Triage
    Type: Bug
    on Feb 15, 2024
  2. added
    Status: Up for grabs
    and removed
    Status: Triage
    on Feb 20, 2024
  3. moved this from 🆕 Triage to 🔥 Backlog in 🧰 Octokit Activeon Feb 20, 2024
  4. stevehipwell commented on Oct 7, 2024

    @stevehipwell
    Collaborator

    The github_repository_collaborators resource is effectively unusable at any scale due to the excessive API calls that it makes.

  5. stevehipwell commented on Oct 11, 2024

    @stevehipwell
    Collaborator

    Based on looking into this further I think it is being caused by the github_repository_collaborators resource forcing the use of the team slug instead of the the user defined identifier (see #2414) which requires the use of the getTeamSlug function which is making unnecessary calls to the GH API for every team defined even when they've been defined with an ID.

  6. moved this from 🔥 Backlog to ✅ Done in 🧰 Octokit Activeon Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: Up for grabsType: Bug

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions