Skip to content

Client Payload

The client payload is what is sent along with the repository_dispatch event by the code repo for the deployment repo to make decisions on how to handle.

Example Payloads

Push

{
  "image_name": "ghcr.io/ioos/buoy_retriever_s3_timeseries",
  "digest": "sha256:2a4b6c8d0e1f3a5b7c9d0e2f4a6b8c0d2e4f6a8b0c2d4e6f8a0b2c4d6e8f0a2b",
  "tag": "7c8d9e0",
  "git_sha": "7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d",
  "image_ref": "ghcr.io/ioos/buoy_retriever_s3_timeseries@sha256:2a4b6c8d0e1f3a5b7c9d0e2f4a6b8c0d2e4f6a8b0c2d4e6f8a0b2c4d6e8f0a2b",
  "repo": "ioos/buoy_retriever",
  "source": {
    "event": "push",
    "ref": "main",
    "url": "https://github.com/ioos/buoy_retriever/pull/142",
    "run_url": "https://github.com/ioos/buoy_retriever/actions/runs/1200000002",
    "actor": "abkfenris",
    "release": null,
    "pr": {
      "number": 142,
      "title": "Add hourly S3 timeseries ingest",
      "url": "https://github.com/ioos/buoy_retriever/pull/142"
    }
  }
}

Release

{
  "image_name": "ghcr.io/ioos/buoy_retriever_backend",
  "digest": "sha256:1f3d0c9a2b7e4d6f8a0c1e2b3d4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f",
  "tag": "9e1a2b3",
  "git_sha": "9e1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f90",
  "image_ref": "ghcr.io/ioos/buoy_retriever_backend@sha256:1f3d0c9a2b7e4d6f8a0c1e2b3d4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f",
  "repo": "ioos/buoy_retriever",
  "source": {
    "event": "release",
    "ref": "v1.4.0",
    "url": "https://github.com/ioos/buoy_retriever/releases/tag/v1.4.0",
    "run_url": "https://github.com/ioos/buoy_retriever/actions/runs/1200000001",
    "actor": "abkfenris",
    "release": {
      "tag": "v1.4.0",
      "name": "v1.4.0 — backend hardening",
      "url": "https://github.com/ioos/buoy_retriever/releases/tag/v1.4.0"
    },
    "pr": null
  }
}

Workflow Dispatch

{
  "image_name": "ghcr.io/ioos/buoy_retriever_hohonu",
  "digest": "sha256:3b5c7d9e1f2a4b6c8d0e2f4a6b8c0d2e4f6a8b0c2d4e6f8a0b2c4d6e8f0a2b4c",
  "tag": "5b6c7d8",
  "git_sha": "5b6c7d8e9f0a1b2c3d4e5f6a7b8c9d0e1f2a3b4c",
  "image_ref": "ghcr.io/ioos/buoy_retriever_hohonu@sha256:3b5c7d9e1f2a4b6c8d0e2f4a6b8c0d2e4f6a8b0c2d4e6f8a0b2c4d6e8f0a2b4c",
  "repo": "ioos/buoy_retriever",
  "source": {
    "event": "workflow_dispatch",
    "ref": "main",
    "url": "https://github.com/ioos/buoy_retriever/commit/5b6c7d8e9f0a1b2c3d4e5f6a7b8c9d0e1f2a3b4c",
    "run_url": "https://github.com/ioos/buoy_retriever/actions/runs/1200000003",
    "actor": "abkfenris",
    "release": null,
    "pr": null
  }
}

Client Payload Model

ClientPayload pydantic-model

Bases: BaseModel

repository_dispatch payload for image updates.

Fields:

  • image_name (str)
  • digest (str)
  • tag (str)
  • git_sha (str)
  • image_ref (str)
  • source (ClientPayloadSource)
  • repo (str)

Validators:

  • _validate_image_nameimage_name
  • _validate_digestdigest

digest pydantic-field

digest: str

Bare digest of the image, e.g. 'sha256:' (no repository prefix)

git_sha pydantic-field

git_sha: str

Git SHA of the commit

image_name pydantic-field

image_name: str

Full image name exactly as deployment manifests reference it, with the registry host included when the registry is not Docker Hub (e.g. 'gmri/my-service' or 'ghcr.io/owner/my-service'). No tag or digest suffix.

image_ref pydantic-field

image_ref: str

Full reference of the image

source pydantic-field

source: ClientPayloadSource

Source information of the payload

tag pydantic-field

tag: str

Tag of the image

value_format_kwargs

value_format_kwargs() -> dict[str, str]

Keyword arguments for formatting strings with payload values.

Source code in src/odp_releaser/schemas/client_payload.py
108
109
110
111
112
113
114
115
def value_format_kwargs(self) -> dict[str, str]:
    """Keyword arguments for formatting strings with payload values."""
    return {
        "new_tag": self.new_tag(),
        "git_sha": self.git_sha,
        "digest": self.digest,
        "payload": self.model_dump_json(),
    }

ClientPayloadSource pydantic-model

Bases: BaseModel

Event source info

Fields:

  • event (str)
  • ref (str)
  • url (HttpUrl)
  • run_url (HttpUrl)
  • actor (str)
  • release (Release | None)
  • pr (PullRequest | None)

actor pydantic-field

actor: str

User who triggered the event

event pydantic-field

event: str

Event name

pr pydantic-field

pr: PullRequest | None

Pull request information associated with the source

ref pydantic-field

ref: str

Branch or tag name

release pydantic-field

release: Release | None

Release information associated with the source

run_url pydantic-field

run_url: HttpUrl

URL to the run associated with the source

url pydantic-field

url: HttpUrl

Best link back to the source

Release pydantic-model

Bases: BaseModel

Release information

Fields:

  • tag (str)
  • name (str)
  • url (HttpUrl)

name pydantic-field

name: str

Name of the release

tag pydantic-field

tag: str

Tag of the release

url pydantic-field

url: HttpUrl

URL of the release

PullRequest pydantic-model

Bases: BaseModel

Pull request information

Fields:

  • number (int)
  • title (str)
  • url (HttpUrl)

number pydantic-field

number: int

Number of the pull request

title pydantic-field

title: str

Title of the pull request

url pydantic-field

url: HttpUrl

URL of the pull request