Skip to content

[MAINT] migrate github_branch_default to context-aware CRUD functions and tflog#3327

Open
ElenaZvereva wants to merge 3 commits into
integrations:mainfrom
ElenaZvereva:migrate-branch-default-context-tflog
Open

[MAINT] migrate github_branch_default to context-aware CRUD functions and tflog#3327
ElenaZvereva wants to merge 3 commits into
integrations:mainfrom
ElenaZvereva:migrate-branch-default-context-tflog

Conversation

@ElenaZvereva

@ElenaZvereva ElenaZvereva commented Apr 9, 2026

Copy link
Copy Markdown

Part of #2996 and #3070

Before the change?

  • Legacy CRUD functions (Create, Read, Update, Delete) were used in resource_github_branch_default.go.
  • Go's standard log package was used for logging.

After the change?

  • Migrated to context-aware CRUD functions (CreateContext, ReadContext, UpdateContext, DeleteContext).
  • Replaced log usage with HashiCorp's structured logging package tflog.

Pull request checklist

  • Schema migrations have been created if needed (example)
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)

Does this introduce a breaking change?

Please see our docs on breaking changes to help!

  • Yes
  • No

@github-actions

github-actions Bot commented Apr 9, 2026

Copy link
Copy Markdown

👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀

@deiga deiga added this to the v6.13.0 Release milestone Apr 15, 2026
@deiga

deiga commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

Would you be available to rebase this (possibly multiple times) during the next week? We're going to release 6.13.0 and will try to land some of these open PRs

@deiga deiga requested a review from Copilot June 3, 2026 18:37
@deiga deiga added Awaiting response Type: Maintenance Any dependency, housekeeping, and clean up Issue or PR labels Jun 3, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Migrates the github_branch_default Terraform resource to Terraform Plugin SDK v2 context-aware CRUD handlers and switches logging to tflog, aligning this resource with the provider’s ongoing context + structured logging modernization efforts.

Changes:

  • Switched resource handlers from legacy Create/Read/Update/Delete to CreateContext/ReadContext/UpdateContext/DeleteContext.
  • Updated CRUD implementations to accept context.Context and return diag.Diagnostics (using diag.FromErr for error propagation).
  • Replaced log.Printf with structured tflog.Info logging for state-removal on 404s.

@ElenaZvereva

Copy link
Copy Markdown
Author

Yes, I'll do this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Awaiting response Type: Maintenance Any dependency, housekeeping, and clean up Issue or PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants