Documentation

GitOps

Repository layout

A GitOps repository holds the organization's config as files.

PathContents
config/**/*.yaml, config/**/*.ymlHydra 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.

KeyTypeDefaultDescription
agentsmap of string to agentnoneMaps each agent's name to its definition. See Agent definition.
boardsmap of string to boardnoneMaps each board key to a board. See Boards and statuses.
environmentsmap of string to environmentnoneMaps each environment key to an environment. See Environments.
repositoriesmap of string to settingsnoneMaps each connected repository's name to its settings. See Repositories.
x-*anynoneHydra 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 repositories keeps 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.