Skip to content
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
2 changes: 0 additions & 2 deletions src/cli/repl/commands/repl-commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import { type OutputFormatter , bold, italic } from '../../../util/text/ansi';
import { splitAtEscapeSensitive } from '../../../util/text/args';
import { guard } from '../../../util/assert';
import { scripts } from '../../common/scripts-info';
import { lineageCommand } from './repl-lineage';
import { queryCommand, queryStarCommand } from './repl-query';

function printHelpForScript(script: [string, ReplBaseCommand], f: OutputFormatter, starredVersion?: ReplBaseCommand): string {
Expand Down Expand Up @@ -95,7 +94,6 @@ const _commands: Record<string, ReplCommand | ReplCodeCommand> = {
'controlflow*': controlflowStarCommand,
'controlflowbb': controlflowBbCommand,
'controlflowbb*': controlflowBbStarCommand,
'lineage': lineageCommand,
'query': queryCommand,
'query*': queryStarCommand
};
Expand Down
74 changes: 0 additions & 74 deletions src/cli/repl/commands/repl-lineage.ts

This file was deleted.

36 changes: 0 additions & 36 deletions src/cli/repl/server/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ import { DataflowGraph } from '../../../dataflow/graph/graph';
import * as tmp from 'tmp';
import fs from 'fs';
import type { RParseRequests } from '../../../r-bridge/retriever';
import { type LineageRequestMessage, type LineageResponseMessage , requestLineageMessage } from './messages/message-lineage';
import { getLineage } from '../commands/repl-lineage';
import { type QueryRequestMessage, type QueryResponseMessage , requestQueryMessage } from './messages/message-query';
import type { KnownParser, ParseStepOutput } from '../../../r-bridge/parser';
import { compact } from './compact';
Expand Down Expand Up @@ -107,9 +105,6 @@ export class FlowRServerConnection {
case 'request-repl-execution':
this.handleRepl(request.message as ExecuteRequestMessage);
break;
case 'request-lineage':
void this.handleLineageRequest(request.message as LineageRequestMessage);
break;
case 'request-query':
this.handleQueryRequest(request.message as QueryRequestMessage);
break;
Expand Down Expand Up @@ -313,37 +308,6 @@ export class FlowRServerConnection {
});
}

private async handleLineageRequest(base: LineageRequestMessage) {
const requestResult = validateMessage(base, requestLineageMessage);

if(requestResult.type === 'error') {
answerForValidationError(this.socket, requestResult, base.id);
return;
}

const request = requestResult.message;
this.logger.info(`[${this.name}] Received lineage request for criterion ${request.criterion}`);

const fileInformation = this.fileMap.get(request.filetoken);
if(!fileInformation) {
sendMessage<FlowrErrorMessage>(this.socket, {
id: request.id,
type: 'error',
fatal: false,
reason: `The file token ${request.filetoken} has never been analyzed.`
});
return;
}

const analyzer = fileInformation.analyzer;
const lineageIds = getLineage(request.criterion, (await analyzer.dataflow()).graph, (await analyzer.normalize()).idMap);
sendMessage<LineageResponseMessage>(this.socket, {
type: 'response-lineage',
id: request.id,
lineage: [...lineageIds]
});
}

