github-as-code icon indicating copy to clipboard operation
github-as-code copied to clipboard

Efficient labels

Open galargh opened this issue 2 years ago • 2 comments

Implement issue labels support efficiently. With https://github.com/integrations/terraform-provider-github/compare/main...galargh:terraform-provider-github:feat/github_issue_labels in place, we can manage all labels for a repository using a single tf resource instead of a resource per label. This greaaaaaaatly reduces the number of GitHub API calls that we'll be doing during plans/syncs/applies.

Testing
  • [x] deployed and tested in pl-strflt/github-mgmt

galargh avatar May 19 '23 17:05 galargh

I'm putting this back in draft. The changes in the provider need more work. I'll mark it as ready for review after successful testing in pl-strflt org.

Things to look out for:

  • import should import all the labels for the repo to state
  • plan/apply (without refresh) should avoid having a side-effect of importing new labels to the state
  • refresh should import new labels to the state

galargh avatar May 22 '23 07:05 galargh

And it's ready! You can have a look at all the labels being tracked through https://github.com/pl-strflt/github-mgmt/blob/master/github/pl-strflt.yml

We might want to wait a couple of days to see if https://github.com/integrations/terraform-provider-github/pull/1694 makes it into the next gh provider release since they've been very responsive lately.

galargh avatar May 23 '23 09:05 galargh

This was added in https://github.com/ipdxco/github-as-code/pull/195

galargh avatar May 17 '25 16:05 galargh