Skip to content

Commit

Permalink
Update types to match cli tool
Browse files Browse the repository at this point in the history
  • Loading branch information
kqualters-elastic committed Mar 16, 2020
1 parent 074bba0 commit 7b13c14
Show file tree
Hide file tree
Showing 5 changed files with 1,293 additions and 4,186 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export function eventType(passedEvent: ResolverEvent): ResolverProcessType {
event: { type, category, kind },
} = passedEvent;
if (isValue(category, 'process')) {
if (isValue(type, 'start') || isValue(type, 'change')) {
if (isValue(type, 'start') || isValue(type, 'change') || isValue(type, 'creation')) {
return 'processCreated';
} else if (isValue(type, 'info')) {
return 'processRan';
Expand All @@ -74,7 +74,7 @@ export function uniquePidForProcess(event: ResolverEvent): string {
if (isLegacyEvent(event)) {
return String(event.endgame.unique_pid);
} else {
return event.endpoint.process.entity_id;
return event.process.entity_id;
}
}

Expand All @@ -85,6 +85,6 @@ export function uniqueParentPidForProcess(event: ResolverEvent): string | undefi
if (isLegacyEvent(event)) {
return String(event.endgame.unique_ppid);
} else {
return event.endpoint.process.parent?.entity_id;
return event.process.parent?.entity_id;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ export const resolverMiddlewareFactory: MiddlewareFactory = context => {
]);
childEvents = children.length > 0 ? children.map((child: any) => child.lifecycle) : [];
} else {
const uniquePid = action.payload.selectedEvent.endpoint.process.entity_id;
const ppid = action.payload.selectedEvent.endpoint.process.parent?.entity_id;
const uniquePid = action.payload.selectedEvent.process.entity_id;
const ppid = action.payload.selectedEvent.process.parent?.entity_id;
async function getAncestors(pid: string | undefined) {
if (ancestors.length < maxAncestors && pid !== undefined) {
const parent = await context?.services.http.get(`/api/endpoint/resolver/${pid}`);
ancestors.push(parent.lifecycle[0]);
if (parent.lifecycle[0].endpoint?.process?.parent?.entity_id) {
await getAncestors(parent.lifecycle[0].endpoint.process.parent.entity_id);
if (parent.lifecycle[0].process?.parent?.entity_id) {
await getAncestors(parent.lifecycle[0].process.parent.entity_id);
}
}
}
Expand Down
5 changes: 2 additions & 3 deletions x-pack/test/functional/apps/endpoint/alert_list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
const esArchiver = getService('esArchiver');
const browser = getService('browser');

describe('Endpoint Alert List page', function() {
describe('Endpoint Alert Page: when es has data and user has navigated to the page', function() {
this.tags(['ciGroup7']);
before(async () => {
await esArchiver.load('endpoint/alerts/api_feature');
await pageObjects.common.navigateToUrlWithBrowserHistory('endpoint', '/alerts');
});

it('loads in the browser', async () => {
it('loads the Alert List Page', async () => {
await testSubjects.existOrFail('alertListPage');
});
it('contains the Alert List Page title', async () => {
Expand Down
Binary file not shown.
Loading

0 comments on commit 7b13c14

Please sign in to comment.