Skip to content

Added confirmation steps for risky write commands - #1357

Closed
ShubhankarKG wants to merge 12 commits into
cli:trunkfrom
ShubhankarKG:confirmmations
Closed

ShubhankarKG wants to merge 12 commits into
cli:trunkfrom
ShubhankarKG:confirmmations

Conversation

@ShubhankarKG

@ShubhankarKG ShubhankarKG commented Jul 12, 2020 •

Copy link
Copy Markdown
Contributor

Fixes #1396
Fixes #1270
Ref #1330
Ref #1360

Changes:-

  1. Introduced three new flags for visibility filters :- --public, --private, --internal which need to be passed. Failure to do so invokes an interactive session.
  2. Transferred visibility filters into api as constants since that's the best place I guess to refer to.
  3. Introduces new flag -y that passes true for all Confirm statements
    3a. repo create has two confirm statements :- Confirm submit? and Create local directory. Both shall be true when passed.
    3b. pr merge has a single confirmation:- Submit? working on this one 😅
  4. gh repo create on passing no arguments shall open up the interactive session as noted.

Comment thread command/repo.go Outdated
confirmRepoCreate := false
promptString := ""
if input.OwnerID == "" {
promptString = "This will create " + name + " in your personal account. Continue? "

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally didn't like this fix but I couldn't figure out a way to get the ${userName}/${repoName} format. I'd be glad if someone has a way out here.

1. The Repo Create tests have passed now. Lesser tests fail.
2. I forgot to add a condition in pr create submissions that led to all pr merges with flags failing. Added conditions to fix that.
@vilmibm

vilmibm commented Jul 16, 2020

Copy link
Copy Markdown
Contributor

Thank you for this! We're currently behind on reviewing community PRs but will get to them as bandwidth allows.

@ShubhankarKG

Copy link
Copy Markdown
Contributor Author

Sure, no problem

…survey.Multiline that caused the initial options to disappear on subsequent options. Reverted it back to input so all should be good.
@ampinsk
ampinsk self-requested a review July 27, 2020 20:20
@Artnoc1

Artnoc1 commented Jul 29, 2020

Copy link
Copy Markdown

Fixes #1396
Fixes #1270
Ref #1330
Ref #1360

Changes:-

1. Introduced three new flags for visibility filters :- `--public`, `--private`, `--internal` which need to be passed. Failure to do so invokes an interactive session.

2. Transferred visibility filters into api as constants since that's the best place I guess to refer to.

3. Introduces new flag `-y` that passes true for all Confirm statements
   3a. `repo create` has two confirm statements :- **Confirm submit?** and **Create local directory**. Both shall be true when passed.
   3b. `pr merge` has a single confirmation:- **Submit?** working on this one 😅

4. `gh repo create` on passing no arguments shall open up the interactive session as noted.

@Artnoc1

This comment has been minimized.

@Artnoc1

This comment has been minimized.

@ShubhankarKG

Copy link
Copy Markdown
Contributor Author

Since at the moment of writing, this PR has been far behind (:sweat_smile:) trunk, I'd like to close this one and open a fresh new PR addressing these issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Redesign repo create to match other create commands Repo create should default to public

5 participants