Skip to content

Commit

Permalink
switch to generated IDs instead of incremental, displayID instead of …
Browse files Browse the repository at this point in the history
…indentifier

Signed-off-by: Sarah Funkhouser <[email protected]>
  • Loading branch information
golanglemonade committed Jan 19, 2025
1 parent a13bdb7 commit e820595
Show file tree
Hide file tree
Showing 180 changed files with 17,628 additions and 11,497 deletions.
4 changes: 2 additions & 2 deletions cmd/cli/cmd/internalpolicy/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ func jsonOutput(out any) error {
// tableOutput prints the output in a table format
func tableOutput(out []openlaneclient.InternalPolicy) {
// create a table writer
writer := tables.NewTableWriter(command.OutOrStdout(), "ID", "Identifier", "Name", "Description", "Status", "Type", "Version", "Purpose", "Background")
writer := tables.NewTableWriter(command.OutOrStdout(), "ID", "DisplayID", "Name", "Description", "Status", "Type", "Version", "Purpose", "Background")
for _, i := range out {
writer.AddRow(i.ID, i.Identifier, i.Name, *i.Description, *i.Status, *i.PolicyType, *i.Version, *i.PurposeAndScope, *i.Background)
writer.AddRow(i.ID, i.DisplayID, i.Name, *i.Description, *i.Status, *i.PolicyType, *i.Version, *i.PurposeAndScope, *i.Background)
}

writer.Render()
Expand Down
4 changes: 2 additions & 2 deletions cmd/cli/cmd/procedure/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ func jsonOutput(out any) error {
// tableOutput prints the output in a table format
func tableOutput(out []openlaneclient.Procedure) {
// create a table writer
writer := tables.NewTableWriter(command.OutOrStdout(), "ID", "Identifier", "Name", "Description", "Status", "Type", "Version", "Purpose", "Background", "Satisfies")
writer := tables.NewTableWriter(command.OutOrStdout(), "ID", "DisplayID", "Name", "Description", "Status", "Type", "Version", "Purpose", "Background", "Satisfies")
for _, i := range out {
writer.AddRow(i.ID, i.Identifier, i.Name, *i.Description, *i.Status, *i.ProcedureType, *i.Version, *i.PurposeAndScope, *i.Background, *i.Satisfies)
writer.AddRow(i.ID, i.DisplayID, i.Name, *i.Description, *i.Status, *i.ProcedureType, *i.Version, *i.PurposeAndScope, *i.Background, *i.Satisfies)
}

writer.Render()
Expand Down
4 changes: 2 additions & 2 deletions cmd/cli/cmd/program/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ func jsonOutput(out any) error {
// tableOutput prints the output in a table format
func tableOutput(out []openlaneclient.Program) {
// create a table writer
writer := tables.NewTableWriter(command.OutOrStdout(), "ID", "Identifier", "Name", "Description", "Status", "AuditorReady", "AuditorWriteComments", "AuditorReadComments", "StartDate", "EndDate")
writer := tables.NewTableWriter(command.OutOrStdout(), "ID", "DisplayID", "Name", "Description", "Status", "AuditorReady", "AuditorWriteComments", "AuditorReadComments", "StartDate", "EndDate")
for _, i := range out {
writer.AddRow(i.ID, i.Identifier, i.Name, *i.Description, i.Status, i.AuditorReady, i.AuditorWriteComments, i.AuditorReadComments, i.StartDate, i.EndDate)
writer.AddRow(i.ID, i.DisplayID, i.Name, *i.Description, i.Status, i.AuditorReady, i.AuditorWriteComments, i.AuditorReadComments, i.StartDate, i.EndDate)
}

writer.Render()
Expand Down
4 changes: 2 additions & 2 deletions cmd/cli/cmd/risk/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func jsonOutput(out any) error {
// tableOutput prints the output in a table format
func tableOutput(out []openlaneclient.Risk) {
// create a table writer
writer := tables.NewTableWriter(command.OutOrStdout(), "ID", "Identifier", "Name", "Program(s)", "RiskType", "BusinessCosts", "Impact", "Likelihood", "Mitigation", "Satisfies")
writer := tables.NewTableWriter(command.OutOrStdout(), "ID", "DisplayID", "Name", "Program(s)", "RiskType", "BusinessCosts", "Impact", "Likelihood", "Mitigation", "Satisfies")

for _, i := range out {
programs := []string{}
Expand All @@ -97,7 +97,7 @@ func tableOutput(out []openlaneclient.Risk) {
programs = append(programs, p.Name)
}

writer.AddRow(i.ID, i.Identifier, i.Name, strings.Join(programs, ","), *i.RiskType, *i.BusinessCosts, *i.Impact, *i.Likelihood, *i.Mitigation, *i.Satisfies)
writer.AddRow(i.ID, i.DisplayID, i.Name, strings.Join(programs, ","), *i.RiskType, *i.BusinessCosts, *i.Impact, *i.Likelihood, *i.Mitigation, *i.Satisfies)
}

writer.Render()
Expand Down
2 changes: 1 addition & 1 deletion cmd/cli/cmd/task/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func createValidation() (input openlaneclient.CreateTaskInput, err error) {

organization := cmd.Config.String("organization")
if organization != "" {
input.OrganizationIDs = []string{organization}
input.OwnerID = &organization
}

group := cmd.Config.String("group")
Expand Down
4 changes: 2 additions & 2 deletions cmd/cli/cmd/task/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func jsonOutput(out any) error {
// tableOutput prints the output in a table format
func tableOutput(out []openlaneclient.Task) {
// create a table writer
writer := tables.NewTableWriter(command.OutOrStdout(), "ID", "Identifier", "Title", "Description", "Details", "Assignee", "Assigner", "Status", "Due")
writer := tables.NewTableWriter(command.OutOrStdout(), "ID", "DisplayID", "Title", "Description", "Details", "Assignee", "Assigner", "Status", "Due")

for _, i := range out {
assignee := ""
Expand All @@ -109,7 +109,7 @@ func tableOutput(out []openlaneclient.Task) {
dueDate = i.Due.Format(time.RFC3339)
}

writer.AddRow(i.ID, i.Identifier, i.Title, *i.Description, details, assignee, i.Assigner.ID, i.Status, dueDate)
writer.AddRow(i.ID, i.DisplayID, i.Title, *i.Description, details, assignee, i.Assigner.ID, i.Status, dueDate)
}

writer.Render()
Expand Down
12 changes: 0 additions & 12 deletions cmd/cli/cmd/task/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ func init() {
updateCmd.Flags().StringP("status", "s", "", "status of the task")
updateCmd.Flags().StringP("assignee", "a", "", "assignee (user ID) of the task")
updateCmd.Flags().Duration("due", 0, "time until due date of the task")
updateCmd.Flags().StringP("add-organization", "o", "", "organization ID to own the task, this will give the organization access to the task")
updateCmd.Flags().String("remove-organization", "", "organization ID to own the task, this will give the organization access to the task")
updateCmd.Flags().StringP("add-group", "g", "", "group ID to own the task, this will give the group access to the task")
updateCmd.Flags().String("remove-group", "", "group ID to own the task, this will give the group access to the task")
}
Expand Down Expand Up @@ -72,16 +70,6 @@ func updateValidation() (id string, input openlaneclient.UpdateTaskInput, err er
input.Due = &dueDate
}

organization := cmd.Config.String("add-organization")
if organization != "" {
input.AddOrganizationIDs = []string{organization}
}

organization = cmd.Config.String("remove-organization")
if organization != "" {
input.RemoveOrganizationIDs = []string{organization}
}

group := cmd.Config.String("add-group")
if group != "" {
input.AddGroupIDs = []string{group}
Expand Down
Loading

0 comments on commit e820595

Please sign in to comment.