Skip to content

Commit

Permalink
Fix router filter logic (#1440)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeljguarino authored Oct 8, 2024
1 parent dd259fc commit 62a21cf
Show file tree
Hide file tree
Showing 33 changed files with 627 additions and 45 deletions.
2 changes: 1 addition & 1 deletion AGENT_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.4.49
v0.4.50
37 changes: 35 additions & 2 deletions assets/src/generated/graphql-plural.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1821,6 +1821,8 @@ export type OidcAttributes = {
authMethod: OidcAuthMethod;
/** The users or groups that can login through the OIDC provider. */
bindings?: InputMaybe<Array<InputMaybe<BindingAttributes>>>;
description?: InputMaybe<Scalars['String']['input']>;
name?: InputMaybe<Scalars['String']['input']>;
/** The redirect URIs for the OIDC provider. */
redirectUris?: InputMaybe<Array<InputMaybe<Scalars['String']['input']>>>;
};
Expand Down Expand Up @@ -1866,9 +1868,12 @@ export type OidcProvider = {
clientSecret: Scalars['String']['output'];
configuration?: Maybe<OuathConfiguration>;
consent?: Maybe<ConsentRequest>;
description?: Maybe<Scalars['String']['output']>;
id: Scalars['ID']['output'];
insertedAt?: Maybe<Scalars['DateTime']['output']>;
invites?: Maybe<Array<Maybe<Invite>>>;
name?: Maybe<Scalars['String']['output']>;
owner?: Maybe<User>;
redirectUris?: Maybe<Array<Maybe<Scalars['String']['output']>>>;
updatedAt?: Maybe<Scalars['DateTime']['output']>;
};
Expand All @@ -1882,6 +1887,18 @@ export type OidcProviderBinding = {
user?: Maybe<User>;
};

export type OidcProviderConnection = {
__typename?: 'OidcProviderConnection';
edges?: Maybe<Array<Maybe<OidcProviderEdge>>>;
pageInfo: PageInfo;
};

export type OidcProviderEdge = {
__typename?: 'OidcProviderEdge';
cursor?: Maybe<Scalars['String']['output']>;
node?: Maybe<OidcProvider>;
};

export type OidcSettings = {
__typename?: 'OidcSettings';
authMethod: OidcAuthMethod;
Expand Down Expand Up @@ -2864,6 +2881,7 @@ export type RootMutationType = {
deleteInvite?: Maybe<Invite>;
deleteKeyBackup?: Maybe<KeyBackup>;
deleteMessage?: Maybe<IncidentMessage>;
deleteOidcProvider?: Maybe<OidcProvider>;
deletePaymentMethod?: Maybe<PaymentMethod>;
deletePlatformSubscription?: Maybe<Account>;
deletePublicKey?: Maybe<PublicKey>;
Expand Down Expand Up @@ -3080,7 +3098,7 @@ export type RootMutationTypeCreateOauthIntegrationArgs = {

export type RootMutationTypeCreateOidcProviderArgs = {
attributes: OidcAttributes;
installationId: Scalars['ID']['input'];
installationId?: InputMaybe<Scalars['ID']['input']>;
};


Expand Down Expand Up @@ -3296,6 +3314,11 @@ export type RootMutationTypeDeleteMessageArgs = {
};


export type RootMutationTypeDeleteOidcProviderArgs = {
id: Scalars['ID']['input'];
};


export type RootMutationTypeDeletePaymentMethodArgs = {
id: Scalars['ID']['input'];
};
Expand Down Expand Up @@ -3632,7 +3655,8 @@ export type RootMutationTypeUpdateMessageArgs = {

export type RootMutationTypeUpdateOidcProviderArgs = {
attributes: OidcAttributes;
installationId: Scalars['ID']['input'];
id?: InputMaybe<Scalars['ID']['input']>;
installationId?: InputMaybe<Scalars['ID']['input']>;
};


Expand Down Expand Up @@ -3793,6 +3817,7 @@ export type RootQueryType = {
oidcConsent?: Maybe<OidcStepResponse>;
oidcLogin?: Maybe<OidcStepResponse>;
oidcLogins?: Maybe<OidcLoginConnection>;
oidcProviders?: Maybe<OidcProviderConnection>;
oidcToken?: Maybe<Scalars['String']['output']>;
platformMetrics?: Maybe<PlatformMetrics>;
platformPlans?: Maybe<Array<Maybe<PlatformPlan>>>;
Expand Down Expand Up @@ -4148,6 +4173,14 @@ export type RootQueryTypeOidcLoginsArgs = {
};


export type RootQueryTypeOidcProvidersArgs = {
after?: InputMaybe<Scalars['String']['input']>;
before?: InputMaybe<Scalars['String']['input']>;
first?: InputMaybe<Scalars['Int']['input']>;
last?: InputMaybe<Scalars['Int']['input']>;
};


export type RootQueryTypeOidcTokenArgs = {
email: Scalars['String']['input'];
idToken: Scalars['String']['input'];
Expand Down
49 changes: 49 additions & 0 deletions assets/src/generated/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3345,6 +3345,33 @@ export enum ObserverTargetType {
Oci = 'OCI'
}

/** A representation of a created OIDC provider client */
export type OidcProvider = {
__typename?: 'OidcProvider';
/** the generated client ID used in configuring OAuth clients */
clientId: Scalars['String']['output'];
/** the generated client secret, used in configuring an OAuth client */
clientSecret: Scalars['String']['output'];
description?: Maybe<Scalars['String']['output']>;
id: Scalars['ID']['output'];
name: Scalars['String']['output'];
/** the redirect uris oidc is whitelisted to use */
redirectUris?: Maybe<Array<Maybe<Scalars['String']['output']>>>;
};

/** Configuration settings for creating a new OIDC provider client */
export type OidcProviderAttributes = {
description?: InputMaybe<Scalars['String']['input']>;
name: Scalars['String']['input'];
/** the redirect uris oidc is whitelisted to use */
redirectUris?: InputMaybe<Array<InputMaybe<Scalars['String']['input']>>>;
};

/** Supported OIDC-compatible Auth Providers */
export enum OidcProviderType {
Plural = 'PLURAL'
}

export enum Operation {
Eq = 'EQ',
Gt = 'GT',
Expand Down Expand Up @@ -4664,6 +4691,7 @@ export type RootMutationType = {
createInvite?: Maybe<Invite>;
createManagedNamespace?: Maybe<ManagedNamespace>;
createObjectStore?: Maybe<ObjectStore>;
createOidcProvider?: Maybe<OidcProvider>;
createPeer?: Maybe<WireguardPeer>;
createPersona?: Maybe<Persona>;
createPinnedCustomResource?: Maybe<PinnedCustomResource>;
Expand Down Expand Up @@ -4704,6 +4732,7 @@ export type RootMutationType = {
deleteObjectStore?: Maybe<ObjectStore>;
deleteObservabilityProvider?: Maybe<ObservabilityProvider>;
deleteObserver?: Maybe<Observer>;
deleteOidcProvider?: Maybe<OidcProvider>;
deletePeer?: Maybe<Scalars['Boolean']['output']>;
deletePersona?: Maybe<Persona>;
deletePinnedCustomResource?: Maybe<PinnedCustomResource>;
Expand Down Expand Up @@ -4795,6 +4824,7 @@ export type RootMutationType = {
updateGroup?: Maybe<Group>;
updateManagedNamespace?: Maybe<ManagedNamespace>;
updateObjectStore?: Maybe<ObjectStore>;
updateOidcProvider?: Maybe<OidcProvider>;
updatePersona?: Maybe<Persona>;
updatePrAutomation?: Maybe<PrAutomation>;
updateProject?: Maybe<Project>;
Expand Down Expand Up @@ -4954,6 +4984,12 @@ export type RootMutationTypeCreateObjectStoreArgs = {
};


export type RootMutationTypeCreateOidcProviderArgs = {
attributes: OidcProviderAttributes;
type: OidcProviderType;
};


export type RootMutationTypeCreatePeerArgs = {
email?: InputMaybe<Scalars['String']['input']>;
name: Scalars['String']['input'];
Expand Down Expand Up @@ -5154,6 +5190,12 @@ export type RootMutationTypeDeleteObserverArgs = {
};


export type RootMutationTypeDeleteOidcProviderArgs = {
id: Scalars['ID']['input'];
type: OidcProviderType;
};


export type RootMutationTypeDeletePeerArgs = {
name: Scalars['String']['input'];
};
Expand Down Expand Up @@ -5555,6 +5597,13 @@ export type RootMutationTypeUpdateObjectStoreArgs = {
};


export type RootMutationTypeUpdateOidcProviderArgs = {
attributes: OidcProviderAttributes;
id: Scalars['ID']['input'];
type: OidcProviderType;
};


export type RootMutationTypeUpdatePersonaArgs = {
attributes: PersonaAttributes;
id: Scalars['ID']['input'];
Expand Down
14 changes: 13 additions & 1 deletion charts/controller/crds/deployments.plural.sh_observers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,20 @@ spec:
description: ObserverSpec defines the desired state of Observer
properties:
actions:
description: A list of predefined actions to take if a new Target
is discovered in the last poll loop
items:
properties:
configuration:
description: The configuration for the given action, relative
to its current Type
properties:
pipeline:
properties:
context:
description: Context is a templated context that will
become the PipelineContext applied to the given pipeline,
use `$value` to interpolate the observed value
type: object
x-kubernetes-preserve-unknown-fields: true
pipelineRef:
Expand Down Expand Up @@ -109,7 +116,9 @@ spec:
value
type: string
context:
description: Context is a ObserverPrAction context
description: Context is a templated context that will
become the context applied to the given PR Automation,
use `$value` to interpolate the observed value
type: object
x-kubernetes-preserve-unknown-fields: true
prAutomationRef:
Expand Down Expand Up @@ -173,6 +182,7 @@ spec:
type: object
type: array
crontab:
description: The crontab you will poll the given Target with
type: string
name:
description: the name of this observer, if not provided Observer's
Expand Down Expand Up @@ -225,6 +235,8 @@ spec:
type: object
x-kubernetes-map-type: atomic
target:
description: The target object to poll, triggering the list of Actions
w/ the discovered value
properties:
format:
type: string
Expand Down
61 changes: 61 additions & 0 deletions go/client/models_gen.go

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

7 changes: 6 additions & 1 deletion go/controller/api/v1alpha1/observer_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@ type ObserverSpec struct {
// +kubebuilder:validation:Optional
Name *string `json:"name,omitempty"`

// The crontab you will poll the given Target with
Crontab string `json:"crontab"`

// The target object to poll, triggering the list of Actions w/ the discovered value
Target ObserverTarget `json:"target"`

// A list of predefined actions to take if a new Target is discovered in the last poll loop
Actions []ObserverAction `json:"actions,omitempty"`

// ProjectRef references project this observer belongs to.
Expand All @@ -31,6 +34,7 @@ type ObserverAction struct {
// +kubebuilder:validation:Enum:=PIPELINE;PR
Type console.ObserverActionType `json:"type"`

// The configuration for the given action, relative to its current Type
Configuration ObserverConfiguration `json:"configuration"`
}

Expand All @@ -47,14 +51,15 @@ type ObserverPrAction struct {
// BranchTemplate a template to use for the created branch, use $value to interject the observed value
BranchTemplate *string `json:"branchTemplate,omitempty"`

// Context is a ObserverPrAction context
// Context is a templated context that will become the context applied to the given PR Automation, use `$value` to interpolate the observed value
Context runtime.RawExtension `json:"context,omitempty"`
}

type ObserverPipelineAction struct {
// PipelineRef references to Pipeline.
PipelineRef v1.ObjectReference `json:"pipelineRef"`

// Context is a templated context that will become the PipelineContext applied to the given pipeline, use `$value` to interpolate the observed value
Context runtime.RawExtension `json:"context,omitempty"`
}

Expand Down
Loading

0 comments on commit 62a21cf

Please sign in to comment.