{"owner":"prometheus","repo":"alertmanager","hasSkills":true,"hasMcp":false,"mcpConfig":null,"found":["AGENTS.md"],"skills":{"AGENTS.md":"# AGENTS.md\n\nGuidance for AI coding agents working in this repository. Keep this file concise and current. For end‑user docs, see `README.md` and https://prometheus.io/docs/alerting/alertmanager/.\n\n## Project overview\n\nAlertmanager handles alerts sent by clients such as Prometheus. It deduplicates, groups, routes, silences, and inhibits alerts, and dispatches them to receiver integrations (email, PagerDuty, Slack, webhook, etc.).\n\n- Language: Go (see `go.mod` for the required version, currently `go 1.25`).\n- Frontend (legacy): Elm app under `ui/app/` (Node version pinned in `.nvmrc`).\n- Frontend (new): React + TypeScript + Mantine under `ui/mantine-ui/`.\n- API: OpenAPI v2 spec in `api/v2/openapi.yaml`; Go server/client/models are generated via `scripts/swagger.sh`.\n- Module path: `github.com/prometheus/alertmanager`.\n\n## Repository layout\n\nTop‑level packages worth knowing:\n\n- `cmd/alertmanager/` — main binary entry point (`main.go`); thin wrapper that parses flags and calls `app`.\n- `app/` — embeddable Alertmanager runtime extracted from `cmd/alertmanager`. Owns the process lifecycle (`New`/`Start`/`Stop`/`Reload`/`Run`), subsystem wiring (`setup`), config-reload subgraph (`reloader`), listeners and `Options`. Lets tests and other binaries run Alertmanager in‑process. See https://github.com/prometheus/alertmanager/issues/406.\n- `cmd/amtool/` — CLI for interacting with the Alertmanager API.\n- `api/` — HTTP API. `api/v2/` is the active API; `api/v1_deprecation_router.go` only returns deprecation responses.\n- `cli/` — `amtool` command implementations.\n- `cluster/` — HA gossip clustering (memberlist-based).\n- `config/` — YAML config parsing, validation, secrets, coordinator.\n- `dispatch/` — routing tree, alert grouping, dispatcher loop.\n- `inhibit/` — inhibition rule engine.\n- `mute/`, `silence/`, `timeinterval/` — muting, silences (with nflog), time‑based mutes.\n- `nflog/` — notification log (persisted dedup state).\n- `notify/` — notification pipeline plus one subpackage per integration (`slack`, `pagerduty`, `email`, `webhook`, `discord`, `jira`, `msteams`, `msteamsv2`, `opsgenie`, `pushover`, `rocketchat`, `sns`, `telegram`, `victorops`, `webex`, `wechat`, `mattermost`, `incidentio`).\n- `template/` — notification templating (Go templates + default email template). `template/email.tmpl` is generated from `template/email.html`.\n- `provider/mem/` — in‑memory alert provider (the only provider).\n- `store/` — alert/silence store helpers.\n- `types/` — core domain types (`Alert`, `Silence`, `Matcher`, ...).\n- `matcher/` — label matcher parsing (used by routes, silences, inhibitions).\n- `featurecontrol/` — feature flags wired through `--enable-feature`.\n- `limit/`, `httpserver/`, `tracing/` — server plumbing.\n- `ui/web.go` — embeds the built UI assets and serves them.\n- `examples/`, `doc/examples/` — example configs and HA setups.\n- `test/with_api_v2/` and `test/cli/` — integration/e2e tests.\n\nGenerated code (do not hand‑edit):\n\n- `api/v2/{models,restapi,client}/` — regenerated by `scripts/swagger.sh` from `api/v2/openapi.yaml`.\n- `ui/app/src/Data/` — Elm types generated from the OpenAPI spec.\n- `template/email.tmpl` — generated from `template/email.html` via `template/Makefile`.\n- `cluster/clusterpb/cluster.pb.go`, `nflog/nflogpb/nflog.pb.go`, `silence/silencepb/silence.pb.go` — regenerate via `scripts/genproto.sh` if the `.proto` schema must change.\n\n## Common commands\n\nBuilds and tests are driven by the shared `Makefile.common` plus the repo‑specific `Makefile`.\n\n- `make build` — build `alertmanager` and `amtool` (also builds Elm UI assets).\n- `make build-all` — UI assets + regenerated API + binaries.\n- `make build BINARIES=amtool` — build a single binary.\n- `make assets` — regenerate Elm `Data` types and `template/email.tmpl`.\n- `make apiv2` — regenerate `api/v2/{models,restapi,client}` from `api/v2/openapi.yaml` (runs `scripts/swagger.sh`; needs Docker).\n- `make test` — full Go test suite (`go test ./...`) plus UI tests.\n- `make test-short` (via `Makefile.common`) — `go test -short ./...`.\n- `make lint` — `golangci-lint run` (version pinned in `Makefile.common`) plus UI lint.\n- `make common-format` — `go fmt` + `golangci-lint fmt` (gofumpt + goimports with local prefix `github.com/prometheus/alertmanager`).\n- `make fuzz-config` — short fuzz run over `./config`.\n- `make clean` — remove generated API code, generated email template, and UI build output.\n\nRun a single Go test package or test:\n\n```\ngo test ./notify/slack/...\ngo test ./dispatch -run TestDispatcherRace -v\n```\n\nRun the UI dev servers directly when iterating on the frontend:\n\n```\n# Legacy Elm UI\ncd ui/app && make build         # see ui/app/CONTRIBUTING.md\n# New Mantine UI\ncd ui/mantine-ui && npm install && npm run dev\n```\n\nRun Alertmanager locally:\n\n```\n./alertmanager --config.file=doc/examples/simple.yml\n# multi-node HA via Procfile (requires goreman):\ngoreman start\n```\n\n## Conventions\n\n- Follow the lint rules in `.golangci.yml`. Notable forbidden imports (enforced by `depguard`):\n  - Use `github.com/stretchr/testify/require`, not `.../testify/assert`.\n  - Use `github.com/go-kit/log`, not `github.com/go-kit/kit/log`.\n  - Use the standard `errors`/`fmt`, not `github.com/pkg/errors`.\n- Formatting: `gofumpt` + `goimports` with local prefix `github.com/prometheus/alertmanager`. Run `make common-format` before committing.\n- Comments on exported identifiers must be full sentences ending in a period (`godot` lint).\n- Logging uses `log/slog` (`sloglint`). Prefer structured key/value logging.\n- Errors: wrap with `fmt.Errorf(\"...: %w\", err)` and check with `errors.Is`/`errors.As` (`errorlint`).\n- Keep package‑level documentation up to date (`revive: package-comments`).\n- Tests live next to the code as `*_test.go`. Larger integration tests live under `test/`. The `notify/test` package provides shared testing helpers for notifier integrations.\n\n## When changing the API\n\n1. Edit `api/v2/openapi.yaml`.\n2. Run `make apiv2` to regenerate `api/v2/{models,restapi,client}` (requires Docker; see `scripts/swagger.sh`).\n3. Run `make assets` so the Elm UI's `Data` types stay in sync.\n4. Update `api/v2/api.go` handlers for any new operations.\n5. Run `make test lint`.\n\nDo not hand‑edit generated files under `api/v2/models`, `api/v2/restapi`, `api/v2/client`, or `ui/app/src/Data`.\n\n## When adding or modifying a notifier\n\n- Each integration lives in its own package under `notify/<name>/`.\n- Add config in `config/notifiers.go` (struct, validation, defaults) and wire it into `config/config.go` receivers.\n- Register the notifier in `cmd/alertmanager/main.go` where receivers are built.\n- Add unit tests in the notifier package; reuse helpers from `notify/test/`.\n- Update `template/default.tmpl` only if you are introducing new default templates.\n- Note the change in `CHANGELOG.md` under the unreleased section.\n\n## When touching configuration\n\n- `config/config.go` owns top‑level YAML parsing; field changes typically need:\n  - Struct + `yaml` tags.\n  - `UnmarshalYAML` validation.\n  - Defaults in `DefaultGlobalConfig` / receiver defaults.\n  - Tests in `config/config_test.go`, possibly `testdata/` fixtures.\n- Validate behaviour with `make fuzz-config` for parser changes.\n\n## CI expectations\n\nGitHub Actions and CircleCI run build, tests, and `golangci-lint`. Before pushing:\n\n```\nmake common-format\nmake lint\nmake test\n```\n\nIf you regenerate API code or UI data, commit the regenerated files alongside the source changes.\n\n## Things to avoid\n\n- Don't reintroduce APIv1; it was removed in 0.27.0. The only thing left under `api/v1_deprecation_router.go` is a deprecation responder.\n- Don't bypass the notification pipeline (`notify/notify.go`) — new stages should be added as `notify.Stage` implementations.\n- Don't add new top‑level dependencies without checking `.golangci.yml` `depguard` rules and `go.mod` minimums.\n- Don't commit generated artifacts unless the corresponding source (`openapi.yaml`, `email.html`, etc.) changed in the same commit.\n\n## Useful references\n\n- Architecture diagram: `doc/arch.svg` (source `doc/arch.xml`).\n- Example configs: `doc/examples/simple.yml`, `examples/ha/`, `examples/webhook/`.\n- Maintainers and ownership: `MAINTAINERS.md`, `CODEOWNERS`.\n- Release process: `RELEASE.md`.\n- UI contributing guide: `ui/app/CONTRIBUTING.md`.\n"},"files":{"AGENTS.md":"# AGENTS.md\n\nGuidance for AI coding agents working in this repository. Keep this file concise and current. For end‑user docs, see `README.md` and https://prometheus.io/docs/alerting/alertmanager/.\n\n## Project overview\n\nAlertmanager handles alerts sent by clients such as Prometheus. It deduplicates, groups, routes, silences, and inhibits alerts, and dispatches them to receiver integrations (email, PagerDuty, Slack, webhook, etc.).\n\n- Language: Go (see `go.mod` for the required version, currently `go 1.25`).\n- Frontend (legacy): Elm app under `ui/app/` (Node version pinned in `.nvmrc`).\n- Frontend (new): React + TypeScript + Mantine under `ui/mantine-ui/`.\n- API: OpenAPI v2 spec in `api/v2/openapi.yaml`; Go server/client/models are generated via `scripts/swagger.sh`.\n- Module path: `github.com/prometheus/alertmanager`.\n\n## Repository layout\n\nTop‑level packages worth knowing:\n\n- `cmd/alertmanager/` — main binary entry point (`main.go`); thin wrapper that parses flags and calls `app`.\n- `app/` — embeddable Alertmanager runtime extracted from `cmd/alertmanager`. Owns the process lifecycle (`New`/`Start`/`Stop`/`Reload`/`Run`), subsystem wiring (`setup`), config-reload subgraph (`reloader`), listeners and `Options`. Lets tests and other binaries run Alertmanager in‑process. See https://github.com/prometheus/alertmanager/issues/406.\n- `cmd/amtool/` — CLI for interacting with the Alertmanager API.\n- `api/` — HTTP API. `api/v2/` is the active API; `api/v1_deprecation_router.go` only returns deprecation responses.\n- `cli/` — `amtool` command implementations.\n- `cluster/` — HA gossip clustering (memberlist-based).\n- `config/` — YAML config parsing, validation, secrets, coordinator.\n- `dispatch/` — routing tree, alert grouping, dispatcher loop.\n- `inhibit/` — inhibition rule engine.\n- `mute/`, `silence/`, `timeinterval/` — muting, silences (with nflog), time‑based mutes.\n- `nflog/` — notification log (persisted dedup state).\n- `notify/` — notification pipeline plus one subpackage per integration (`slack`, `pagerduty`, `email`, `webhook`, `discord`, `jira`, `msteams`, `msteamsv2`, `opsgenie`, `pushover`, `rocketchat`, `sns`, `telegram`, `victorops`, `webex`, `wechat`, `mattermost`, `incidentio`).\n- `template/` — notification templating (Go templates + default email template). `template/email.tmpl` is generated from `template/email.html`.\n- `provider/mem/` — in‑memory alert provider (the only provider).\n- `store/` — alert/silence store helpers.\n- `types/` — core domain types (`Alert`, `Silence`, `Matcher`, ...).\n- `matcher/` — label matcher parsing (used by routes, silences, inhibitions).\n- `featurecontrol/` — feature flags wired through `--enable-feature`.\n- `limit/`, `httpserver/`, `tracing/` — server plumbing.\n- `ui/web.go` — embeds the built UI assets and serves them.\n- `examples/`, `doc/examples/` — example configs and HA setups.\n- `test/with_api_v2/` and `test/cli/` — integration/e2e tests.\n\nGenerated code (do not hand‑edit):\n\n- `api/v2/{models,restapi,client}/` — regenerated by `scripts/swagger.sh` from `api/v2/openapi.yaml`.\n- `ui/app/src/Data/` — Elm types generated from the OpenAPI spec.\n- `template/email.tmpl` — generated from `template/email.html` via `template/Makefile`.\n- `cluster/clusterpb/cluster.pb.go`, `nflog/nflogpb/nflog.pb.go`, `silence/silencepb/silence.pb.go` — regenerate via `scripts/genproto.sh` if the `.proto` schema must change.\n\n## Common commands\n\nBuilds and tests are driven by the shared `Makefile.common` plus the repo‑specific `Makefile`.\n\n- `make build` — build `alertmanager` and `amtool` (also builds Elm UI assets).\n- `make build-all` — UI assets + regenerated API + binaries.\n- `make build BINARIES=amtool` — build a single binary.\n- `make assets` — regenerate Elm `Data` types and `template/email.tmpl`.\n- `make apiv2` — regenerate `api/v2/{models,restapi,client}` from `api/v2/openapi.yaml` (runs `scripts/swagger.sh`; needs Docker).\n- `make test` — full Go test suite (`go test ./...`) plus UI tests.\n- `make test-short` (via `Makefile.common`) — `go test -short ./...`.\n- `make lint` — `golangci-lint run` (version pinned in `Makefile.common`) plus UI lint.\n- `make common-format` — `go fmt` + `golangci-lint fmt` (gofumpt + goimports with local prefix `github.com/prometheus/alertmanager`).\n- `make fuzz-config` — short fuzz run over `./config`.\n- `make clean` — remove generated API code, generated email template, and UI build output.\n\nRun a single Go test package or test:\n\n```\ngo test ./notify/slack/...\ngo test ./dispatch -run TestDispatcherRace -v\n```\n\nRun the UI dev servers directly when iterating on the frontend:\n\n```\n# Legacy Elm UI\ncd ui/app && make build         # see ui/app/CONTRIBUTING.md\n# New Mantine UI\ncd ui/mantine-ui && npm install && npm run dev\n```\n\nRun Alertmanager locally:\n\n```\n./alertmanager --config.file=doc/examples/simple.yml\n# multi-node HA via Procfile (requires goreman):\ngoreman start\n```\n\n## Conventions\n\n- Follow the lint rules in `.golangci.yml`. Notable forbidden imports (enforced by `depguard`):\n  - Use `github.com/stretchr/testify/require`, not `.../testify/assert`.\n  - Use `github.com/go-kit/log`, not `github.com/go-kit/kit/log`.\n  - Use the standard `errors`/`fmt`, not `github.com/pkg/errors`.\n- Formatting: `gofumpt` + `goimports` with local prefix `github.com/prometheus/alertmanager`. Run `make common-format` before committing.\n- Comments on exported identifiers must be full sentences ending in a period (`godot` lint).\n- Logging uses `log/slog` (`sloglint`). Prefer structured key/value logging.\n- Errors: wrap with `fmt.Errorf(\"...: %w\", err)` and check with `errors.Is`/`errors.As` (`errorlint`).\n- Keep package‑level documentation up to date (`revive: package-comments`).\n- Tests live next to the code as `*_test.go`. Larger integration tests live under `test/`. The `notify/test` package provides shared testing helpers for notifier integrations.\n\n## When changing the API\n\n1. Edit `api/v2/openapi.yaml`.\n2. Run `make apiv2` to regenerate `api/v2/{models,restapi,client}` (requires Docker; see `scripts/swagger.sh`).\n3. Run `make assets` so the Elm UI's `Data` types stay in sync.\n4. Update `api/v2/api.go` handlers for any new operations.\n5. Run `make test lint`.\n\nDo not hand‑edit generated files under `api/v2/models`, `api/v2/restapi`, `api/v2/client`, or `ui/app/src/Data`.\n\n## When adding or modifying a notifier\n\n- Each integration lives in its own package under `notify/<name>/`.\n- Add config in `config/notifiers.go` (struct, validation, defaults) and wire it into `config/config.go` receivers.\n- Register the notifier in `cmd/alertmanager/main.go` where receivers are built.\n- Add unit tests in the notifier package; reuse helpers from `notify/test/`.\n- Update `template/default.tmpl` only if you are introducing new default templates.\n- Note the change in `CHANGELOG.md` under the unreleased section.\n\n## When touching configuration\n\n- `config/config.go` owns top‑level YAML parsing; field changes typically need:\n  - Struct + `yaml` tags.\n  - `UnmarshalYAML` validation.\n  - Defaults in `DefaultGlobalConfig` / receiver defaults.\n  - Tests in `config/config_test.go`, possibly `testdata/` fixtures.\n- Validate behaviour with `make fuzz-config` for parser changes.\n\n## CI expectations\n\nGitHub Actions and CircleCI run build, tests, and `golangci-lint`. Before pushing:\n\n```\nmake common-format\nmake lint\nmake test\n```\n\nIf you regenerate API code or UI data, commit the regenerated files alongside the source changes.\n\n## Things to avoid\n\n- Don't reintroduce APIv1; it was removed in 0.27.0. The only thing left under `api/v1_deprecation_router.go` is a deprecation responder.\n- Don't bypass the notification pipeline (`notify/notify.go`) — new stages should be added as `notify.Stage` implementations.\n- Don't add new top‑level dependencies without checking `.golangci.yml` `depguard` rules and `go.mod` minimums.\n- Don't commit generated artifacts unless the corresponding source (`openapi.yaml`, `email.html`, etc.) changed in the same commit.\n\n## Useful references\n\n- Architecture diagram: `doc/arch.svg` (source `doc/arch.xml`).\n- Example configs: `doc/examples/simple.yml`, `examples/ha/`, `examples/webhook/`.\n- Maintainers and ownership: `MAINTAINERS.md`, `CODEOWNERS`.\n- Release process: `RELEASE.md`.\n- UI contributing guide: `ui/app/CONTRIBUTING.md`.\n"},"items":[{"name":"AGENTS.md","path":"AGENTS.md","title":"AGENTS.md","content":"# AGENTS.md\n\nGuidance for AI coding agents working in this repository. Keep this file concise and current. For end‑user docs, see `README.md` and https://prometheus.io/docs/alerting/alertmanager/.\n\n## Project overview\n\nAlertmanager handles alerts sent by clients such as Prometheus. It deduplicates, groups, routes, silences, and inhibits alerts, and dispatches them to receiver integrations (email, PagerDuty, Slack, webhook, etc.).\n\n- Language: Go (see `go.mod` for the required version, currently `go 1.25`).\n- Frontend (legacy): Elm app under `ui/app/` (Node version pinned in `.nvmrc`).\n- Frontend (new): React + TypeScript + Mantine under `ui/mantine-ui/`.\n- API: OpenAPI v2 spec in `api/v2/openapi.yaml`; Go server/client/models are generated via `scripts/swagger.sh`.\n- Module path: `github.com/prometheus/alertmanager`.\n\n## Repository layout\n\nTop‑level packages worth knowing:\n\n- `cmd/alertmanager/` — main binary entry point (`main.go`); thin wrapper that parses flags and calls `app`.\n- `app/` — embeddable Alertmanager runtime extracted from `cmd/alertmanager`. Owns the process lifecycle (`New`/`Start`/`Stop`/`Reload`/`Run`), subsystem wiring (`setup`), config-reload subgraph (`reloader`), listeners and `Options`. Lets tests and other binaries run Alertmanager in‑process. See https://github.com/prometheus/alertmanager/issues/406.\n- `cmd/amtool/` — CLI for interacting with the Alertmanager API.\n- `api/` — HTTP API. `api/v2/` is the active API; `api/v1_deprecation_router.go` only returns deprecation responses.\n- `cli/` — `amtool` command implementations.\n- `cluster/` — HA gossip clustering (memberlist-based).\n- `config/` — YAML config parsing, validation, secrets, coordinator.\n- `dispatch/` — routing tree, alert grouping, dispatcher loop.\n- `inhibit/` — inhibition rule engine.\n- `mute/`, `silence/`, `timeinterval/` — muting, silences (with nflog), time‑based mutes.\n- `nflog/` — notification log (persisted dedup state).\n- `notify/` — notification pipeline plus one subpackage per integration (`slack`, `pagerduty`, `email`, `webhook`, `discord`, `jira`, `msteams`, `msteamsv2`, `opsgenie`, `pushover`, `rocketchat`, `sns`, `telegram`, `victorops`, `webex`, `wechat`, `mattermost`, `incidentio`).\n- `template/` — notification templating (Go templates + default email template). `template/email.tmpl` is generated from `template/email.html`.\n- `provider/mem/` — in‑memory alert provider (the only provider).\n- `store/` — alert/silence store helpers.\n- `types/` — core domain types (`Alert`, `Silence`, `Matcher`, ...).\n- `matcher/` — label matcher parsing (used by routes, silences, inhibitions).\n- `featurecontrol/` — feature flags wired through `--enable-feature`.\n- `limit/`, `httpserver/`, `tracing/` — server plumbing.\n- `ui/web.go` — embeds the built UI assets and serves them.\n- `examples/`, `doc/examples/` — example configs and HA setups.\n- `test/with_api_v2/` and `test/cli/` — integration/e2e tests.\n\nGenerated code (do not hand‑edit):\n\n- `api/v2/{models,restapi,client}/` — regenerated by `scripts/swagger.sh` from `api/v2/openapi.yaml`.\n- `ui/app/src/Data/` — Elm types generated from the OpenAPI spec.\n- `template/email.tmpl` — generated from `template/email.html` via `template/Makefile`.\n- `cluster/clusterpb/cluster.pb.go`, `nflog/nflogpb/nflog.pb.go`, `silence/silencepb/silence.pb.go` — regenerate via `scripts/genproto.sh` if the `.proto` schema must change.\n\n## Common commands\n\nBuilds and tests are driven by the shared `Makefile.common` plus the repo‑specific `Makefile`.\n\n- `make build` — build `alertmanager` and `amtool` (also builds Elm UI assets).\n- `make build-all` — UI assets + regenerated API + binaries.\n- `make build BINARIES=amtool` — build a single binary.\n- `make assets` — regenerate Elm `Data` types and `template/email.tmpl`.\n- `make apiv2` — regenerate `api/v2/{models,restapi,client}` from `api/v2/openapi.yaml` (runs `scripts/swagger.sh`; needs Docker).\n- `make test` — full Go test suite (`go test ./...`) plus UI tests.\n- `make test-short` (via `Makefile.common`) — `go test -short ./...`.\n- `make lint` — `golangci-lint run` (version pinned in `Makefile.common`) plus UI lint.\n- `make common-format` — `go fmt` + `golangci-lint fmt` (gofumpt + goimports with local prefix `github.com/prometheus/alertmanager`).\n- `make fuzz-config` — short fuzz run over `./config`.\n- `make clean` — remove generated API code, generated email template, and UI build output.\n\nRun a single Go test package or test:\n\n```\ngo test ./notify/slack/...\ngo test ./dispatch -run TestDispatcherRace -v\n```\n\nRun the UI dev servers directly when iterating on the frontend:\n\n```\n# Legacy Elm UI\ncd ui/app && make build         # see ui/app/CONTRIBUTING.md\n# New Mantine UI\ncd ui/mantine-ui && npm install && npm run dev\n```\n\nRun Alertmanager locally:\n\n```\n./alertmanager --config.file=doc/examples/simple.yml\n# multi-node HA via Procfile (requires goreman):\ngoreman start\n```\n\n## Conventions\n\n- Follow the lint rules in `.golangci.yml`. Notable forbidden imports (enforced by `depguard`):\n  - Use `github.com/stretchr/testify/require`, not `.../testify/assert`.\n  - Use `github.com/go-kit/log`, not `github.com/go-kit/kit/log`.\n  - Use the standard `errors`/`fmt`, not `github.com/pkg/errors`.\n- Formatting: `gofumpt` + `goimports` with local prefix `github.com/prometheus/alertmanager`. Run `make common-format` before committing.\n- Comments on exported identifiers must be full sentences ending in a period (`godot` lint).\n- Logging uses `log/slog` (`sloglint`). Prefer structured key/value logging.\n- Errors: wrap with `fmt.Errorf(\"...: %w\", err)` and check with `errors.Is`/`errors.As` (`errorlint`).\n- Keep package‑level documentation up to date (`revive: package-comments`).\n- Tests live next to the code as `*_test.go`. Larger integration tests live under `test/`. The `notify/test` package provides shared testing helpers for notifier integrations.\n\n## When changing the API\n\n1. Edit `api/v2/openapi.yaml`.\n2. Run `make apiv2` to regenerate `api/v2/{models,restapi,client}` (requires Docker; see `scripts/swagger.sh`).\n3. Run `make assets` so the Elm UI's `Data` types stay in sync.\n4. Update `api/v2/api.go` handlers for any new operations.\n5. Run `make test lint`.\n\nDo not hand‑edit generated files under `api/v2/models`, `api/v2/restapi`, `api/v2/client`, or `ui/app/src/Data`.\n\n## When adding or modifying a notifier\n\n- Each integration lives in its own package under `notify/<name>/`.\n- Add config in `config/notifiers.go` (struct, validation, defaults) and wire it into `config/config.go` receivers.\n- Register the notifier in `cmd/alertmanager/main.go` where receivers are built.\n- Add unit tests in the notifier package; reuse helpers from `notify/test/`.\n- Update `template/default.tmpl` only if you are introducing new default templates.\n- Note the change in `CHANGELOG.md` under the unreleased section.\n\n## When touching configuration\n\n- `config/config.go` owns top‑level YAML parsing; field changes typically need:\n  - Struct + `yaml` tags.\n  - `UnmarshalYAML` validation.\n  - Defaults in `DefaultGlobalConfig` / receiver defaults.\n  - Tests in `config/config_test.go`, possibly `testdata/` fixtures.\n- Validate behaviour with `make fuzz-config` for parser changes.\n\n## CI expectations\n\nGitHub Actions and CircleCI run build, tests, and `golangci-lint`. Before pushing:\n\n```\nmake common-format\nmake lint\nmake test\n```\n\nIf you regenerate API code or UI data, commit the regenerated files alongside the source changes.\n\n## Things to avoid\n\n- Don't reintroduce APIv1; it was removed in 0.27.0. The only thing left under `api/v1_deprecation_router.go` is a deprecation responder.\n- Don't bypass the notification pipeline (`notify/notify.go`) — new stages should be added as `notify.Stage` implementations.\n- Don't add new top‑level dependencies without checking `.golangci.yml` `depguard` rules and `go.mod` minimums.\n- Don't commit generated artifacts unless the corresponding source (`openapi.yaml`, `email.html`, etc.) changed in the same commit.\n\n## Useful references\n\n- Architecture diagram: `doc/arch.svg` (source `doc/arch.xml`).\n- Example configs: `doc/examples/simple.yml`, `examples/ha/`, `examples/webhook/`.\n- Maintainers and ownership: `MAINTAINERS.md`, `CODEOWNERS`.\n- Release process: `RELEASE.md`.\n- UI contributing guide: `ui/app/CONTRIBUTING.md`.\n","category":"root","tokens":2081}]}