-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Fix Watcher stuck firing state #138563
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
Merged
cjcenizal
merged 12 commits into
elastic:main
from
cjcenizal:bug/watcher-stuck-firing-state
Aug 16, 2022
Merged
Fix Watcher stuck firing state #138563
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
688ad02
Update WATCH_STATES by replacing DISABLED with INACTIVE and OK/FIRING…
afe5cc6
Change WatchListPage 'Last fired' column to 'Condition last met' and …
ef2442d
Rename Watch Status Model's lastFired -> lastExecution for consistenc…
6dc2959
Add Condition Met column and tooltips to State and Comment headers on…
72e7bc6
Add tooltip to State header in Execution History flyout. Add Last exe…
e5dbcd6
Merge branch 'main' into bug/watcher-stuck-firing-state
74dc349
Use EUI types instead of hand-rolling them.
9fc49e5
Remove unused ACTION_STATES.FIRING and references to WATCH_STATES.FIR…
b888297
Use dots to denote states, similar to Index Management.
6c5af1a
Refactor deriveComment to use early exits and add WATCH_STATE_COMMENT…
426cb79
Update copy.
712ec49
Revert addition of IS_ACKABLE comment state.
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License | ||
| * 2.0; you may not use this file except in compliance with the Elastic License | ||
| * 2.0. | ||
| */ | ||
|
|
||
| import moment, { Moment } from 'moment'; | ||
| import { ACTION_STATES, WATCH_STATES } from '../common/constants'; | ||
| import { ClientWatchStatusModel, ClientActionStatusModel } from '../common/types'; | ||
|
|
||
| interface WatchHistory { | ||
| id: string; | ||
| watchId: string; | ||
| startTime: Moment; | ||
| watchStatus: { | ||
| state: ClientWatchStatusModel['state']; | ||
| comment?: string; | ||
| lastExecution: Moment; | ||
| actionStatuses?: Array<{ | ||
| id: string; | ||
| state: ClientActionStatusModel['state']; | ||
| }>; | ||
| }; | ||
| details?: object; | ||
| } | ||
|
|
||
| export const getWatchHistory = ({ | ||
| id, | ||
| startTime, | ||
| }: { | ||
| id: string; | ||
| startTime: string; | ||
| }): WatchHistory => ({ | ||
| id, | ||
| startTime: moment(startTime), | ||
| watchId: id, | ||
| watchStatus: { | ||
| state: WATCH_STATES.OK, | ||
| lastExecution: moment('2019-06-03T19:44:11.088Z'), | ||
| actionStatuses: [ | ||
| { | ||
| id: 'a', | ||
| state: ACTION_STATES.OK, | ||
| }, | ||
| ], | ||
| }, | ||
| details: {}, | ||
| }); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just renamed this file to align with the exported function name and reduced the function's params.