Skip to content

Commit

Permalink
use hostname in both github and caching (#1831)
Browse files Browse the repository at this point in the history
  • Loading branch information
motatoes authored Nov 18, 2024
1 parent 467d0ae commit 354034b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
9 changes: 1 addition & 8 deletions backend/controllers/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,9 @@ func (d DiggerController) UpdateRepoCache(c *gin.Context) {
return
}

cloneUrl := repo.RepoUrl
cloneUrl := fmt.Sprintf("https://%v/%v", utils.GetGithubHostname(), repo.RepoFullName)
branch := request.Branch

//ghInstallation, err := models.DB.GetInstallationForRepo(repoFullName)
//if err != nil {
// log.Printf("could not get repo: %v", err)
// c.String(500, fmt.Sprintf("coulnt not get repository %v %v", repoFullName, orgId))
// return
//}

_, token, err := utils.GetGithubService(d.GithubClientProvider, installationId, repoFullName, repoOwner, repoName)
if err != nil {
log.Printf("could not get github service :%v", err)
Expand Down
2 changes: 1 addition & 1 deletion backend/controllers/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -1163,7 +1163,7 @@ func (d DiggerController) GithubAppCallbackPage(c *gin.Context) {
repoFullName := *repo.FullName
repoOwner := strings.Split(*repo.FullName, "/")[0]
repoName := *repo.Name
repoUrl := fmt.Sprintf("https://github.com/%v", repoFullName)
repoUrl := fmt.Sprintf("https://%v/%v", utils.GetGithubHostname(), repoFullName)
_, err := models.DB.GithubRepoAdded(installationId64, *installation.AppID, *installation.Account.Login, *installation.Account.ID, repoFullName)
if err != nil {
log.Printf("github repos added error: %v", err)
Expand Down

0 comments on commit 354034b

Please sign in to comment.