Parcourir la source

fix items for code review

Alexander Belanger il y a 4 ans
Parent
commit
5446c3be99

+ 1 - 2
.github/workflows/build-dev-cli.yaml

@@ -2,8 +2,7 @@ name: Deploy to dev
 on:
   push:
     branches:
-    # TODO: change before merge
-      - nafees/preview-apps-initial-cli
+      - dev
 jobs:
   build-push-docker-cli:
     name: Build a new porter-cli docker image

+ 0 - 2
api/server/handlers/gitinstallation/oauth_callback.go

@@ -31,7 +31,6 @@ func NewGithubAppOAuthCallbackHandler(
 }
 
 func (c *GithubAppOAuthCallbackHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
-	fmt.Println("CALLBACK HANDLER")
 	user, _ := r.Context().Value(types.UserScope).(*models.User)
 
 	session, err := c.Config().Store.Get(r, c.Config().ServerConf.CookieName)
@@ -44,7 +43,6 @@ func (c *GithubAppOAuthCallbackHandler) ServeHTTP(w http.ResponseWriter, r *http
 	token, err := c.Config().GithubAppConf.Exchange(oauth2.NoContext, r.URL.Query().Get("code"))
 
 	if err != nil || !token.Valid() {
-		fmt.Println("ERROR HERE", err)
 		if redirectStr, ok := session.Values["redirect_uri"].(string); ok && redirectStr != "" {
 			// attempt to parse the redirect uri, if it fails just redirect to dashboard
 			redirectURI, err := url.Parse(redirectStr)

+ 1 - 1
api/server/shared/config/loader/loader.go

@@ -163,7 +163,7 @@ func (e *EnvConfigLoader) LoadConfig() (res *config.Config, err error) {
 			res.GithubAppConf = oauth.NewGithubAppClient(&oauth.Config{
 				ClientID:     sc.GithubAppClientID,
 				ClientSecret: sc.GithubAppClientSecret,
-				Scopes:       []string{"read:user", "repo"},
+				Scopes:       []string{"read:user"},
 				BaseURL:      sc.ServerURL,
 			}, sc.GithubAppName, sc.GithubAppWebhookSecret, sc.GithubAppSecretPath, AppID)
 		}

+ 0 - 3
cli/cmd/apply.go

@@ -789,7 +789,6 @@ func (t *DeploymentHook) DataQueries() map[string]interface{} {
 
 		if isWeb {
 			res[resource.Name] = fmt.Sprintf("{ .%s.ingress.porter_hosts[0] }", resource.Name)
-			fmt.Printf("registered data query for %s\n", resource.Name)
 		}
 	}
 
@@ -799,8 +798,6 @@ func (t *DeploymentHook) DataQueries() map[string]interface{} {
 func (t *DeploymentHook) PostApply(populatedData map[string]interface{}) error {
 	subdomains := make([]string, 0)
 
-	fmt.Printf("populated data is %v\n", populatedData)
-
 	for _, data := range populatedData {
 		domain, ok := data.(string)
 

+ 0 - 4
cli/cmd/docker/builder.go

@@ -62,10 +62,6 @@ func (a *Agent) BuildLocal(opts *BuildOpts) error {
 		buildArgs[key] = &valCopy
 	}
 
-	// attach BUILDKIT_INLINE_CACHE=1 by default, to take advantage of caching
-	inlineCacheVal := "1"
-	buildArgs["BUILDKIT_INLINE_CACHE"] = &inlineCacheVal
-
 	out, err := a.client.ImageBuild(context.Background(), tar, types.ImageBuildOptions{
 		Dockerfile: dockerfilePath,
 		BuildArgs:  buildArgs,

+ 2 - 4
internal/integrations/ci/actions/preview.go

@@ -174,8 +174,7 @@ func getPreviewApplyActionYAML(opts *EnvOpts) ([]byte, error) {
 			opts.ClusterID,
 			opts.GitInstallationID,
 			opts.GitRepoName,
-			// TODO: change to actual release version
-			"master",
+			"v0.1.0",
 		),
 	}
 
@@ -202,8 +201,7 @@ func getPreviewDeleteActionYAML(opts *EnvOpts) ([]byte, error) {
 			opts.ClusterID,
 			opts.GitInstallationID,
 			opts.GitRepoName,
-			// TODO: change to actual release version
-			"master",
+			"v0.1.0",
 		),
 	}