Skip to content

Commit

Permalink
Split ProfileService proto to ProfileService and RuleTypeService
Browse files Browse the repository at this point in the history
The `ProfileService` has methods for both profile and rule types, we
want to split them so we can keep relevant methods together

Signed-off-by: ChrisJBurns <[email protected]>
  • Loading branch information
ChrisJBurns committed Aug 21, 2024
1 parent 7551cec commit 9e03046
Show file tree
Hide file tree
Showing 12 changed files with 733 additions and 596 deletions.
4 changes: 3 additions & 1 deletion cmd/cli/app/quickstart/quickstart.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ func quickstartCommand(_ context.Context, cmd *cobra.Command, _ []string, conn *
var err error
repoClient := minderv1.NewRepositoryServiceClient(conn)
profileClient := minderv1.NewProfileServiceClient(conn)
ruleClient := minderv1.NewRuleTypeServiceClient(conn)

project := viper.GetString("project")
provider := viper.GetString("provider")
Expand Down Expand Up @@ -195,6 +196,7 @@ func quickstartCommand(_ context.Context, cmd *cobra.Command, _ []string, conn *
conn = newConn
repoClient = minderv1.NewRepositoryServiceClient(conn)
profileClient = minderv1.NewProfileServiceClient(conn)
ruleClient = minderv1.NewRuleTypeServiceClient(conn)
}

// Step 1 - Confirm enrolling
Expand Down Expand Up @@ -293,7 +295,7 @@ func quickstartCommand(_ context.Context, cmd *cobra.Command, _ []string, conn *
defer cancel()

// Create the rule type in minder
_, err = profileClient.CreateRuleType(ctx, &minderv1.CreateRuleTypeRequest{
_, err = ruleClient.CreateRuleType(ctx, &minderv1.CreateRuleTypeRequest{
RuleType: rt,
})
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/cli/app/ruletype/ruletype_apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ var applyCmd = &cobra.Command{

// applyCommand is the "rule type" apply subcommand
func applyCommand(_ context.Context, cmd *cobra.Command, _ []string, conn *grpc.ClientConn) error {
client := minderv1.NewProfileServiceClient(conn)
client := minderv1.NewRuleTypeServiceClient(conn)

project := viper.GetString("project")

Expand Down
2 changes: 1 addition & 1 deletion cmd/cli/app/ruletype/ruletype_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ var createCmd = &cobra.Command{

// createCommand is the profile create subcommand
func createCommand(_ context.Context, cmd *cobra.Command, _ []string, conn *grpc.ClientConn) error {
client := minderv1.NewProfileServiceClient(conn)
client := minderv1.NewRuleTypeServiceClient(conn)

project := viper.GetString("project")

Expand Down
4 changes: 2 additions & 2 deletions cmd/cli/app/ruletype/ruletype_delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ var deleteCmd = &cobra.Command{

// deleteCommand is the rule type delete subcommand
func deleteCommand(ctx context.Context, cmd *cobra.Command, _ []string, conn *grpc.ClientConn) error {
client := minderv1.NewProfileServiceClient(conn)
client := minderv1.NewRuleTypeServiceClient(conn)

project := viper.GetString("project")
id := viper.GetString("id")
Expand Down Expand Up @@ -108,7 +108,7 @@ func deleteCommand(ctx context.Context, cmd *cobra.Command, _ []string, conn *gr

func deleteRuleTypes(
ctx context.Context,
client minderv1.ProfileServiceClient,
client minderv1.RuleTypeServiceClient,
rulesToDelete []*minderv1.RuleType,
project string,
) ([]string, []string) {
Expand Down
2 changes: 1 addition & 1 deletion cmd/cli/app/ruletype/ruletype_get.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ type ruleTypeGetter interface {

// getCommand is the ruletype get subcommand
func getCommand(ctx context.Context, cmd *cobra.Command, _ []string, conn *grpc.ClientConn) error {
client := minderv1.NewProfileServiceClient(conn)
client := minderv1.NewRuleTypeServiceClient(conn)

project := viper.GetString("project")
format := viper.GetString("output")
Expand Down
2 changes: 1 addition & 1 deletion cmd/cli/app/ruletype/ruletype_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ var listCmd = &cobra.Command{

// listCommand is the ruletype list subcommand
func listCommand(ctx context.Context, cmd *cobra.Command, _ []string, conn *grpc.ClientConn) error {
client := minderv1.NewProfileServiceClient(conn)
client := minderv1.NewRuleTypeServiceClient(conn)

project := viper.GetString("project")
format := viper.GetString("output")
Expand Down
21 changes: 15 additions & 6 deletions docs/docs/ref/proto.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 15 additions & 12 deletions pkg/api/openapi/minder/v1/minder.swagger.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9e03046

Please sign in to comment.