feat: use provider owner as default for github_organization data source#3316
Open
mattias-fjellstrom wants to merge 2 commits intointegrations:mainfrom
Open
Conversation
When no 'name' is provided, fall back to the provider's configured owner (or the authenticated user). This makes 'name' optional. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
👋 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 |
deiga
requested changes
Apr 1, 2026
Verify that omitting 'name' from the data source falls back to the provider's configured owner. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
92130b5 to
09ec3a0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When no
nameis provided to thegithub_organizationdata source, it now falls back to the provider's configuredowner(or the authenticated user if no owner is set). This makesnameoptional.Motivation
Users who already configure an
ownerin the provider block shouldn't need to repeat it in everygithub_organizationdata source. This is consistent with how other data sources in this provider handle the owner fallback.Changes
github/data_source_github_organization.go: changednamefromRequiredtoOptional+Computed, and fall back tometa.(*Owner).namewhen not suppliedgithub/data_source_github_organization_test.go: added acceptance test verifying the fallback behaviourwebsite/docs/d/organization.html.markdown: updated docs to reflectnameis now optional, with a second example showing omittednameExample
Before (name was required):
After (name is falls back to provider
owner):optionalTesting
All acceptance tests pass:
uses_provider_owner_when_name_is_not_set(new)queries_for_an_organization_without_errorqueries_for_an_organization_with_archived_reposqueries_for_an_organization_summary_only_without_error