From 95b3324f6347a988ffbe4079d0489a3e24d90cc3 Mon Sep 17 00:00:00 2001 From: Michel Vocks Date: Tue, 30 Jan 2018 09:14:29 +0100 Subject: [PATCH] Some adjustments for the UI. Fixed small bugs --- frontend/client/views/pipelines/create.vue | 16 ++++++++-------- handlers/pipeline.go | 4 ++-- pipeline/git.go | 14 +++++--------- 3 files changed, 15 insertions(+), 19 deletions(-) diff --git a/frontend/client/views/pipelines/create.vue b/frontend/client/views/pipelines/create.vue index 728ba09b..0d0b9667 100755 --- a/frontend/client/views/pipelines/create.vue +++ b/frontend/client/views/pipelines/create.vue @@ -37,7 +37,7 @@

- + @@ -99,21 +99,21 @@ - + {{ pipeline.pipelinename }} - +

- Completed + Completed
- + {{ pipeline.pipelinetype }} - + {{ pipeline.creationdate }} @@ -140,7 +140,7 @@

- + @@ -285,7 +285,7 @@ export default { this.gitSuccess = true // Get branches and set to master if available - this.gitBranches = response.data.gitbranches + this.gitBranches = response.data for (var i = 0; i < this.gitBranches.length; i++) { if (this.gitBranches[i] === 'refs/heads/master') { this.pipeline.gitrepo.selectedbranch = this.gitBranches[i] diff --git a/handlers/pipeline.go b/handlers/pipeline.go index 97733c8f..3d98672a 100644 --- a/handlers/pipeline.go +++ b/handlers/pipeline.go @@ -47,7 +47,7 @@ func PipelineGitLSRemote(ctx iris.Context) { } // Return branches - ctx.JSON(repo) + ctx.JSON(repo.Branches) } // PipelineBuildFromSource clones a given git repo and @@ -77,7 +77,7 @@ func PipelineBuildFromSource(ctx iris.Context) { } // createPipelineExecute clones the given git repo and compiles -// the pipeline. After every step, the status will be store. +// the pipeline. After every step, the status will be stored. // This method is designed to be called async. func createPipelineExecute(p *gaia.Pipeline) { // Define build process for the given type diff --git a/pipeline/git.go b/pipeline/git.go index 074380b4..01c2dfa0 100644 --- a/pipeline/git.go +++ b/pipeline/git.go @@ -30,8 +30,11 @@ func GitLSRemote(repo *gaia.GitRepo) error { // Attach credentials if provided var auth transport.AuthMethod if repo.Username != "" && repo.Password != "" { - ep.User = repo.Username - ep.Password = repo.Password + // Basic auth provided + auth = &http.BasicAuth{ + Username: repo.Username, + Password: repo.Password, + } } else if repo.PrivateKey.Key != "" { auth, err = ssh.NewPublicKeys(repo.PrivateKey.Username, []byte(repo.PrivateKey.Key), repo.PrivateKey.Password) if err != nil { @@ -53,13 +56,6 @@ func GitLSRemote(repo *gaia.GitRepo) error { defer s.Close() // Get advertised references (e.g. branches) - // We have to reset the username and password to - // prevent go-git setting the credentials in the URL - // which will not be URL encoded. - // https://github.com/src-d/go-git/issues/723 - ep.User = "" - ep.Password = "" - repo.Password = "" ar, err := s.AdvertisedReferences() if err != nil { return err