Skip to content

fix(services/github): support env-driven construction via from_uri - #8009

Closed
trim21 wants to merge 1 commit into
apache:mainfrom
trim21:fix-github-env-construction
Closed

fix(services/github): support env-driven construction via from_uri#8009
trim21 wants to merge 1 commit into
apache:mainfrom
trim21:fix-github-env-construction

Conversation

@trim21

@trim21 trim21 commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

None.

Rationale for this change

GithubConfig::from_uri requires owner and repo to be parsed from the URI authority, which breaks Operator::via_iter("github", ...) construction used by env-driven setups and the behavior test framework. The github service is the only service that cannot be configured through environment variables.

What changes are included in this PR?

  • Fall back to options (OPENDAL_GITHUB_OWNER / OPENDAL_GITHUB_REPO) when the URI has no authority or path; github://<owner>/<repo>/<root> URI semantics are unchanged.
  • Keep validating that owner and repo are non-empty, since #[serde(default)] would otherwise silently turn a missing field into an empty string.
  • Add a unit test covering option-driven construction.

Are there any user-facing changes?

OPENDAL_GITHUB_OWNER / OPENDAL_GITHUB_REPO environment variables now work for configuring the github service.

@trim21
trim21 requested a review from Xuanwo as a code owner August 1, 2026 15:24
@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Aug 1, 2026
@trim21 trim21 changed the title test fix(services/github): support env-driven construction via from_uri Aug 1, 2026
@trim21
trim21 marked this pull request as draft August 1, 2026 15:26
GithubConfig::from_uri requires owner and repo to be parsed from the URI
authority, which breaks Operator::via_iter("github", env) construction
used by the behavior tests and env-driven setups. Fall back to options
when the URI has no authority or path.
@trim21
trim21 force-pushed the fix-github-env-construction branch from fcb5d73 to 4d14e94 Compare August 1, 2026 15:27
@trim21

trim21 commented Aug 1, 2026

Copy link
Copy Markdown
Contributor Author

Merged into #8010 per review discussion.

@trim21 trim21 closed this Aug 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant