Skip to content

Commit

Permalink
Remove dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
hnnsgstfssn committed Oct 28, 2024
1 parent 92e0f8f commit b2bd6de
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 29 deletions.
6 changes: 0 additions & 6 deletions internal/pkg/githubapi/clients.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ func createGithubGraphQlClient(githubOauthToken string, githubGraphqlAltURL stri
}

func createGhAppClientPair(ctx context.Context, githubAppId int64, owner string, ghAppPKeyPathEnvVarName string) GhClientPair {
// var ghClientPair *GhClientPair
var githubRestAltURL string
var githubGraphqlAltURL string
githubAppPrivateKeyPath := getCrucialEnv(ghAppPKeyPathEnvVarName)
Expand All @@ -151,16 +150,13 @@ func createGhAppClientPair(ctx context.Context, githubAppId int64, owner string,
log.Errorf("Couldn't find installation for app ID %v and repo owner %s", githubAppId, owner)
}

// ghClientPair.v3Client := createGithubAppRestClient(githubAppPrivateKeyPath, githubAppId, githubAppInstallationId, githubRestAltURL, ctx)
// ghClientPair.v4Client := createGithubAppGraphQlClient(githubAppPrivateKeyPath, githubAppId, githubAppInstallationId, githubGraphqlAltURL, githubRestAltURL, ctx)
return GhClientPair{
v3Client: createGithubAppRestClient(githubAppPrivateKeyPath, githubAppId, githubAppInstallationId, githubRestAltURL, ctx),
v4Client: createGithubAppGraphQlClient(githubAppPrivateKeyPath, githubAppId, githubAppInstallationId, githubGraphqlAltURL, githubRestAltURL, ctx),
}
}

func createGhTokenClientPair(ctx context.Context, ghOauthToken string) GhClientPair {
// var ghClientPair *GhClientPair
var githubRestAltURL string
var githubGraphqlAltURL string
githubHost := getEnv("GITHUB_HOST", "")
Expand All @@ -173,8 +169,6 @@ func createGhTokenClientPair(ctx context.Context, ghOauthToken string) GhClientP
log.Debugf("Using public Github API endpoint")
}

// ghClientPair.v3Client := createGithubRestClient(ghOauthToken, githubRestAltURL, ctx)
// ghClientPair.v4Client := createGithubGraphQlClient(ghOauthToken, githubGraphqlAltURL)
return GhClientPair{
v3Client: createGithubRestClient(ghOauthToken, githubRestAltURL, ctx),
v4Client: createGithubGraphQlClient(ghOauthToken, githubGraphqlAltURL),
Expand Down
23 changes: 0 additions & 23 deletions internal/pkg/githubapi/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,6 @@ func (pm prMetadata) serialize() (string, error) {
if err != nil {
return "", err
}
// var compressedPmJson []byte
// _, err = lz4.CompressBlock(pmJson, compressedPmJson, nil)
// if err != nil {
// return "", err
// }
return base64.StdEncoding.EncodeToString(pmJson), nil
}

Expand Down Expand Up @@ -625,7 +620,6 @@ func handleMergedPrEvent(ghPrClientDetails GhPrClientDetails, prApproverGithubCl
// configBranch = default branch as the PR is closed at this and its branch deleted.
// If we'l ever want to generate this plan on an unmerged PR the PR branch (ghPrClientDetails.Ref) should be used
promotions, _ := GeneratePromotionPlan(ghPrClientDetails, config, defaultBranch)
// log.Infof("%+v", promotions)
if !config.DryRunMode {
for _, promotion := range promotions {
// TODO this whole part shouldn't be in main, but I need to refactor some circular dep's
Expand Down Expand Up @@ -791,10 +785,6 @@ func (pm *prMetadata) DeSerialize(s string) error {
if err != nil {
return err
}
// _, err = lz4.UncompressBlock(decoded, unCompressedPmJson)
// if err != nil {
// return err
// }
err = json.Unmarshal(decoded, pm)
return err
}
Expand Down Expand Up @@ -1226,19 +1216,6 @@ func createPrObject(ghPrClientDetails GhPrClientDetails, newBranchRef string, ne
ghPrClientDetails.PrLogger.Debugf(" %s was set as assignee on PR", assignee)
}

// reviewers := github.ReviewersRequest{
// Reviewers: []string{"SA-k8s-pr-approver-bot"}, // TODO remove hardcoding
// }
//
// _, resp, err = ghPrClientDetails.Ghclient.PullRequests.RequestReviewers(ghPrClientDetails.Ctx, ghPrClientDetails.Owner, ghPrClientDetails.Repo, *pull.Number, reviewers)
// prom.InstrumentGhCall(resp)
// if err != nil {
// ghPrClientDetails.PrLogger.Errorf("Could not set reviewer on pr: err=%s\n%v\n", err, resp)
// return pull, err
// } else {
// ghPrClientDetails.PrLogger.Debugf("PR reviewer set.\n%+v", reviewers)
// }

return pull, nil // TODO
}

Expand Down

0 comments on commit b2bd6de

Please sign in to comment.