Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
alexweav committed Oct 27, 2023
2 parents 3513be6 + 8512285 commit 14444ff
Show file tree
Hide file tree
Showing 57 changed files with 1,440 additions and 339 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
name: CI
on: # yamllint disable-line rule:truthy
pull_request:
workflow_call:
jobs:
test_frontend:
name: Test alertmanager frontend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: make clean
- run: make all
working-directory: ./ui/app
- run: make assets
- run: make apiv2
- run: git diff --exit-code

build:
name: Build Alertmanager for common architectures
runs-on: ubuntu-latest
strategy:
matrix:
thread: [ 0, 1, 2 ]
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
- uses: prometheus/promci@3cb0c3871f223bd5ce1226995bd52ffb314798b6 # v0.1.0
- uses: ./.github/promci/actions/build
with:
promu_opts: "-p linux/amd64 -p windows/amd64 -p linux/arm64 -p darwin/amd64 -p darwin/arm64 -p linux/386"
parallelism: 3
thread: ${{ matrix.thread }}

test:
name: Test
runs-on: ubuntu-latest
# Whenever the Go version is updated here, .promu.yml
# should also be updated.
container:
image: quay.io/prometheus/golang-builder:1.19-base
steps:
- uses: actions/checkout@v3
- uses: prometheus/[email protected]
- uses: ./.github/promci/actions/setup_environment
- run: make
27 changes: 27 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: golangci-lint
on:
pull_request:
paths:
- "go.sum"
- "go.mod"
- "**.go"
- "scripts/errcheck_excludes.txt"
- ".github/workflows/golangci-lint.yml"
- ".golangci.yml"

jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: install Go
uses: actions/setup-go@v2
with:
go-version: 1.19.x
- run: make build
- name: Lint
uses: golangci/[email protected]
with:
version: v1.51.2
22 changes: 22 additions & 0 deletions .github/workflows/mixin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: mixin
on:
pull_request:
paths:
- "doc/alertmanager-mixin/**"

jobs:
mixin:
name: mixin-lint
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: install Go
uses: actions/setup-go@v2
with:
go-version: 1.19.x
# pin the mixtool version until https://github.com/monitoring-mixins/mixtool/issues/135 is merged.
- run: go install github.com/monitoring-mixins/mixtool/cmd/mixtool@2282201396b69055bb0f92f187049027a16d2130
- run: go install github.com/google/go-jsonnet/cmd/jsonnetfmt@latest
- run: go install github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb@latest
- run: make -C doc/alertmanager-mixin lint
38 changes: 38 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Publish
on: # yamllint disable-line rule:truthy
push:
branches:
- main
jobs:
ci:
name: Run ci
uses: ./.github/workflows/ci.yml

build:
name: Build Alertmanager for all architectures
runs-on: ubuntu-latest
strategy:
matrix:
thread: [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 ]
needs: ci
steps:
- uses: actions/checkout@v3
- uses: prometheus/promci@3cb0c3871f223bd5ce1226995bd52ffb314798b6 # v0.1.0
- uses: ./.github/promci/actions/build
with:
parallelism: 12
thread: ${{ matrix.thread }}
publish_main:
name: Publish main branch artefacts
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
- uses: prometheus/promci@3cb0c3871f223bd5ce1226995bd52ffb314798b6 # v0.1.0
- uses: ./.github/promci/actions/publish_main
with:
docker_hub_login: ${{ secrets.docker_hub_login }}
docker_hub_password: ${{ secrets.docker_hub_password }}
quay_io_login: ${{ secrets.quay_io_login }}
quay_io_password: ${{ secrets.quay_io_password }}
38 changes: 38 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Release
on: # yamllint disable-line rule:truthy
push:
tags:
- v*
jobs:
ci:
name: Run ci
uses: ./.github/workflows/ci.yml

build:
name: Build Alertmanager for all architectures
runs-on: ubuntu-latest
strategy:
matrix:
thread: [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 ]
needs: ci
steps:
- uses: actions/checkout@v3
- uses: prometheus/promci@3cb0c3871f223bd5ce1226995bd52ffb314798b6 # v0.1.0
- uses: ./.github/promci/actions/build
with:
parallelism: 12
thread: ${{ matrix.thread }}
publish_release:
name: Publish release artefacts
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
- uses: prometheus/promci@3cb0c3871f223bd5ce1226995bd52ffb314798b6 # v0.1.0
- uses: ./.github/promci/actions/publish_release
with:
docker_hub_login: ${{ secrets.docker_hub_login }}
docker_hub_password: ${{ secrets.docker_hub_password }}
quay_io_login: ${{ secrets.quay_io_login }}
quay_io_password: ${{ secrets.quay_io_password }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
!/.travis.yml
!/.promu.yml
!/api/v2/openapi.yaml
!.github/workflows/*.yml

# Editor
.vscode
Expand Down
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ SWAGGER = docker run \
--user=$(shell id -u $(USER)):$(shell id -g $(USER)) \
--rm \
-v $(shell pwd):/go/src/github.com/prometheus/alertmanager \
-w /go/src/github.com/prometheus/alertmanager quay.io/goswagger/swagger:v0.30.3
-w /go/src/github.com/prometheus/alertmanager quay.io/goswagger/swagger:v0.30.5

api/v2/models api/v2/restapi api/v2/client: api/v2/openapi.yaml
-rm -r api/v2/{client,models,restapi}
Expand All @@ -78,3 +78,11 @@ clean:
template/email.tmpl \
api/v2/models api/v2/restapi api/v2/client
- @cd $(FRONTEND_DIR) && $(MAKE) clean

# In github actions we skip the email test for now. Service containers in github
# actions currently have a bug, see https://github.com/prometheus/alertmanager/pull/3299
# So define a test target, that skips the email test for now.
.PHONY: test
test: $(GOTEST_DIR)
@echo ">> running all tests, except notify/email"
$(GOTEST) $(test-flags) $(GOOPTS) `go list ./... | grep -v notify/email`
17 changes: 16 additions & 1 deletion api/v2/client/alert/get_alerts_responses.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 16 additions & 1 deletion api/v2/client/alert/post_alerts_responses.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 16 additions & 1 deletion api/v2/client/alertgroup/get_alert_groups_responses.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion api/v2/client/general/get_status_responses.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion api/v2/client/receiver/get_receivers_responses.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 14444ff

Please sign in to comment.