-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #196 from OpsLevel/db/setup-team-hierarchies
add Parent Teams to add, create, import of teams
- Loading branch information
Showing
3 changed files
with
16 additions
and
10 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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
kind: Feature | ||
body: add "parentTeam" field to "import teams" command and team command examples | ||
time: 2023-10-30T15:00:50.727989-05:00 |
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,3 @@ | ||
kind: Removed | ||
body: remove "group" field from "import teams" command | ||
time: 2023-10-30T15:00:05.134799-05:00 |
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 |
---|---|---|
|
@@ -20,9 +20,9 @@ var createTeamCmd = &cobra.Command{ | |
Example: `opslevel create team my-team | ||
cat << EOF | opslevel create team my-team" -f - | ||
managerEmail: "[email protected]"" | ||
group: | ||
alias: "my-group" | ||
managerEmail: "[email protected]" | ||
parentTeam: | ||
alias: "parent-team" | ||
responsibilities: "all the things" | ||
EOF`, | ||
Args: cobra.ExactArgs(1), | ||
|
@@ -120,8 +120,8 @@ var updateTeamCmd = &cobra.Command{ | |
Example: ` | ||
cat << EOF | opslevel update team my-team" -f - | ||
managerEmail: "[email protected]"" | ||
group: | ||
alias: "my-group" | ||
parentTeam: | ||
alias: "parent-team-2" | ||
responsibilities: "all the things" | ||
EOF | ||
`, | ||
|
@@ -271,10 +271,10 @@ var importTeamsCmd = &cobra.Command{ | |
Aliases: []string{"teams"}, | ||
Short: "Imports teams from a CSV", | ||
Long: `Imports a list of teams from a CSV file with the column headers: | ||
Name,Manager,Responsibilities,Group`, | ||
Name,Manager,Responsibilities,ParentTeam`, | ||
Example: ` | ||
cat << EOF | opslevel import teams -f - | ||
Name,Manager,Responsibilities,Group | ||
Name,Manager,Responsibilities,ParentTeam | ||
Platform,[email protected],Makes Tools,engineering | ||
Sales,[email protected],Sells Tools,product | ||
EOF | ||
|
@@ -289,9 +289,9 @@ EOF | |
ManagerEmail: reader.Text("Manager"), | ||
Responsibilities: reader.Text("Responsibilities"), | ||
} | ||
group := reader.Text("Group") | ||
if group != "" { | ||
input.Group = opslevel.NewIdentifier(group) | ||
parentTeam := reader.Text("ParentTeam") | ||
if parentTeam != "" { | ||
input.ParentTeam = opslevel.NewIdentifier(parentTeam) | ||
} | ||
team, err := getClientGQL().CreateTeam(input) | ||
if err != nil { | ||
|