Skip to content
This repository has been archived by the owner on Jul 19, 2022. It is now read-only.

Commit

Permalink
Merge pull request #14 from betorvs/opsgenie_sdk_v2
Browse files Browse the repository at this point in the history
Opsgenie sdk v2
  • Loading branch information
betorvs authored Nov 20, 2020
2 parents 76576e6 + a440398 commit 02f9646
Show file tree
Hide file tree
Showing 25 changed files with 1,760 additions and 510 deletions.
10 changes: 1 addition & 9 deletions .bonsai.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,10 @@ builds:
- "entity.system.os == 'darwin'"
- "entity.system.arch == 'amd64'"

- platform: "OSX"
arch: "386"
asset_filename: "#{repo}_#{version}_darwin_386.tar.gz"
sha_filename: "#{repo}_#{version}_sha512-checksums.txt"
filter:
- "entity.system.os == 'darwin'"
- "entity.system.arch == '386'"

- platform: "Windows"
arch: "amd64"
asset_filename: "#{repo}_#{version}_windows_amd64.tar.gz"
sha_filename: "#{repo}_#{version}_sha512-checksums.txt"
filter:
- "entity.system.os == 'darwin'"
- "entity.system.os == 'windows'"
- "entity.system.arch == 'amd64'"
24 changes: 24 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: golangci-lint

on: [push]

jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.32

# Optional: working directory, useful for monorepos
# working-directory: somedir

# Optional: golangci-lint command line arguments.
# args: --issues-exit-code=0

# Optional: show only new issues if it's a pull request. The default value is `false`.
# only-new-issues: true
31 changes: 31 additions & 0 deletions .github/workflows/release_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Release Go project

on:
push:
tags:
- "*" # triggers only if push new tag version, like `0.8.4` or else

jobs:
build:
name: GoReleaser build
runs-on: ubuntu-latest

steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
with:
fetch-depth: 0 # See: https://goreleaser.com/ci/actions/

- name: Set up Go 1.14
uses: actions/setup-go@v2
with:
go-version: 1.14
id: go

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@master
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21 changes: 21 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Go Test

on: [push]

jobs:
test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Go 1.14
uses: actions/setup-go@v1
with:
go-version: 1.14
id: go
- name: Test
run: go test -v -race ./...
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,7 @@ vendor/

# deploy
bonsai/
dist/
dist/
bin/

sensu-opsgenie-handler
25 changes: 0 additions & 25 deletions .travis.yml

This file was deleted.

26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,32 @@ Versioning](http://semver.org/spec/v2.0.0.html).

## Unreleased



## [1.0.0] - 2020-11-20

### Removed
- Removed flag `OPSGENIE_APIURL` now we use constants from opsgenie sdk-v2.
- Removed `opsgenie_priority` annotation. Should use: `"sensu.io/plugins/sensu-opsgenie-handler/config/priority": "P3"`.
- Removed travis-ci integration

### Changed
- Added flag `--region` to choose opsgenie region. Can be configured using environment variable too `OPSGENIE_REGION`. This feature replaces old `OPSGENIE_APIURL`.
- Added flag `--priority` to change Opsgenie default priority. String field. Expected: "P1", "P2", "P3", "P4" and "P5".
- Updated golang version to 1.14. As require for this updated golangci-lint to `v1.23.8`
- Changed opsgenie sdk to [v2](https://github.com/opsgenie/opsgenie-go-sdk-v2).
- Changed from spf13/cobra to sensu-community/sensu-plugin-sdk.
- Changed withAnnotations to parse all annotations, and exclude if it contains `sensu.io/plugins/sensu-opsgenie-handler/config`, to send to Opsgenie.

### Added
- Added more tests
- Added `--allowLabels` to parse all Labels and send to Opsgenie.
- Added `--fullDetails` to add all kind of details in Opsgenie.
- Added `--descriptionLimit`, `--descriptionTemplate`, `--includeEventInNote`, `--messageLimit`, `--messageTemplate` from this [forked](https://github.com/nixwiz/sensu-opsgenie-handler)

### Removed
- Removed flag `--allowOverride` to enable change opsgenie auth token and team. With this feature you can avoid creating multiples handlers only because one check or entity. We can achieve the same feature with Argument Annotations we can overwrite it even from a event through agent event api.

## [0.1.0] - 2020-03-31

### Changed
Expand Down
Loading

0 comments on commit 02f9646

Please sign in to comment.