Copyright | (c) Red Hat 2022 |
---|---|
License | Apache-2.0 |
Maintainer | tdecacqu@redhat.com, fboucher@redhat.com |
Stability | provisional |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | GHC2021 |
This module contains the core configuration graph. The config analysis results looks like this:
Synopsis
- type ConfigGraph = Graph Vertex
- data Analysis = Analysis {
- dependencyGraph :: ConfigGraph
- dependentGraph :: ConfigGraph
- vertices :: Set Vertex
- names :: Map VertexName (Set TenantName)
- config :: Config
- graphErrors :: [String]
- data Vertex = Vertex {
- name :: VertexName
- tenants :: Set TenantName
- data VertexName
- = VAbstractJob JobName
- | VJob JobName
- | VSecret SecretName
- | VSemaphore SemaphoreName
- | VNodeset NodesetName
- | VNodeLabel NodeLabelName
- | VQueue QueueName
- | VProject CanonicalProjectName
- | VProjectRegex ProjectRegex
- | VProjectTemplate ProjectTemplateName
- | VPipeline PipelineName
- | VProjectPipeline PipelineName CanonicalProjectName
- | VRegexPipeline PipelineName ProjectRegex
- | VTemplatePipeline PipelineName ProjectTemplateName
- | VTrigger ConnectionName
- | VReporter ConnectionName
- analyzeConfig :: TenantsConfig -> Config -> Analysis
- findReachable :: NonEmpty Vertex -> ConfigGraph -> Set Vertex
- findReachableForest :: Maybe (Set TenantName) -> NonEmpty Vertex -> ConfigGraph -> Forest VertexName
Documentation
type ConfigGraph = Graph Vertex Source #
A convenient type alias.
The config analysis result used by the ZuulWeeder.UI module.
Analysis | |
|
Instances
Generic Analysis Source # | |
Show Analysis Source # | |
type Rep Analysis Source # | |
Defined in ZuulWeeder.Graph type Rep Analysis = D1 ('MetaData "Analysis" "ZuulWeeder.Graph" "zuul-weeder-0.1.0.0-inplace" 'False) (C1 ('MetaCons "Analysis" 'PrefixI 'True) ((S1 ('MetaSel ('Just "dependencyGraph") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ConfigGraph) :*: (S1 ('MetaSel ('Just "dependentGraph") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ConfigGraph) :*: S1 ('MetaSel ('Just "vertices") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Set Vertex)))) :*: (S1 ('MetaSel ('Just "names") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map VertexName (Set TenantName))) :*: (S1 ('MetaSel ('Just "config") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Config) :*: S1 ('MetaSel ('Just "graphErrors") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [String]))))) |
The graph vertex
Vertex | |
|
Instances
Generic Vertex Source # | |
Show Vertex Source # | |
Eq Vertex Source # | |
Ord Vertex Source # | |
Hashable Vertex Source # | |
Defined in ZuulWeeder.Graph | |
type Rep Vertex Source # | |
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
VAbstractJob JobName | An abstract job |
VJob JobName | A job |
VSecret SecretName | A secret |
VSemaphore SemaphoreName | A semaphore |
VNodeset NodesetName | A nodeset |
VNodeLabel NodeLabelName | A node label |
VQueue QueueName | A queue |
VProject CanonicalProjectName | A project |
VProjectRegex ProjectRegex | A project regex |
VProjectTemplate ProjectTemplateName | A project template |
VPipeline PipelineName | A pipeline |
VProjectPipeline PipelineName CanonicalProjectName | A project pipeline config |
VRegexPipeline PipelineName ProjectRegex | A project regex config |
VTemplatePipeline PipelineName ProjectTemplateName | A template pipeline config |
VTrigger ConnectionName | A pipeline trigger |
VReporter ConnectionName | A pipeline reporter |
Instances
analyzeConfig :: TenantsConfig -> Config -> Analysis Source #
The main function to build the Analysis
.
:: NonEmpty Vertex | The list of |
-> ConfigGraph | The graph to search in |
-> Set Vertex | The list of reachable |
Return the list of reachable Vertex
:: Maybe (Set TenantName) | |
-> NonEmpty Vertex | The list of |
-> ConfigGraph | The graph to search in |
-> Forest VertexName | The forest |
Return the forest of reachable Vertex