Skip to content

[MAINT] refactor github_repository_file to use Context-aware provider functions - #3107

Merged
stevehipwell merged 10 commits into
integrations:mainfrom
F-Secure-web:refactor-repository_file-to-be-context-aware
Feb 3, 2026
Merged

stevehipwell merged 10 commits into
integrations:mainfrom
F-Secure-web:refactor-repository_file-to-be-context-aware

Conversation

@deiga

@deiga deiga commented Jan 21, 2026

Copy link
Copy Markdown
Collaborator

Implements #2996 #3070 for github_repository_file


Before the change?

After the change?

  • github_repository_file uses Context-aware provider functions
  • Importer is extracted to it's own function
  • Added top-level Description field
  • Refactored to use tflog instead of log
  • Extracted a createBranch function to reduce duplication
  • Update validation logic to remove some conditional code

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

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 r/repository_file Type: Maintenance Any dependency, housekeeping, and clean up Issue or PR labels Jan 21, 2026
@deiga deiga added this to the v6.11.0 Release milestone Jan 25, 2026
@deiga
deiga force-pushed the refactor-repository_file-to-be-context-aware branch from a79ec1c to 60c547a Compare January 29, 2026 20:38

@stevehipwell stevehipwell left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks @deiga this looks good. Just a couple of minor nits.

@deiga
deiga requested a review from stevehipwell January 30, 2026 22:16

@stevehipwell stevehipwell left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@deiga just one comment to look at otherwise, this is good to go.

@deiga
deiga force-pushed the refactor-repository_file-to-be-context-aware branch from 6476bd3 to 181edb8 Compare February 3, 2026 16:01
@deiga
deiga requested a review from stevehipwell February 3, 2026 16:01

@stevehipwell stevehipwell left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@stevehipwell

Copy link
Copy Markdown
Collaborator

@deiga could you please rebase this?

@stevehipwell
stevehipwell enabled auto-merge (squash) February 3, 2026 17:02
auto-merge was automatically disabled February 3, 2026 17:06

Head branch was pushed to by a user without write access

@deiga
deiga force-pushed the refactor-repository_file-to-be-context-aware branch from 181edb8 to 5a8718a Compare February 3, 2026 17:06
@stevehipwell
stevehipwell merged commit d6daf6a into integrations:main Feb 3, 2026
7 checks passed
JiayangZhou pushed a commit to JiayangZhou/terraform-provider-github that referenced this pull request Apr 16, 2026
…er functions (integrations#3107)

* Refactor `github_repository_file` to use Context-aware functions for easier debugging

Signed-off-by: Timo Sand <[email protected]>

* Extract importer to separate function

Signed-off-by: Timo Sand <[email protected]>

* Add top-level `Description` field

Signed-off-by: Timo Sand <[email protected]>

* Cleanup references/dereferences with `github.Ptr`

Signed-off-by: Timo Sand <[email protected]>

* Refactor to use `tflog` instead of `log`

Signed-off-by: Timo Sand <[email protected]>

* Refactored the createBranch functionality into a function

Signed-off-by: Timo Sand <[email protected]>

* Replace conditions with validation

Signed-off-by: Timo Sand <[email protected]>

* Minor cleanup

Signed-off-by: Timo Sand <[email protected]>

* Address review comments

Signed-off-by: Timo Sand <[email protected]>

* Address review comments

Signed-off-by: Timo Sand <[email protected]>

---------

Signed-off-by: Timo Sand <[email protected]>
@deiga
deiga deleted the refactor-repository_file-to-be-context-aware branch May 24, 2026 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

r/repository_file 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