app.sources.gitlab_settings¶
Settings of the gitlab source type, validated without I/O.
Parses the type-specific options (base_url, token_env), the
scope and the published_ref of a registration into a
GitLabConfig; see app.sources.gitlab for their meaning.
The token is resolved from the injected environment and held as a
pydantic.SecretStr; messages name the env var only.
Public API: PROJECT_DEFAULT, GitLabScope,
GitLabConfig, parse_settings().
- app.sources.gitlab_settings.PROJECT_DEFAULT = '@project-default'¶
published_refvalue selecting each project’s default branch.
- class app.sources.gitlab_settings.GitLabScope(groups, include_subgroups, projects)¶
Bases:
objectWhich projects a registration owns.
- Parameters:
- class app.sources.gitlab_settings.GitLabConfig(*, base_url, token, token_env, scope, groups, projects, path, published_ref)¶
Bases:
objectValidated settings of one
gitlabregistration.- Parameters:
base_url (
str) – Instance URL without trailing slash.token (
SecretStr) – Access token.token_env (
str) – Env var name of the token (for messages).scope (
GitLabScope) – Scope predicate.groups (
tuple[str,...]) – Configured group paths, as written.projects (
tuple[str,...]) – Configured project paths, as written.path (
str) – ADR path inside each project (may be empty).published_ref (
str) – Branch name orPROJECT_DEFAULT.
- token: SecretStr¶
- scope: GitLabScope¶
- app.sources.gitlab_settings.parse_settings(settings, env)¶
Validate a
gitlabregistration (no I/O).- Parameters:
settings (
SourceSettings) – Common settings plusoptionsandscope.env (
Mapping[str,str]) – Environment used to resolvetoken_env.
- Return type:
- Returns:
The configuration.
- Raises:
SourceConfigError – If the settings are invalid or the token env var is not set (the value is never echoed).