Skip to content
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

fix(branch-protection): Use more efficient function to fetch actors #1331

Merged
merged 2 commits into from
Oct 27, 2022
Merged

fix(branch-protection): Use more efficient function to fetch actors #1331

merged 2 commits into from
Oct 27, 2022

Conversation

dion-gionet
Copy link
Contributor

Fixes #1328

Brings back #1020 but fixed the slowness that was caused by slow function calls (branchProtectionResourceData).

I've tested multiple scenarios from provider versions 5.4.0, 5.5.0 and my patch to make sure the performance regression is gone or at least very comparable to the speed of 5.5.0.
This was tested on a test org with over 160 repos (1 github_team_repository, 1 github_branch_default and 1 github_branch_protection resource per repo)

As you can see from the results below, the speed has greatly improved by using a trimmed down version of branchProtectionResourceData. You can see exactly what I changed on commit f308e30

Test results

Plan using node IDs

  • Planning on 5.4.0

    oldpatch planids

  • Planning with my patch

    newpatch planids

  • Planning on 5.5.0

    5 5 0 planids

Plan using user login name

  • Planning on 5.4.0

    oldpatch planlogin

  • Planning with my patch

    newpatch planlogin

Apply change on github_branch_protection for all resources using node IDs and user login names

  • Applying on 5.5.0 with node IDs

    5 5 0 applyids

  • Applying with my patch with user login names. This is slower than applying with node IDs since it has to fetch the ID before applying

    newpatchapplylogin

  • Applying with my patch with node IDs

    newpatchapplyids

cc @kfcampbell

branchProtectionResourceData is very slow to call so used branchProtectionResourceDataActors instead
Copy link
Member

@kfcampbell kfcampbell left a comment

Choose a reason for hiding this comment

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

Input on #1328 about the efficiency of these changes is appreciated! Thanks for the test data, @dion-gionet.

@kfcampbell kfcampbell merged commit 156b7ea into integrations:main Oct 27, 2022
@dion-gionet dion-gionet deleted the slowfix branch October 28, 2022 16:40
kazaker pushed a commit to auto1-oss/terraform-provider-github that referenced this pull request Dec 28, 2022
…ntegrations#1331)

* feat(branch-protection): Push/Reviewer actors can be specified by name

This reverts commit 05a8875.

* fix(branch-protection): Use more efficient function to fetch actors

branchProtectionResourceData is very slow to call so used branchProtectionResourceDataActors instead
avidspartan1 pushed a commit to avidspartan1/terraform-provider-github that referenced this pull request Feb 5, 2024
…ntegrations#1331)

* feat(branch-protection): Push/Reviewer actors can be specified by name

This reverts commit d825afa.

* fix(branch-protection): Use more efficient function to fetch actors

branchProtectionResourceData is very slow to call so used branchProtectionResourceDataActors instead
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.

5.4.0 is much slower
2 participants