Skip to content

fix: use getBaseURL in acc_test.go to match provider URL parsing#3258

Open
amreshh wants to merge 1 commit intointegrations:mainfrom
amreshh:bug/base-url-ghes
Open

fix: use getBaseURL in acc_test.go to match provider URL parsing#3258
amreshh wants to merge 1 commit intointegrations:mainfrom
amreshh:bug/base-url-ghes

Conversation

@amreshh
Copy link

@amreshh amreshh commented Mar 5, 2026

Resolves #3256


Before the change?

acc_test.go was parsing GITHUB_BASE_URL with url.Parse() directly, bypassing the normalization done by getBaseURL() in the provider. This caused the test base URL to differ from what the provider produces (e.g. missing trailing slash, no github.com → api.github.com rewrite, no ghe.com API host prefix). Additionally, IsGHES was never set on the test Config, so GHES-specific behavior was not exercised in tests.

After the change?

Now acc_test.go is calling getBaseURL() as provider.go is doing so the base url is parsed in the same way. Test cases on GHES now run correctly.

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

acc_test.go was parsing GITHUB_BASE_URL with url.Parse() directly,
bypassing the normalization done by getBaseURL() in the provider. This
caused the test base URL to differ from what the provider produces
(e.g. missing trailing slash, no github.com → api.github.com rewrite,
no ghe.com API host prefix). Additionally, IsGHES was never set on the
test Config, so GHES-specific behavior was not exercised in tests.
@github-actions
Copy link

github-actions bot commented Mar 5, 2026

👋 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! 🚀

@github-actions github-actions bot added the Type: Bug Something isn't working as documented label Mar 5, 2026
Copy link
Collaborator

@deiga deiga left a comment

Choose a reason for hiding this comment

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

Yay! Thanks! @stevehipwell, you're up

@deiga deiga requested a review from stevehipwell March 5, 2026 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Bug Something isn't working as documented

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: TestAccGithubMembership fails on GHES

2 participants