jenkins-x-plugins / jenkins-x-plugins/jx-gitops

Helm mirror command does not push changes

Open
#773 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Go
Stars
35
Forks
53
Avg merge
1d 12h
Merged PRs (30d)
7

Description

Currently in the source code of `gitops helm mirror` command there seems to be inconsistent behavior near the end of function. Namely the inputs and comments indicate that `git push` should be executed, but this does not seem to be the case in the code.

In `mirror.go` following block of code is present after the repositories have been mirrored:

```go

changes, err := gitclient.AddAndCommitFiles(o.GitClient, gitDir, o.CommitMessage)
if err != nil {
return errors.Wrapf(err, "failed to add and commit files")
}
if !changes {
log.Logger().Infof("no changes")
return nil
}
if o.NoPush {
return nil
}
err = gitclient.Pull(o.GitClient, gitDir)
if err != nil {
return errors.Wrapf(err, "failed to push changes")
}

log.Logger().Infof("pushed changes to %s in branch %s", info(o.GitURL), info(o.Branch))
return nil
```

The comments indicate that there should be a push, but actually executed is `git pull`. This does not seem correct and should be fixed, since this command may be crucial for people looking to migrate the whole version stream into private repositories

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.