How digital-land/config works
1. This repository is a configuration source of truth, not an application runtime. It stores CSV-based definitions for datasets and their processing pipelines, copied from original collection repositories and normalized to match the current specification.
2. The two core configuration surfaces are collection/ and pipeline/. Each subdirectory represents one dataset/domain such as historic-england, brownfield-land, or planning-application, and contains the files that define how that dataset is described and processed.
3. collection/<name>/ holds the dataset-level configuration for the published collection: source.csv, endpoint.csv, and old-resource.csv. These appear to describe where data comes from, what endpoint it is exposed through, and any legacy resource mapping retained for compatibility.
4. pipeline/<name>/ holds the transformation pipeline for each dataset. The repeated CSV files such as column.csv, combine.csv, concat.csv, convert.csv, default.csv, default-value.csv, expect.csv, filter.csv, lookup.csv, patch.csv, skip.csv, and transform.csv represent rule sets for shaping incoming data into the expected schema.
5. The pipeline structure suggests a staged data-normalization flow: source data is filtered, transformed, combined, defaulted, and validated against expectations before being used by downstream systems. The entity-organisation.csv and old-entity.csv files indicate entity resolution and legacy mapping are part of the standard processing model.
6. The repository’s main boundary is between version-controlled config and externally managed exceptions. Most configs live in git, but some large or awkward files are intentionally excluded; the README calls out pipeline/title-boundary/lookup.csv as stored in S3 and manually maintained.
7. GitHub Actions in .github/workflows/ implement the repository’s operational controls. There are workflows for validating endpoints, standardizing CSVs, adding data asynchronously, managing CA geographies, testing, and uploading to S3. This means CI/CD here is about config hygiene and publication, not app deployment.
8. The .github/scripts/ directory contains repository-maintenance automation for things like endpoint checks, deduplication of CA geographies, retiring old CA data, and standardizing CSV files. These are supporting tools for keeping the config corpus consistent across many dataset folders.
9. bin/ contains operational helper scripts such as batch_assign_entities.py and fix_dates.py, which likely apply bulk corrections to the configuration or generated data. They sit outside the main config model but support data cleanup and migration tasks.
10. create_collection.py and the makerules/ plus Makefile layer suggest a templated/scaffolded workflow for creating or updating dataset collections and pipeline assets. The repo is designed to be regenerated or synchronized from conventions rather than hand-edited ad hoc.
11. The tests/ tree provides three levels of assurance: acceptance tests around dataset config, integration tests for CSV processing, and unit tests for helper functions. That reflects a repo whose correctness depends on structure and conventions of many small files rather than on one large codebase.
12. metadata.json and requirements.txt indicate a Python-based toolchain for validation and transformation of these CSV configuration assets. The Python scripts and tests are the only executable logic; the primary artifact remains the configuration data itself.
13. For an architecture diagram, the central node is the config repository, with two major data stores (collection/ and pipeline/), surrounded by maintenance automation (scripts/, bin/, GitHub Actions), and an external publication sink in S3 for excluded or uploaded artifacts. The intended flow is: source collection config → normalized pipeline/collection CSVs → validation/standardization in CI → publication/use by downstream digital land services.
Main entry points: pipeline Pipelines · collection Collections · workflows Workflows · scripts GitHub scripts
Components 18
Core config
Version-controlled CSV definitions for collections and pipelines.
- Config repo · Central repository for normalized dataset and pipeline configuration.
- Collections · Dataset-level published collection definitions, one folder per domain.
collection - Pipelines · Per-dataset transformation and validation rules expressed as CSV files.
pipeline - Source CSV · Defines where each collection pulls data from.
- Endpoint CSV · Defines the published endpoint for a collection.
- Legacy map · Retains old resource mappings for compatibility.
- Rule files · Representative CSV rule sets for filtering, combining, converting, defaulting, looking up, patching, skipping, and transforming.
- Entity mapping · Entity organisation and legacy entity mapping used during normalization.
- Expectations · Schema and content checks applied to pipeline output.
Ops and automation
Repository-maintenance scripts and CI workflows.
- Workflows · GitHub Actions for validation, standardization, async add-data, CA geography management, testing, and S3 upload.
.github/workflows - GitHub scripts · Repository maintenance scripts for endpoint checks, deduplication, retirement, and CSV standardization.
.github/scripts - Bin scripts · Operational helper scripts for bulk fixes and migrations.
bin - S3 storage · External storage for excluded or uploaded artifacts such as manually maintained lookup files.
- Downstream services · Services that consume the published normalized configurations.
Quality and tooling
Scaffolding, tests, and Python support code.
- Make layer · Makefile and makerules used to create and maintain standardized assets.
Makefile - Scaffold tool · Script for creating or updating collection structures.
create_collection.py - Tests · Acceptance, integration, and unit tests for repository conventions and CSV processing.
tests - Python tools · Python packaging and metadata supporting validation and transformation scripts.
requirements.txt
Connections 23
- Config repo → Collections: contains · The repository stores collection configs as a top-level subsystem.
- Config repo → Pipelines: contains · The repository stores pipeline configs as a top-level subsystem.
- Collections → Source CSV: defines · Each collection folder includes source definitions.
- Collections → Endpoint CSV: defines · Each collection folder includes endpoint definitions.
- Collections → Legacy map: defines · Each collection folder preserves legacy resource mappings.
- Pipelines → Rule files: uses · Pipeline folders are composed of repeated CSV rule files.
- Pipelines → Entity mapping: uses · Pipelines include entity resolution and legacy entity mapping.
- Pipelines → Expectations: uses · Pipelines include expectation checks for normalized outputs.
- Pipelines → S3 storage: exception · One pipeline lookup file is intentionally kept outside git in S3.
- Make layer → Collections: generates · Make rules help create and maintain collection structures.
- Make layer → Pipelines: generates · Make rules help create and maintain pipeline structures.
- Scaffold tool → Make layer: supports · The scaffold script complements the Make-driven workflow.
- Workflows → GitHub scripts: runs · CI workflows call repository-maintenance scripts.
- Workflows → Tests: executes · The test workflow validates repository behavior and conventions.
- Workflows → S3 storage: publishes · Upload workflow sends selected artifacts to S3.
- GitHub scripts → Collections: checks · Maintenance scripts validate and standardize collection config files.
- GitHub scripts → Pipelines: checks · Maintenance scripts validate and standardize pipeline config files.
- Bin scripts → Collections: fixes · Operational helpers apply bulk corrections to config data.
- Bin scripts → Pipelines: fixes · Operational helpers apply bulk corrections to pipeline data.
- Tests → Python tools: depends on · Tests exercise the Python-based validation and processing toolchain.
- Python tools → Workflows: enables · Python tooling underpins workflow validation and standardization jobs.
- Collections → Downstream services: feeds · Published collection config is consumed by downstream digital land services.
- Pipelines → Downstream services: feeds · Normalized pipeline outputs are consumed by downstream digital land services.