Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Organizations support #24

Merged
merged 23 commits into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
mutation (
$name: String!,) {
addOrganization(input: {
CGoodwin90 marked this conversation as resolved.
Show resolved Hide resolved
name: $name,
}) {
id
name
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
mutation (
$id: Int!
){
deleteOrganization(
input: {
id: $id
}
)
}
60 changes: 60 additions & 0 deletions api/lagoon/client/_lgraphql/organizations/organizationById.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
query (
$id: Int!) {
organizationById(
CGoodwin90 marked this conversation as resolved.
Show resolved Hide resolved
organization: $id) {
id
name
description
quotaProject
friendlyName
quotaGroup
quotaNotification
shreddedbacon marked this conversation as resolved.
Show resolved Hide resolved
deployTargets {
id
name
friendlyName
cloudProvider
cloudRegion
}
owners {
id
firstName
lastName
email
owner
}
projects {
id
name
}
groups {
id
name
type
}
notifications {
... on NotificationSlack {
__typename
webhook
name
channel
}
... on NotificationRocketChat {
__typename
webhook
name
channel
}
... on NotificationEmail {
__typename
emailAddress
name
}
... on NotificationMicrosoftTeams {
__typename
webhook
name
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
query (
$name: String!) {
organizationByName(
CGoodwin90 marked this conversation as resolved.
Show resolved Hide resolved
organization: $name) {
id
name
description
quotaProject
friendlyName
quotaGroup
quotaNotification
deployTargets {
id
name
friendlyName
cloudProvider
cloudRegion
}
owners {
id
firstName
lastName
email
owner
}
projects {
id
name
}
groups {
id
name
type
}
notifications {
... on NotificationSlack {
__typename
webhook
name
channel
}
... on NotificationRocketChat {
__typename
webhook
name
channel
}
... on NotificationEmail {
__typename
emailAddress
name
}
... on NotificationMicrosoftTeams {
__typename
webhook
name
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
mutation (
$id: Int!
$patch: UpdateOrganizationPatchInput!){
updateOrganization(
input: {
id: $id
patch: $patch
}
){
id
name
}
}
2 changes: 1 addition & 1 deletion api/lagoon/client/client.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//go:generate go-bindata -pkg lgraphql -o lgraphql/lgraphql.go -nometadata _lgraphql/ _lgraphql/deployments/ _lgraphql/deploytargets/ _lgraphql/deploytargetconfigs/ _lgraphql/projects/ _lgraphql/environments/ _lgraphql/tasks/ _lgraphql/usergroups/
//go:generate go-bindata -pkg lgraphql -o lgraphql/lgraphql.go -nometadata _lgraphql/ _lgraphql/deployments/ _lgraphql/deploytargets/ _lgraphql/deploytargetconfigs/ _lgraphql/projects/ _lgraphql/environments/ _lgraphql/tasks/ _lgraphql/usergroups/ _lgraphql/organizations/

// Package client implements the interfaces required by the parent lagoon
// package.
Expand Down
117 changes: 117 additions & 0 deletions api/lagoon/client/lgraphql/lgraphql.go

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

2 changes: 1 addition & 1 deletion api/lagoon/client/mutation.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/uselagoon/machinery/api/schema"
)

var duplicate = regexp.MustCompile("^graphql: Duplicate entry ")
var duplicate = regexp.MustCompile("(?s).*graphql.*Duplicate entry.* ")

// wrapErr wraps a response error with a lagoon.ErrExist type if the response
// is due to an object already existing
Expand Down
Loading