Skip to content

Immutability

A released version is a promise: the bytes that a build resolved yesterday are the bytes it resolves today. Artifex keeps that promise by refusing to overwrite a file that exists.

Releases can't be replaced

By default, deploying a file that already exists fails, and the build reports that the release file already exists and can't be replaced. Nothing is changed. Deleting is also refused by default.

A build that wants to publish again has to publish a new version. That's the behavior you want for anything that other people resolve.

Allow replacing files

Some repositories aren't published to other people, such as a scratch repository or one that a pipeline rebuilds. For those, an administrator can turn replacement on.

To allow replacing files, follow these steps:

  1. Open the repository and go to Settings.
  2. Turn on Allow replacing files.
  3. Click Save changes.

Deploying an existing file then replaces it, and builds get the new bytes from that point on. The activity records the event as a replacement and shows what the file was before.

Allow deleting files

To allow deleting, follow these steps:

  1. Open the repository and go to Settings.
  2. Turn on Allow deleting files.
  3. Click Save changes.

People with write access can then delete files and versions from the file and version pages, and build tools can delete files too.

Snapshots are different

A snapshot version holds many builds, and each deploy adds one. Deploying the same build twice is still a conflict, because that build already exists. For more information, see Snapshots.

Advanced

A deploy over an existing release file answers 409 Conflict with the message This release file already exists. Releases can't be replaced. With Allow replacing files on, it answers 200 OK instead of 201 Created.

A DELETE request answers 403 Forbidden unless Allow deleting files is on, in which case it answers 204 No Content.