Skip to content

fix(api): refuse shipkeep.yml fields that no deployment applies yet - #431

Merged
samuelmbabhazi merged 2 commits into
mainfrom
fix/refuse-unapplied-config
Nov 23, 2026
Merged

samuelmbabhazi merged 2 commits into
mainfrom
fix/refuse-unapplied-config

Conversation

@samuelmbabhazi

Copy link
Copy Markdown
Collaborator

Found while writing the documentation site (#246): shipkeep.yml accepted fields that no deployment applies, and ignored them without a word.

The problem

The JSON Schema describes features that are planned. The control plane accepted them, and the pipeline ignored them:

  • volumes: nothing was mounted (agent-steps.ts mounts only the /tmp tmpfs of run.read_only_root). An application that declared a volume wrote into its container's own layer instead, and lost that data at its next deployment, when the container was replaced. Nothing said so, and the application page's storage section even listed the volume.
  • databases and previews: no managed database and no preview environment ever appeared.
  • deploy.strategy: recreate: every deployment is rolling: the new replicas start before the previous ones stop.
  • deploy.keep_images: servers remove no image yet.

What changed

  • assertConfigApplied (apps/domain/application.ts) refuses each of these with unsupported_config_field, the field's JSON pointer, and the reason. For example: volumes is not supported yet: nothing would be mounted, and what the application writes there would be lost at its next deployment.
  • Saying what is already done, or nothing, stays accepted: an empty volumes or databases, previews.enabled: false, strategy: rolling, and drain_timeout, which the pipeline applies.
  • It runs on save, through applicationConfig (creation, configuration change and environment clone), and again on deploy. A configuration stored before this change cannot start a release that ignores what it says, which is the same pattern as assertDomainsAvailable.
  • SPEC 2.2 lists what is refused for now; each field is accepted again when the feature that applies it lands.
  • Web UI, the storage section of an application without a volume. The note invited the user to declare one:
    • before: "No volume. Declare one under volumes: in shipkeep.yml."
    • after: "Volumes are not supported yet: a container keeps what it writes only until it is replaced, at the next deployment."
    • The French translation changes with it. The layout does not change.

How it was tested

  • Unit, written first and failing before the change: each refused field, with its pointer and its message, and the accepted forms.
  • Integration, against PostgreSQL:
    • creating with volumes and changing to strategy: recreate are refused;
    • a configuration with volumes written straight into the database is refused when deployed, and no release is created;
    • removing the deploy-time check makes that test fail.
  • API and web lint and typecheck, the API unit suite (694 tests) and the web suite (317 tests).

Security considerations

  • More configurations are refused, none newly accepted.
  • The refusal names the field, never a value.
  • No contract changes: the JSON Schema still describes these fields, since they are planned; only what the control plane accepts narrows. The CLI's local validation still accepts them, and the API's refusal reaches it as an error.

volumes, databases, previews, deploy.strategy: recreate and deploy.keep_images were accepted and ignored: a volume was never mounted, so what an application wrote there was lost at its next deployment. They are now refused on save and on deploy, with the field's JSON pointer.

Signed-off-by: samuel mbabhazi <[email protected]>
…ting volumes in the UI

Signed-off-by: samuel mbabhazi <[email protected]>
@samuelmbabhazi samuelmbabhazi added bug Something isn't working v0.1-stable In the scope of the first stable version (docs/PLAN.md) labels Nov 23, 2026
@coderabbitai

coderabbitai Bot commented Nov 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 19 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 985e773 and 8c5772d.

Files selected for processing: 7

  • apps/api/src/modules/apps/domain/application.spec.ts
  • apps/api/src/modules/apps/domain/application.ts
  • apps/api/src/modules/deployments/application/deployment-commands.ts
  • apps/api/src/modules/deployments/deployments-http.integration.spec.ts
  • apps/web/src/app/delivery/config-sections.ts
  • apps/web/src/app/ui/fr.ts
  • docs/SPEC.md
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@samuelmbabhazi
samuelmbabhazi merged commit 2c4a326 into main Nov 23, 2026
25 checks passed
@samuelmbabhazi
samuelmbabhazi deleted the fix/refuse-unapplied-config branch November 23, 2026 13:22
samuelmbabhazi added a commit that referenced this pull request Nov 23, 2026
…rt of #246) (#432)

Part of #246: the `shipkeep.yml` reference of the documentation site,
generated from the JSON Schema. Stacked on #430. **Merge it after
#431**: the page says that some fields are refused, which is true only
once #431 is merged.

## What changed

- **`tools/gen/config-reference.mjs`** writes
`apps/docs/src/content/docs/reference/shipkeep-yml.md` from
`packages/config-schema/shipkeep.schema.json`.
- It runs with `pnpm gen:config`. The "Generated code is up to date" job
then fails when the page is stale, and the page is never edited by hand.
Prettier leaves it alone.
- Each field gets its type, bounds, pattern, whether it is required, and
the schema's description.
- **What the control plane does with a field** is not in the schema, so
the generator holds two short lists:
- `DEFAULTS`: the values the pipeline uses when a field is left out,
such as health check interval `5s`, one replica, spread `node`, release
timeout `10m`, drain `30s` (at most `5m`), and the default resources.
  - `NOTES`:
    - only `build.type: image` works;
    - the fields refused until applied (SPEC 2.2, #431);
- how the health check, the release command, domains and secrets behave;
- `run.healthcheck.unhealthy_threshold` is accepted but not applied yet.
- The generator's header says to keep both lists in step with
`UNAPPLIED` and the pipeline.
- **ADR 0027** says that this reference is generated, and that the CLI
reference will follow the same way.
- The **Reference** group in the sidebar.

## How it was tested

- `pnpm gen:config` runs clean, and the output is the same over two
runs.
- `nx run docs:build` builds 6 pages.
- `eslint` on the generator.
- Each default was read from the pipeline: `container-plan.ts`,
`pipeline.ts`, `placement.ts` and `DEFAULT_RESOURCES`.

## Security considerations

Documentation only. The generator reads the schema and writes one
Markdown file.

---------

Signed-off-by: samuel mbabhazi <[email protected]>
samuelmbabhazi added a commit that referenced this pull request Nov 23, 2026
…435)

Part of #246: the migration guide. Stacked on #434. With it, the site
covers every page the issue lists: install, concepts, the `shipkeep.yml`
reference, the CLI reference, and migration. Merge after #431, since the
guide says that volumes are refused.

## What changed

**Move an application to Shipkeep** (`guides/move-an-application.md`),
under a new **Guides** group:

- **What cannot move yet.** Data on a volume, builds and Compose files.
A stateful service stays where it runs and is reached through a secret.
The Coolify import of SPEC 13 is named as planned.
- **Getting an image.** An existing image, or one built in CI and pushed
to a registry, with registry credentials for a private one.
- **From Compose to `shipkeep.yml`.** A table maps each Compose setting:
image, ports, command, environment and secrets, health check, replicas,
limits, domains, volumes, `depends_on`. A complete example follows.
- **Deploying next to the old platform** on a second name, while both
share the database.
- **Switching the domain**: lower the TTL, add the domain, point the
record. It is undone by pointing the record back.

## How it was tested

- `nx run docs:build` builds 8 pages.
- Each mapping was checked against the schema and the pipeline:
  - `run.command` is an argv list;
  - nothing is published on the host (`placement.ts`);
  - the health check is probed over HTTP on `run.port`;
  - the release command runs before a new release takes the traffic.

## Security considerations

Documentation only. The guide keeps secrets in the environment and names
them in `shipkeep.yml`, never their values.

---------

Signed-off-by: samuel mbabhazi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working v0.1-stable In the scope of the first stable version (docs/PLAN.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant