---
myst:
  html_meta:
    "description": "Every key of repository.toml specification 2: the repository, its packages, its components, its news fragments, and its release pipeline."
    "property=og:description": "Every key of repository.toml specification 2: the repository, its packages, its components, its news fragments, and its release pipeline."
    "property=og:title": "repository.toml"
    "keywords": "Plone, repoplone, repository.toml, configuration, specification 2, package, component"
---

(reference-settings-file)=

# `repository.toml`

This page lists every key of a `repository.toml` file that follows specification 2.
For files without a `spec_version` key, see {doc}`repository-toml-spec-1`.

(reference-settings-file-lookup)=

## Location

<!-- source: src/repoplone/settings/parser.py, find_settings_file and parse_config -->

repoplone looks for `repository.toml` in the current folder, then in each parent folder up to the root of the file system.
The first file found wins.
Every relative path in the file is relative to the folder that holds it.

Without a file, every command prints `Did not find a repository.toml file.` and exits with code 0.

(reference-settings-file-example)=

## Example

```toml
spec_version = "2"

[repository]
name = "my-project"
changelog = "CHANGELOG.md"
version = "version.txt"
container_images_prefix = "ghcr.io/my-org/my-project"
compose = ["docker-compose.yml"]

[repository.towncrier]
settings = "towncrier.toml"
section = "Project"

[[package]]
type = "python-plone"
name = "my.project"
path = "backend"
changelog = "backend/CHANGELOG.md"
publish = false

[[package]]
type = "node-volto"
name = "volto-my-project"
path = "frontend/packages/volto-my-project"
changelog = "frontend/packages/volto-my-project/CHANGELOG.md"
publish = false
```

(reference-settings-file-top)=

## Top level

<!-- source: src/repoplone/settings/spec.py -->

| Key | Type | Required | Description |
|---|---|---|---|
| `spec_version` | string | yes | `"2"` or `"2.0"`. It must be a quoted string. Without it, the file follows specification 1. |
| `[repository]` | table | yes | The repository. See {ref}`reference-settings-file-repository`. |
| `[[package]]` | array of tables | no | One table per package. See {ref}`reference-settings-file-package`. |
| `[[component]]` | array of tables | no | One table per app. Without any, repoplone derives the components. See {ref}`reference-settings-file-component`. |

A specification 2 file must not contain `[backend]` or `[frontend]` tables.
repoplone refuses them and points to `repoplone settings migrate`.

(reference-settings-file-repository)=

## `[repository]`

<!-- source: src/repoplone/settings/__init__.py, src/repoplone/settings/spec.py -->

| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| `name` | string | yes | | The name of the repository. It names the release in changelogs and in the GitHub release. |
| `changelog` | path | yes | | The repository changelog, usually `CHANGELOG.md`. |
| `version` | path | yes | | The file that holds the repository version, usually `version.txt`. |
| `version_format` | string | no | `"semver"` | `"semver"` or `"calver"`. See {doc}`/explanation/versioning`. |
| `container_images_prefix` | string | no | `""` | The prefix of the container image names. A component's image is `<prefix>-<component name>`. |
| `compose` | list of paths | no | `[]` | Compose files. A release replaces the old version with the new one in the tags of the images that match `container_images_prefix`. |
| `issues_url` | string | no | derived | The issue tracker. Defaults to `https://github.com/<owner>/<repository>/issues` when the `origin` remote is on GitHub. |
| `[repository.towncrier]` | table | no | | News fragments for the repository as a whole. See {ref}`reference-settings-file-towncrier`. |
| `[repository.release]` | table | no | | The release pipeline. See {ref}`reference-settings-file-release`. |

Write `changelog` and `version` even when you use the usual file names.
A `[repository]` table replaces the built-in defaults as a whole.

`compose` must be a list.
`managed_by_uv` is not part of specification 2: repoplone reads it from the backend's `pyproject.toml`.

(reference-settings-file-towncrier)=

## `towncrier` tables

<!-- source: src/repoplone/utils/_towncrier.py -->

A `towncrier` table points to a towncrier configuration.
It appears once as `[repository.towncrier]` and once in each `[[package]]`, as `towncrier.settings` and `towncrier.section`.

| Key | Type | Default in `[repository.towncrier]` | Default in a `[[package]]` | Description |
|---|---|---|---|---|
| `settings` | path | `towncrier.toml` | the package's `towncrier.toml`, else its `pyproject.toml` | The towncrier configuration file. |
| `section` | string | `Project` | the package name | The heading of this part in the repository changelog. |

A `[repository.towncrier]` table turns on news fragments for the repository as a whole.
An empty table turns them on with both defaults.
Without the table, the repository has no news fragments of its own.

Each value must be a non-empty string.
An `enabled` key, or any other key, is an error.

(reference-settings-file-package)=

## `[[package]]`

<!-- source: src/repoplone/utils/__init__.py, src/repoplone/settings/spec.py, src/repoplone/_types/repository.py -->

| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| `type` | string | yes | | The package type. See {ref}`reference-settings-file-types`. |
| `name` | string | yes | | The distribution name on PyPI, or the package name on npm. An empty name disables the package. |
| `path` | path | yes | | The folder of the package. `"."` is the root of the repository. |
| `changelog` | path | yes | | The package changelog. |
| `code_path` | path | no | `"src"` | The source folder, relative to `path`. |
| `publish` | boolean | no | `true` | Whether a release uploads the package to PyPI or npm. |
| `primary` | boolean | no | `false` | Marks the primary package of its family. Without it, the first package of the family is primary. |
| `components` | list of strings | no | | The components that install this package. Only with `[[component]]` tables. |
| `base_package` | string | no | by type | The package this one builds on. Only on `python-plone`, `node-volto`, and `node-aurora`. |
| `python_version` | string | no | from `pyproject.toml`, else `"3.13"` | The Python version used to build the package. Python types only. |
| `python_versions` | list of strings | no | from `pyproject.toml` | The supported Python versions. Python types only. |
| `plone_versions` | list of strings | no | from `pyproject.toml` | The supported Plone versions. `python-plone` only. |
| `towncrier` | table | no | | See {ref}`reference-settings-file-towncrier`. |

Two packages must not share a name or a path.
A family has at most one package with `primary = true`.

`base_package` only has an effect on the primary package of a family.
Set on another package, it gives a warning.

In a file with `[[component]]` tables, the components own the base packages.
There, `primary` and `base_package` on a package give a warning and have no effect.

`towncrier_settings` and a flat `section` key belong to specification 1.
repoplone refuses them, and names the `towncrier.settings` or `towncrier.section` key to use instead.

(reference-settings-file-types)=

### Package types

<!-- source: src/repoplone/_types/repository.py, PACKAGE_FAMILIES, DEFAULT_BASE_PACKAGES, PACKAGE_TYPE_ALIASES -->

| Type | Family | Default `base_package` | Released with |
|---|---|---|---|
| `python-plone` | python | `Products.CMFPlone` | uv |
| `python` | python | | uv |
| `node-volto` | node | `@plone/volto` | release-it |
| `node-aurora` | node | `@plone/aurora` | release-it |
| `node` | node | | release-it |

repoplone also reads two older names.
`backend` stands for `python-plone`, and `frontend` stands for `node-volto`.
`repoplone settings migrate` writes the current names.

(reference-settings-file-component)=

## `[[component]]`

<!-- source: src/repoplone/settings/spec.py, COMPONENT_KEYS; src/repoplone/utils/_components.py -->

| Key | Type | Required | Default | Description |
|---|---|---|---|---|
| `name` | string | yes | | The name of the app. It names the `make <name>-install` target and the container image. |
| `type` | string | yes | | A package type. See {ref}`reference-settings-file-types`. |
| `path` | path | yes | | The folder of the app. |
| `base_package` | string | no | by type | The package the app builds on. Only on `python-plone`, `node-volto`, and `node-aurora`. |
| `base_package_version_file` | path | no | `"version.txt"` | A file with the base package version, relative to `path`. Read when `pyproject.toml` does not pin it. Python types only. |
| `changelog_package` | string | no | | A package whose changelog a release copies to `<path>/CHANGELOG.md`. It must list this component. |

A name uses lowercase letters, digits, `.`, `-`, and `_`, and starts with a letter or a digit.
Two components must not share a name or a path.

These rules link packages and components:

- A package may list components only when the file declares `[[component]]` tables.
- `components` is a non-empty list of declared component names.
- A Python package cannot be part of a Node component.

A component's watch paths are its own folder plus the folder of each package that lists it.

(reference-settings-file-implicit)=

### Implicit components

<!-- source: src/repoplone/utils/_components.py, implicit components -->

Without `[[component]]` tables, repoplone derives up to two components.

| Name | From | Path |
|---|---|---|
| `backend` | the primary Python package | the folder of the package |
| `frontend` | the primary Node package | the root of the workspace that holds the package |

Each takes the `base_package` of its package.

(reference-settings-file-release)=

## `[repository.release]`

<!-- source: src/repoplone/release/config.py, src/repoplone/release/steps/__init__.py -->

```toml
[repository.release]
steps = ["changelog", "version", "repository", "release_python", "git", "notify", "gh_release", "bye"]

[repository.release.registry.notify]
function = "local_step"
title = "Notify the team"
args = { entrypoint = "scripts.release:notify", channel = "releases" }
```

| Key | Type | Default | Description |
|---|---|---|---|
| `steps` | list of strings | the built-in order | The step ids, in the order they run. Each is a built-in id or a key of `registry`. |
| `registry.<id>` | table | | A step of your own. |
| `registry.<id>.function` | string | | A built-in step id. Use `local_step` to call your own code. |
| `registry.<id>.title` | string | the title of `function` | The title the release prints. |
| `registry.<id>.args` | table | `{}` | Arguments for the step. `local_step` requires `entrypoint`. |

An empty or missing `steps` list runs the built-in order.
`steps` must not repeat an id, nor name `local_step` directly.
A registry key equal to a built-in id replaces that built-in.

Specification 2 accepts only `release_python` and `release_node`.
`release_backend` and `release_frontend` are specification 1 ids.

The built-in ids and the `local_step` contract are in {doc}`release-steps`.

```{seealso}
- {doc}`/explanation/repository-model`, for what each table stands for.
- {doc}`/explanation/components`, for when to declare components.
- {ref}`cli-settings-sanity-check`, to validate a file.
```
