-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* introducing generated ql client Signed-off-by: Vittorio Ballestra <[email protected]> moved away Fixed some stupidity Fixed some stupidity Minor improvements removed other queries removed other queries minor optimization showing pending review creating a pending review cancel a review client in/from context using existing review in reply using inline editor Merge pr * Merge pr * Merge pr Co-authored-by: Vittorio Ballestra <[email protected]>
- Loading branch information
Showing
24 changed files
with
23,511 additions
and
800 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ dist/ | |
|
||
docs/.graphqlconfig | ||
bazel-* | ||
.ijwb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/* | ||
Copyright © 2022 NAME HERE <EMAIL ADDRESS> | ||
*/ | ||
package cmd | ||
|
||
import ( | ||
"github.com/pterm/pterm" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
// prNewCmd represents the prNew command | ||
var prNewCmd = &cobra.Command{ | ||
Use: "new", | ||
Short: "Create a new PR", | ||
Long: `Create a new PR`, | ||
Run: func(cmd *cobra.Command, args []string) { | ||
sv := GetSv() | ||
|
||
if newPrDestBranch == "" { | ||
if currentBranch, err := sv.GetCurrentBranch(); err != nil { | ||
pterm.Fatal.Printfln("no head branch was provided or could be inferred: %v", err) | ||
} else { | ||
newPrDestBranch = currentBranch | ||
} | ||
} | ||
|
||
var newPrDescriptionOpt *string | ||
if newPrDescription == "" { | ||
newPrDescriptionOpt = nil | ||
} else { | ||
newPrDescriptionOpt = &newPrDescription | ||
} | ||
|
||
if pr, err := sv.CreatePullRequest(newPrBaseBranch, newPrDestBranch, newPrTitle, newPrDescriptionOpt); err != nil { | ||
pterm.Fatal.Printfln("couldn't create a new pr : %v", err) | ||
} else { | ||
pterm.Info.Printfln("New Pr created.\nId: %v\nStatus: %v", pr.GetId(), pr.GetStatus()) | ||
} | ||
}, | ||
} | ||
|
||
var newPrTitle = "" | ||
var newPrDescription = "" | ||
|
||
var newPrBaseBranch = "" | ||
|
||
var newPrDestBranch = "" | ||
|
||
func init() { | ||
prCmd.AddCommand(prNewCmd) | ||
|
||
// Here you will define your flags and configuration settings. | ||
|
||
// Cobra supports Persistent Flags which will work for this command | ||
// and all subcommands, e.g.: | ||
// prStatusCmd.PersistentFlags().String("foo", "", "A help for foo") | ||
|
||
// Cobra supports local flags which will only run when this command | ||
// is called directly, e.g.: | ||
prNewCmd.Flags().StringVarP(&newPrTitle, "title", "T", "", "The new PR title") | ||
prNewCmd.Flags().StringVarP(&newPrDescription, "description", "d", "", "New PR optional description") | ||
prNewCmd.Flags().StringVarP(&newPrBaseBranch, "base", "b", "", "The base branch (required)") | ||
prNewCmd.Flags().StringVarP(&newPrDestBranch, "head", "h", "", "The (optional) head branch") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.