Specification: Table Configuration (table_config.yaml)
Title and Purpose
Defines the external, user-editable YAML file (table_config.yaml) that controls which columns appear in the repository-overview table, their order, labels, visibility, and the default sort order & group notes used by downstream renderers.
The file is loaded at runtime via Settings.table_config (see src/gitlab_overviewer/config/settings.py) and is consumed by the sorting and rendering infrastructure (Table Sorting, Table Rendering & UI).
Scope and Boundaries
In scope – file structure, required/optional keys, validation rules, default behaviour, error handling.
Out of scope – CLI flags that override sorting (
--sort) or alternative configuration sources.Dependencies – relies on the column semantics defined in the data model and the behaviour specified in related specs above.
1 YAML Top-Level Keys
Key |
Type |
Required |
Purpose |
|---|---|---|---|
|
list(dict) |
Yes |
Declares table columns (order = list order). |
|
list(str) |
No |
Fallback sort keys (§3) when the user supplies none. |
|
dict |
No |
Optional explanatory notes rendered under group sections. |
Any additional keys are ignored and MUST NOT influence program flow.
2 columns Entries
Each element of columns is a mapping with the following fields:
Field |
Type |
Required |
Default |
Behaviour |
|---|---|---|---|---|
|
str |
Yes |
– |
Column key that must exist in every row. |
|
str |
No |
Same as |
Header text displayed in the table. |
|
bool |
No |
|
If |
2.1 Validation Rules
The list must not contain duplicate
keyvalues.Every
keymust match a property present in the overview data; unknown keys raise a TableConfigurationError before any rendering starts.visiblemissing → treated astrue(spec default).
3 default_sort
A list of sort-key strings complying with the grammar defined in Table Sorting.
They are evaluated left-to-right when no CLI/ENV override is supplied.
Validation occurs via the sort-utilities module:
Unknown columns or unsortable virtual columns raise SortConfigurationError.
If omitted, the application falls back to
repo:asc(repository name ascending).
4 group_notes
Optional mapping controlling the informational paragraph appended after each group table (see rendering spec §5):
# Example structure
group_notes:
default: "Note shown for groups without specific override."
groups:
alpha-group: "Alpha specific note."
beta-group: "Beta specific note."
Sub-Key |
Type |
Required |
Meaning |
|---|---|---|---|
|
str |
No |
Note used for groups not listed under |
|
mapping |
No |
Explicit overrides |
When absent entirely, no notes are rendered.
5 Error Handling Summary
Condition |
Raised Exception |
Origin |
|---|---|---|
|
|
|
Duplicate or unknown column |
|
idem |
Invalid |
|
|
File path set in |
Runtime warning (log) – not fatal |
|
The application MUST fail fast on configuration errors but remain robust against a missing config file by issuing a warning and operating with built-in defaults.
6 Testing Requirements
Positive Cases – snapshot tests must include at least one valid
table_config.yamlverifying:Column order & labels propagate to rendered Markdown.
Invisible columns are omitted.
default_sortinfluences sort order when no CLI override is present.
Negative Cases – unit tests must assert that misconfigurations raise the correct exceptions (see table above).
Integration – approval tests covering the full pipeline (
OverviewData → table → Markdown/Quarto) must pass with the gold-standardtable_config.yamllocated at project root.
7 Non-Goals
The spec does not mandate the location of the YAML file except that its path is provided via
Settings.table_config(defaulting totable_config.yamlin the working directory).Styling of the rendered table (HTML/CSS) is out of scope.
Runtime overrides (CLI
--columns, etc.) are beyond this document.