Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Silences expiration sort #4951

Merged
merged 2 commits into from
Feb 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG-6.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Versioning](http://semver.org/spec/v2.0.0.html).

### Added
- Adding a flag at agent level to avoid collecting system.networks property in the agent entity state
- Added silences sorting by expiration to GraphQL service

## [6.9.1] - 2022-12-01

Expand Down
4 changes: 4 additions & 0 deletions backend/apid/graphql/namespace.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,10 @@ func (r *namespaceImpl) Silences(p schema.NamespaceSilencesFieldResolverParams)
sort.Sort(sort.Reverse(corev2.SortSilencedByBegin(filteredResults)))
case schema.SilencesListOrders.BEGIN:
sort.Sort(corev2.SortSilencedByBegin(filteredResults))
case schema.SilencesListOrders.EXPIRE_AT_DESC:
sort.Sort(sort.Reverse(corev2.SortSilencedByExpireAt(filteredResults)))
case schema.SilencesListOrders.EXPIRE_AT:
sort.Sort(corev2.SortSilencedByExpireAt(filteredResults))
case schema.SilencesListOrders.ID_DESC:
sort.Sort(sort.Reverse(corev2.SortSilencedByName(filteredResults)))
case schema.SilencesListOrders.ID:
Expand Down
26 changes: 22 additions & 4 deletions backend/apid/graphql/schema/silenced.gql.go

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

2 changes: 2 additions & 0 deletions backend/apid/graphql/schema/silenced.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,6 @@ enum SilencesListOrder {
ID_DESC
BEGIN
BEGIN_DESC
EXPIRE_AT
EXPIRE_AT_DESC
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ require (
github.com/go-test/deep v1.0.8
github.com/google/go-cmp v0.5.8 // indirect
github.com/kr/pty v1.1.8 // indirect
github.com/sensu/core/v2 v2.16.0-alpha6
github.com/sensu/core/v2 v2.16.1
github.com/sensu/core/v3 v3.8.0-alpha6
github.com/sensu/sensu-api-tools v0.0.0-20221025205055-db03ae2f8099
github.com/sensu/sensu-go/types v0.12.0-alpha6
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,8 @@ github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg
github.com/sensu/core/v2 v2.16.0-alpha1/go.mod h1:vFoPc++U8m30t0fXKNGqOqHLOFr7VuqFc+Hkz+eTdmU=
github.com/sensu/core/v2 v2.16.0-alpha6 h1:6WTEevm2tQEgCx50IL4aXomAXQip7s6kX4xR3uNVYlI=
github.com/sensu/core/v2 v2.16.0-alpha6/go.mod h1:2etWGsa+nx5G2Q3CKiSJY9kSg8VhCgGzgp1VyxbC6U8=
github.com/sensu/core/v2 v2.16.1 h1:lYicLM1PXq5Zwj5h7akXMFXvWcja12qMLzKsJr3qM4Q=
github.com/sensu/core/v2 v2.16.1/go.mod h1:2etWGsa+nx5G2Q3CKiSJY9kSg8VhCgGzgp1VyxbC6U8=
github.com/sensu/core/v3 v3.8.0-alpha6 h1:ywO14aIHippeIAe2HBHrPhSdyBMs1pQtjvkYaHmEwGw=
github.com/sensu/core/v3 v3.8.0-alpha6/go.mod h1:HUrsxGfeUSvd+iU5ROGgfBchv3eYjhS3Apz6XzNB8Gg=
github.com/sensu/lasr v1.2.1 h1:4H1QfOrPkwYHMFE5qAI6GwKEFkcI1YRyjjWidz1MihQ=
Expand Down