Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var EstimateTimeToReviewCmd = &cobra.Command{ Use: "estimate-review", Short: "Estimate time needed to review a PR in seconds", PreRunE: func(cmd *cobra.Command, args []string) error { if addLabel && ghToken == "" { return fmt.Errorf("github token needs to be specified to add a label") } viper.AddConfigPath(defaultConfigPath) if err := viper.ReadInConfig(); err != nil { return fmt.Errorf("error reading in config: %+v", err) } if err := viper.Unmarshal(&config); err != nil { return fmt.Errorf("failed to parse config: %+v", err) } return nil }, RunE: func(cmd *cobra.Command, args []string) error { client := github.NewClient(nil) if ghToken != "" { client.WithAuthToken(ghToken) } review, err := TimeToReview(client, owner, repository, prNumber) if err != nil { return err } if human { fmt.Printf("Estimated time to review %s/%s#%d is %d seconds (~%d minutes)\n", owner, repository, prNumber, review, review/60) } else { fmt.Println(review) } if addLabel { err := addLabelToPR(client, review) if err != nil { return err } } return nil }, }
EstimateTimeToReviewCmd is a cobra command that estimates time needed to review a PR
Functions ¶
Types ¶
type CoefficientConfig ¶
CoefficientConfig represents coefficients used in estimation of time required for a PR review
Click to show internal directories.
Click to hide internal directories.