zuul-weeder-0.1.0.0: Zuul configuration analyzer
Copyright(c) Red Hat 2022
LicenseApache-2.0
Maintainertdecacqu@redhat.com, fboucher@redhat.com
Stabilityprovisional
Portabilityportable
Safe HaskellSafe-Inferred
LanguageGHC2021

ZuulWeeder.Graph

Description

This module contains the core configuration graph. The config analysis results looks like this:

Synopsis

Documentation

type ConfigGraph = Graph Vertex Source #

A convenient type alias.

data Analysis Source #

The config analysis result used by the ZuulWeeder.UI module.

Constructors

Analysis 

Fields

Instances

Instances details
Generic Analysis Source # 
Instance details

Defined in ZuulWeeder.Graph

Associated Types

type Rep Analysis :: Type -> Type #

Methods

from :: Analysis -> Rep Analysis x #

to :: Rep Analysis x -> Analysis #

Show Analysis Source # 
Instance details

Defined in ZuulWeeder.Graph

type Rep Analysis Source # 
Instance details

Defined in ZuulWeeder.Graph

data Vertex Source #

The graph vertex

Constructors

Vertex 

Fields

Instances

Instances details
Generic Vertex Source # 
Instance details

Defined in ZuulWeeder.Graph

Associated Types

type Rep Vertex :: Type -> Type #

Methods

from :: Vertex -> Rep Vertex x #

to :: Rep Vertex x -> Vertex #

Show Vertex Source # 
Instance details

Defined in ZuulWeeder.Graph

Eq Vertex Source # 
Instance details

Defined in ZuulWeeder.Graph

Methods

(==) :: Vertex -> Vertex -> Bool #

(/=) :: Vertex -> Vertex -> Bool #

Ord Vertex Source # 
Instance details

Defined in ZuulWeeder.Graph

Hashable Vertex Source # 
Instance details

Defined in ZuulWeeder.Graph

Methods

hashWithSalt :: Int -> Vertex -> Int #

hash :: Vertex -> Int #

type Rep Vertex Source # 
Instance details

Defined in ZuulWeeder.Graph

type Rep Vertex = D1 ('MetaData "Vertex" "ZuulWeeder.Graph" "zuul-weeder-0.1.0.0-inplace" 'False) (C1 ('MetaCons "Vertex" 'PrefixI 'True) (S1 ('MetaSel ('Just "name") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 VertexName) :*: S1 ('MetaSel ('Just "tenants") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Set TenantName))))

data VertexName Source #

A Vertex can be a raw zuul config element, or a custom element added through analysis

Instances

Instances details
Generic VertexName Source # 
Instance details

Defined in ZuulWeeder.Graph

Associated Types

type Rep VertexName :: Type -> Type #

Show VertexName Source # 
Instance details

Defined in ZuulWeeder.Graph

Eq VertexName Source # 
Instance details

Defined in ZuulWeeder.Graph

Ord VertexName Source # 
Instance details

Defined in ZuulWeeder.Graph

Hashable VertexName Source # 
Instance details

Defined in ZuulWeeder.Graph

From CanonicalProjectName VertexName Source # 
Instance details

Defined in ZuulWeeder.Graph

From Job VertexName Source # 
Instance details

Defined in ZuulWeeder.Graph

Methods

from :: Job -> VertexName #

From NodeLabelName VertexName Source # 
Instance details

Defined in ZuulWeeder.Graph

From Nodeset VertexName Source # 
Instance details

Defined in ZuulWeeder.Graph

Methods

from :: Nodeset -> VertexName #

From Pipeline VertexName Source # 
Instance details

Defined in ZuulWeeder.Graph

Methods

from :: Pipeline -> VertexName #

From ProjectRegex VertexName Source # 
Instance details

Defined in ZuulWeeder.Graph

From ProjectTemplate VertexName Source # 
Instance details

Defined in ZuulWeeder.Graph

From QueueName VertexName Source # 
Instance details

Defined in ZuulWeeder.Graph

Methods

from :: QueueName -> VertexName #

From SecretName VertexName Source # 
Instance details

Defined in ZuulWeeder.Graph

From SemaphoreName VertexName Source # 
Instance details

Defined in ZuulWeeder.Graph

From VertexName Text Source # 
Instance details

Defined in ZuulWeeder.Graph

Methods

from :: VertexName -> Text #

type Rep VertexName Source # 
Instance details

Defined in ZuulWeeder.Graph

type Rep VertexName = D1 ('MetaData "VertexName" "ZuulWeeder.Graph" "zuul-weeder-0.1.0.0-inplace" 'False) ((((C1 ('MetaCons "VAbstractJob" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 JobName)) :+: C1 ('MetaCons "VJob" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 JobName))) :+: (C1 ('MetaCons "VSecret" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SecretName)) :+: C1 ('MetaCons "VSemaphore" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SemaphoreName)))) :+: ((C1 ('MetaCons "VNodeset" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 NodesetName)) :+: C1 ('MetaCons "VNodeLabel" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 NodeLabelName))) :+: (C1 ('MetaCons "VQueue" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 QueueName)) :+: C1 ('MetaCons "VProject" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CanonicalProjectName))))) :+: (((C1 ('MetaCons "VProjectRegex" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ProjectRegex)) :+: C1 ('MetaCons "VProjectTemplate" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ProjectTemplateName))) :+: (C1 ('MetaCons "VPipeline" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PipelineName)) :+: C1 ('MetaCons "VProjectPipeline" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PipelineName) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CanonicalProjectName)))) :+: ((C1 ('MetaCons "VRegexPipeline" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PipelineName) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ProjectRegex)) :+: C1 ('MetaCons "VTemplatePipeline" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PipelineName) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ProjectTemplateName))) :+: (C1 ('MetaCons "VTrigger" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ConnectionName)) :+: C1 ('MetaCons "VReporter" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ConnectionName))))))

analyzeConfig :: TenantsConfig -> Config -> Analysis Source #

The main function to build the Analysis .

findReachable Source #

Arguments

:: NonEmpty Vertex

The list of Vertex to search

-> ConfigGraph

The graph to search in

-> Set Vertex

The list of reachable Vertex

Return the list of reachable Vertex

findReachableForest Source #

Arguments

:: Maybe (Set TenantName) 
-> NonEmpty Vertex

The list of Vertex to search

-> ConfigGraph

The graph to search in

-> Forest VertexName

The forest

Return the forest of reachable Vertex