Skip to content

Commit

Permalink
Merge branch 'main' into de_8_18/deprecate-signals-migration-apis
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaliidm authored Dec 3, 2024
2 parents f409fbe + bca4850 commit 4f8cb6b
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 4 deletions.
9 changes: 9 additions & 0 deletions x-pack/plugins/task_manager/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,13 @@ export const config: PluginConfigDescriptor<TaskManagerConfig> = {
},
];
},
exposeToUsage: {
claim_strategy: true,
discovery: {
active_nodes_lookback: true,
},
unsafe: {
exclude_task_types: true,
},
},
};
25 changes: 22 additions & 3 deletions x-pack/plugins/task_manager/server/task_store.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,14 @@ describe('TaskStore', () => {
body: {
size: 0,
query: {
bool: { filter: [{ term: { type: 'task' } }, { term: { 'task.enabled': true } }] },
bool: {
filter: {
bool: {
must: [{ term: { type: 'task' } }, { term: { 'task.enabled': true } }],
must_not: [{ term: { 'task.status': 'unrecognized' } }],
},
},
},
},
aggs: { testAgg: { terms: { field: 'task.taskType' } } },
},
Expand All @@ -578,7 +585,12 @@ describe('TaskStore', () => {
must: [
{
bool: {
filter: [{ term: { type: 'task' } }, { term: { 'task.enabled': true } }],
filter: {
bool: {
must: [{ term: { type: 'task' } }, { term: { 'task.enabled': true } }],
must_not: [{ term: { 'task.status': 'unrecognized' } }],
},
},
},
},
{ term: { 'task.taskType': 'bar' } },
Expand All @@ -600,7 +612,14 @@ describe('TaskStore', () => {
body: {
size: 0,
query: {
bool: { filter: [{ term: { type: 'task' } }, { term: { 'task.enabled': true } }] },
bool: {
filter: {
bool: {
must: [{ term: { type: 'task' } }, { term: { 'task.enabled': true } }],
must_not: [{ term: { 'task.status': 'unrecognized' } }],
},
},
},
},
aggs: { testAgg: { terms: { field: 'task.taskType' } } },
runtime_mappings: { testMapping: { type: 'long', script: { source: `` } } },
Expand Down
8 changes: 7 additions & 1 deletion x-pack/plugins/task_manager/server/task_store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import {
ConcreteTaskInstance,
ConcreteTaskInstanceVersion,
TaskInstance,
TaskStatus,
TaskLifecycle,
TaskLifecycleResult,
SerializedConcreteTaskInstance,
Expand Down Expand Up @@ -842,7 +843,12 @@ function ensureAggregationOnlyReturnsEnabledTaskObjects(opts: AggregationOpts):
const originalQuery = opts.query;
const filterToOnlyTasks = {
bool: {
filter: [{ term: { type: 'task' } }, { term: { 'task.enabled': true } }],
filter: {
bool: {
must: [{ term: { type: 'task' } }, { term: { 'task.enabled': true } }],
must_not: [{ term: { 'task.status': TaskStatus.Unrecognized } }],
},
},
},
};
const query = originalQuery
Expand Down

0 comments on commit 4f8cb6b

Please sign in to comment.