private handleQueryRequest(base: QueryRequestMessage) {
const requestResult = validateMessage(base, requestQueryMessage);

Expand Down
3 changes: 0 additions & 3 deletions src/cli/repl/server/messages/all-messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import type { FileAnalysisRequestMessage, FileAnalysisResponseMessageJson } from
import type { ExecuteEndMessage, ExecuteIntermediateResponseMessage, ExecuteRequestMessage } from './message-repl';
import type { SliceRequestMessage, SliceResponseMessage } from './message-slice';
import type { FlowrErrorMessage } from './message-error';
import type { LineageRequestMessage, LineageResponseMessage } from './message-lineage';
import type { QueryRequestMessage, QueryResponseMessage } from './message-query';

/**
Expand Down Expand Up @@ -52,8 +51,6 @@ export type FlowrMessage = FlowrHelloResponseMessage
| ExecuteEndMessage
| SliceRequestMessage
| SliceResponseMessage
| LineageRequestMessage
| LineageResponseMessage
| QueryRequestMessage
| QueryResponseMessage
| FlowrErrorMessage
37 changes: 0 additions & 37 deletions src/cli/repl/server/messages/message-lineage.ts

This file was deleted.

67 changes: 1 addition & 66 deletions src/documentation/data/server/doc-data-server-messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import {
responseQueryMessage
} from '../../../cli/repl/server/messages/message-query';
import { exampleQueryCode } from '../query/example-query-code';
import { requestLineageMessage, responseLineageMessage } from '../../../cli/repl/server/messages/message-lineage';
import { CallTargets } from '../../../queries/catalog/call-context-query/identify-link-to-last-call-relation';


Expand Down Expand Up @@ -85,7 +84,7 @@ Requests for the [REPL](#message-request-repl) are independent of that.
return `

The request allows the server to analyze a file and prepare it for slicing.
The message can contain a \`filetoken\`, which is used to identify the file in later slice or lineage requests (if you do not add one, the request will not be stored and therefore, it is not available for subsequent requests).
The message can contain a \`filetoken\`, which is used to identify the file in later slice or query requests (if you do not add one, the request will not be stored and therefore, it is not available for subsequent requests).

> **Please note!**\\
> If you want to send and process a lot of analysis requests, but do not want to slice them, please do not pass the \`filetoken\` field. This will save the server a lot of memory allocation.
Expand Down Expand Up @@ -519,68 +518,4 @@ See [above](#message-request-file-analysis) for the general structure of the res
`;
}
});

documentServerMessage({
title: 'Lineage',
type: 'request',
definitionPath: '../cli/repl/server/messages/message-lineage.ts',
defRequest: requestLineageMessage,
defResponse: responseLineageMessage,
mermaidSequenceDiagram: `
Client->>+Server: request-lineage

alt
Server-->>Client: response-lineage
else
Server-->>Client: error
end
deactivate Server
`,
shortDescription: `${deprecatedByQuery} Obtain the lineage of a given slicing criterion.`,
text: async(shell: RShell) => {
return `

**We deprecated the lineage request in favor of the \`lineage\` [Query](${FlowrWikiBaseRef}/Query%20API).**

In order to retrieve the lineage of an object, you have to send a file analysis request first. The \`filetoken\` you assign is of use here as you can re-use it to repeatedly retrieve the lineage of the same file.
Besides that, you will need to add a [criterion](${FlowrWikiBaseRef}/Terminology#slicing-criterion) that specifies the object whose lineage you're interested in.

${
await documentServerMessageResponse({
shell,
messageType: 'request-query',
messages: [{
type: 'request',
message: {
type: 'request-file-analysis',
id: '1',
filetoken: 'x',
content: 'x <- 1\nx + 1'
}
}, {
type: 'response',
expectedType: 'response-file-analysis',
description: `
See [above](#message-request-file-analysis) for the general structure of the response.
`
}, {
type: 'request',
message: {
type: 'request-lineage',
id: '2',
filetoken: 'x',
criterion: '2@x'
},
mark: true
}, {
type: 'response',
expectedType: 'response-lineage',
description: 'The response contains the lineage of the desired object in form of an array of IDs (as the representation of a set).'
}]
})
}

`;
}
});
}
36 changes: 0 additions & 36 deletions src/documentation/print-query-wiki.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import { executeIdMapQuery } from '../queries/catalog/id-map-query/id-map-query-
import { executeNormalizedAstQuery } from '../queries/catalog/normalized-ast-query/normalized-ast-query-executor';
import { executeDataflowClusterQuery } from '../queries/catalog/cluster-query/cluster-query-executor';
import { executeStaticSliceQuery } from '../queries/catalog/static-slice-query/static-slice-query-executor';
import { executeLineageQuery } from '../queries/catalog/lineage-query/lineage-query-executor';
import { executeDependenciesQuery } from '../queries/catalog/dependencies-query/dependencies-query-executor';
import { getReplCommand } from './doc-util/doc-cli-option';
import { NewIssueUrl } from './doc-util/doc-issue';
Expand Down Expand Up @@ -186,41 +185,6 @@ ${
}
});

registerQueryDocumentation('lineage', {
name: 'Lineage Query',
type: 'active',
shortDescription: 'Returns lineage of a criteria.',
functionName: executeLineageQuery.name,
functionFile: '../queries/catalog/lineage-query/lineage-query-executor.ts',
buildExplanation: async(shell: RShell) => {
const exampleCode = 'x <- 1\nx';

return `
This query calculates the _lineage_ of a given slicing criterion. The lineage traces back all parts that the
respective variables stems from given the reads, definitions, and returns in the dataflow graph.

To understand this, let's start with a simple example query, to get the lineage of the second use of \`x\` in the following code:
${codeBlock('r', exampleCode)}

For this, we use the criterion \`2@x\` (which is the first use of \`x\` in the second line).

${
await showQuery(shell, exampleCode, [{
type: 'lineage',
criterion: '2@x'
}], { showCode: false })
}

In this simple scenario, the _lineage_ is equivalent to the slice (and in-fact the complete code).
In general the lineage is smaller and makes no guarantees on executability.
It is just a quick and neither complete nor sound way to get information on where the variable originates from.

This query replaces the old [\`request-lineage\`](${FlowrWikiBaseRef}/Interface#message-request-lineage) message.

`;
}
});

registerQueryDocumentation('dataflow-cluster', {
name: 'Dataflow Cluster Query',
type: 'active',
Expand Down
26 changes: 0 additions & 26 deletions src/queries/catalog/lineage-query/lineage-query-executor.ts

This file was deleted.

Loading
Loading