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

Zuul.ConfigLoader

Description

This module contains the logic to decode configuration file content.

Synopsis

The resulting configuration

type ConfigMap a b = Map a [(ConfigLoc, b)] Source #

A config map contains the list of every variants associated with their location.

data Config Source #

The global configuration map.

Instances

Instances details
FromJSON Config Source # 
Instance details

Defined in Zuul.ConfigLoader

ToJSON Config Source # 
Instance details

Defined in Zuul.ConfigLoader

Generic Config Source # 
Instance details

Defined in Zuul.ConfigLoader

Associated Types

type Rep Config :: Type -> Type #

Methods

from :: Config -> Rep Config x #

to :: Rep Config x -> Config #

Show Config Source # 
Instance details

Defined in Zuul.ConfigLoader

type Rep Config Source # 
Instance details

Defined in Zuul.ConfigLoader

type Rep Config = D1 ('MetaData "Config" "Zuul.ConfigLoader" "zuul-weeder-0.1.0.0-inplace" 'False) (C1 ('MetaCons "Config" 'PrefixI 'True) (((S1 ('MetaSel ('Just "jobs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ConfigMap JobName Job)) :*: (S1 ('MetaSel ('Just "nodesets") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ConfigMap NodesetName Nodeset)) :*: S1 ('MetaSel ('Just "nodeLabels") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ConfigMap NodeLabelName NodeLabelName)))) :*: ((S1 ('MetaSel ('Just "projects") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ConfigMap CanonicalProjectName Project)) :*: S1 ('MetaSel ('Just "projectRegexs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ConfigMap ProjectRegex Project))) :*: (S1 ('MetaSel ('Just "projectTemplates") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ConfigMap ProjectTemplateName ProjectTemplate)) :*: S1 ('MetaSel ('Just "pipelines") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ConfigMap PipelineName Pipeline))))) :*: ((S1 ('MetaSel ('Just "secrets") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ConfigMap SecretName SecretName)) :*: (S1 ('MetaSel ('Just "queues") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ConfigMap QueueName QueueName)) :*: S1 ('MetaSel ('Just "semaphores") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ConfigMap SemaphoreName SemaphoreName)))) :*: ((S1 ('MetaSel ('Just "triggers") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ConfigMap ConnectionName ConnectionName)) :*: S1 ('MetaSel ('Just "reporters") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ConfigMap ConnectionName ConnectionName))) :*: (S1 ('MetaSel ('Just "configErrors") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [ConfigError]) :*: S1 ('MetaSel ('Just "tenants") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Set TenantName)))))))

data ConfigError Source #

The list of config error that can happens when loading the configuration.

Instances

Instances details
FromJSON ConfigError Source # 
Instance details

Defined in Zuul.ZooKeeper

ToJSON ConfigError Source # 
Instance details

Defined in Zuul.ZooKeeper

Generic ConfigError Source # 
Instance details

Defined in Zuul.ZooKeeper

Associated Types

type Rep ConfigError :: Type -> Type #

Show ConfigError Source # 
Instance details

Defined in Zuul.ZooKeeper

Eq ConfigError Source # 
Instance details

Defined in Zuul.ZooKeeper

type Rep ConfigError Source # 
Instance details

Defined in Zuul.ZooKeeper

loadConfig Source #

Arguments

:: ConnectionUrlMap

The map of the connection urls.

-> TenantResolver

The helper to resolve the matching tenant list.

-> Either ConfigError ZKFile

The configuration object file to load.

-> StateT Config IO ()

The computation to update the config.

The main function to decode a ZKFile

mergeConfig :: Config -> Config -> Config Source #

Merge two configurations by assigning unique tenant names.

emptyConfig :: Set TenantName -> Config Source #

An empty config.

data TenantResolver Source #

Tenant information to resolve project location

Test helper

decodeConfig :: (CanonicalProjectName, BranchName) -> Value -> [Decoder ZuulConfigElement] Source #

Low level helper to decode a config file into a list of ZuulConfigElement.