1
1
mirror of https://github.com/github/semantic.git synced 2024-12-24 23:42:31 +03:00

Merge remote-tracking branch 'origin/master' into import-graph-mk2

This commit is contained in:
Patrick Thomson 2018-06-13 14:10:18 -04:00
commit d5c7b34a3f
3 changed files with 88 additions and 9 deletions

87
proto/code_analysis.proto Normal file
View File

@ -0,0 +1,87 @@
syntax = "proto3";
import "types.proto";
package github.semantic.v1alpha1;
// Semantic's CodeAnalysis service provides endpoints for parsing, analyzing, and
// comparing source code.
service CodeAnalysis {
// Parsing
//
// Parse source code blobs and return abstract syntax trees.
rpc Parse (ParseTreeRequest) returns (ParseTreeResponse);
// Diffing
//
// Summarize an AST diff of source blobs.
rpc SummarizeDiff (SummarizeDiffRequest) returns (SummarizeDiffResponse);
// AST diff of source blobs
// rpc Diff (DiffRequest) returns (DiffResponse) {}
// Analyzing
//
// Calculate an import graph for a project.
rpc GraphImports (ImportGraphRequest) returns (ImportGraphResponse);
// rpc GraphCalls (CallGraphRequest) returns (CallGraphResponse);
// Check health & status of the service.
rpc CheckHealth (HealthCheckRequest) returns (HealthCheckResponse);
}
message ParseTreeRequest {
repeated Blob blobs = 1;
}
message ParseTreeResponse {
bytes json_tree = 1;
repeated ParseError errors = 2;
}
message SummarizeDiffRequest {
repeated BlobPair blobPairs = 1;
}
message SummarizeDiffResponse {
repeated DiffSummary changes = 1;
repeated ParseError errors = 2;
}
message ImportGraphRequest {
Project project = 1;
}
message ImportGraphResponse {
AdjList graph = 1;
repeated string errorMessages = 2;
}
message BlobPair {
Blob before = 1;
Blob after = 2;
}
message DiffSummary {
string term = 1;
string name = 2;
Span span = 3;
string change = 4;
}
message ParseError {
string error = 1;
Span span = 2;
string language = 3;
}
message HealthCheckRequest {
string service = 1;
}
message HealthCheckResponse {
enum ServingStatus {
UNKNOWN = 0;
SERVING = 1;
NOT_SERVING = 2;
}
ServingStatus status = 1;
}

View File

@ -1,5 +1,5 @@
syntax = "proto3";
package semantic;
package github.semantic.v1alpha1;
enum Language {Unknown = 0;
Go = 1;
Haskell = 2;

View File

@ -26,18 +26,10 @@ message SummariesRequest {
repeated BlobPair blobPairs = 1;
}
message ImportGraphRequest {
Project project = 1;
}
message ParseRequest {
repeated Blob source = 1;
}
message ImportGraphResponse {
AdjList graph = 1;
repeated string errorMessages = 2;
}
message BlobPair {
Blob before = 1;