From 9352a3f6b0bfca9ff98875ccc310905fc0632e25 Mon Sep 17 00:00:00 2001 From: Shawna Monero Date: Sun, 14 Apr 2024 11:34:55 -0700 Subject: [PATCH] fix the underlying issue --- .../adhoc_execution_params.go | 17 ++++++++++++++++- server/vcs/provider/github/repo_fetcher.go | 3 --- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/server/neptune/adhoc/adhocexecutionhelpers/adhoc_execution_params.go b/server/neptune/adhoc/adhocexecutionhelpers/adhoc_execution_params.go index ba22b0afa..013923a4d 100644 --- a/server/neptune/adhoc/adhocexecutionhelpers/adhoc_execution_params.go +++ b/server/neptune/adhoc/adhocexecutionhelpers/adhoc_execution_params.go @@ -4,6 +4,7 @@ import ( "context" "github.com/pkg/errors" + "github.com/runatlantis/atlantis/server/models" "github.com/runatlantis/atlantis/server/neptune/adhoc/adhocgithubhelpers" "github.com/runatlantis/atlantis/server/neptune/gateway/config" root_config "github.com/runatlantis/atlantis/server/neptune/gateway/config" @@ -33,7 +34,21 @@ func ConstructAdhocExecParamsWithRootCfgBuilderAndRepoRetriever(ctx context.Cont }, } - rootCfgs, err := rootCfgBuilder.Build(ctx, &root_config.RepoCommit{}, repo.Credentials.InstallationToken, opts) + rootCfgs, err := rootCfgBuilder.Build(ctx, &root_config.RepoCommit{ + Repo: models.Repo{ + FullName: repo.GetFullName(), + Owner: repo.Owner, + Name: repoName, + CloneURL: repo.URL, + VCSHost: models.VCSHost{ + Hostname: "github.com", + Type: models.Github, + }, + DefaultBranch: repo.DefaultBranch, + }, + Branch: repo.DefaultBranch, + Sha: revision, + }, repo.Credentials.InstallationToken, opts) if err != nil { return AdhocTerraformWorkflowExecutionParams{}, errors.Wrap(err, "building root cfgs") } diff --git a/server/vcs/provider/github/repo_fetcher.go b/server/vcs/provider/github/repo_fetcher.go index 41590974b..aab5bd9ea 100644 --- a/server/vcs/provider/github/repo_fetcher.go +++ b/server/vcs/provider/github/repo_fetcher.go @@ -72,9 +72,6 @@ func (g *RepoFetcher) Fetch(ctx context.Context, repo models.Repo, branch string } func (g *RepoFetcher) clone(ctx context.Context, repo models.Repo, branch string, sha string, options RepoFetcherOptions) (string, func(ctx context.Context, filePath string), error) { - // debug - options.SimplePath = false - destinationPath := g.generateDirPath(repo.Name) // If simple path is enabled, we don't need a prefix and UUID if options.SimplePath {