redhat-developer / kam

GitOps Application Manager: An opinionated CLI that generates the Kubernetes resources for managing your Tekton-based CI manifests, ArgoCD-based CD manifests and Application manifests in Git.
Apache License 2.0
145 stars 83 forks source link

gitops-1169: Interactive mode with default option doesn't support push to git #269

Closed ciiay closed 3 years ago

ciiay commented 3 years ago

What type of PR is this?

Uncomment only one /kind line, and delete the rest. For example, > /kind bug would simply become: /kind bug

/kind enhancement

What does this PR do / why we need it:

Have you updated the necessary documentation?

Which issue(s) this PR fixes:

Fixes #

How to test changes / Special notes to the reviewer: Day 1 operations both interactive mode and non-interactive mode are successful on OCP 4.9

chetan-rns commented 3 years ago
? Select yes to accept default values or select no to be prompted for all options that haven't already been specified on the command line

Default values:
--gitops-repo-url               ""
--prefix            "p"
--service-repo-url      ""
--save-token-keyring        "false"
--private-repo-driver       ""
--gitops-webhook-secret     ""
--output            "./gitops"
--git-host-access-token     ""
--dockercfgjson         "~/.docker/config.json"
--image-repo            ""
--overwrite         "false"
--service-webhook-secret    ""
--push-to-git           "false"

Hi @ciiay, thanks for the PR. When users opt for smart defaults, kam will construct values for some of the above flags. For example, the --image-repo will be constructed as image-registry.openshift-image-registry.svc:5000/cicd/<service-repo> but the default value will be displayed as " ". And users can also pass individual flags in the interactive mode which might change these values kam bootstrap --image-repo quay.io/cbanavik/taxi --interactive. I wonder if there's a way we can handle this :thinking:

ciiay commented 3 years ago

Hi @chetan-rns, thanks for the review and the feedback. Shall I get the default values from initiateInteractiveMode function?

codecov-commenter commented 3 years ago

Codecov Report

Merging #269 (eec0805) into master (4c6863c) will decrease coverage by 0.14%. The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #269      +/-   ##
==========================================
- Coverage   58.80%   58.66%   -0.15%     
==========================================
  Files          57       57              
  Lines        2879     2886       +7     
==========================================
  Hits         1693     1693              
- Misses       1018     1025       +7     
  Partials      168      168              
Flag Coverage Δ
unittests 58.66% <0.00%> (-0.15%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/cmd/bootstrap.go 19.28% <0.00%> (ø)
pkg/cmd/ui/ui.go 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 4c6863c...eec0805. Read the comment docs.

ciiay commented 3 years ago

After a discussion with @keithchong and @chetan-rns , now the printout looks like this.

Screen Shot 2021-08-31 at 2 18 49 PM
ciiay commented 3 years ago

Updated printout

Screen Shot 2021-09-02 at 11 43 19 AM
ishitasequeira commented 3 years ago

/test v4.8-integration-e2e

openshift-ci[bot] commented 3 years ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: chetan-rns

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/redhat-developer/kam/blob/master/OWNERS)~~ [chetan-rns] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment