GitOps
Repository layout
A GitOps repository holds the organization's config as files.
| Path | Contents |
|---|---|
config/**/*.yaml, config/**/*.yml | Hydra loads each .yaml and .yml file under config/. |
documents/** | The file documents/X holds the body of the document /X. |
Hydra skips any other file with a warning.
Config files
A config file is a mapping with any of these top-level keys.
| Key | Type | Default | Description |
|---|---|---|---|
agents | map of string to agent | none | Maps each agent's name to its definition. See Agent definition. |
boards | map of string to board | none | Maps each board key to a board. See Boards and statuses. |
environments | map of string to environment | none | Maps each environment key to an environment. See Environments. |
repositories | map of string to settings | none | Maps each connected repository's name to its settings. See Repositories. |
x-* | any | none | Hydra ignores keys that start with x-. Use them for YAML anchors that definitions pull in with <<: *anchor. |
Hydra rejects any other top-level key. Define each object in one file only.
x-on-issue: &on-issue
lives_on: issue
mode: headless
agents:
swe:
prompts: [/agents/swe/prompt.md]
runs_when:
implement:
<<: *on-issue
where: self.status == "in-progress"
Applying a commit
Hydra applies each new commit on the repository as a full apply.
- The server checks the whole commit before it writes anything. When the commit has an error, the server writes nothing.
- The server resets an omitted field to its default.
- The server archives an agent, environment or document that an earlier full apply wrote and the commit no longer lists.
- The server keeps a board or status that the commit no longer lists, and warns.
- A repository that leaves
repositorieskeeps its settings. - A full apply rejects
runs_when.<name>: null. - Once a commit applies, the GitOps repository owns the organization's agents, environments, boards, statuses, and the documents and repository settings the commit holds. Other writes to them fail with
gitops_managed.