Skip to content

Normalize github url when fetching token#11803

Merged
maggie-lou merged 1 commit into
masterfrom
fix_gh_token
Apr 7, 2026
Merged

Normalize github url when fetching token#11803
maggie-lou merged 1 commit into
masterfrom
fix_gh_token

Conversation

@maggie-lou

Copy link
Copy Markdown
Collaborator

Fixes a bug introduced in #11583

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

Fixes a regression from #11583 by ensuring GitHub repo URLs are normalized before looking up imported repositories and fetching GitHub App installation tokens, aligning runtime inputs with the normalized GitRepositories.repo_url values stored in the DB.

Changes:

  • Normalize repoURL via gitutil.ParseGitHubRepoURL before querying GitRepositories for the repo import record.
  • Pass a normalized repo URL through the convenience wrapper to ensure consistent behavior for callers.
  • Add a unit test verifying .git-suffixed repo URLs are accepted and resolved correctly.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
enterprise/server/githubapp/githubapp.go Normalize repo URL prior to DB lookup and propagate normalized URL in wrapper call.
enterprise/server/githubapp/githubapp_test.go Add regression test ensuring repo URL normalization (e.g., handling .git suffix).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@maggie-lou maggie-lou merged commit 45e932c into master Apr 7, 2026
13 of 16 checks passed
@maggie-lou maggie-lou deleted the fix_gh_token branch April 7, 2026 13:51
maggie-lou added a commit that referenced this pull request Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants