Proto commits in QMSTR/qmstr

These 97 commits are when the Protocol Buffers files have changed:

Commit:9ca025b
Author:Markus Herpich
Committer:Giasemi Seisa

[go-qmstr] add module client library Introduce client library for modules to access qmstr-master from modules without directly calling grpc functions.

The documentation is generated from this commit.

Commit:ad86ea4
Author:GiasemiSh
Committer:Markus Herpich

[proto] Send all info nodes at once for each file node It's best practise if we have an info node message for each file node.

Commit:d55b67d
Author:Markus Herpich
Committer:Markus Herpich

[qmstr-master] implement rpc get source file nodes Implement the RPC function to retrieve source filenodes from the graph. This will be called from analyzers.

Commit:e96b655
Author:Markus Herpich
Committer:Markus Herpich

[proto] Remove fileType from data model Remove the fileType field from data model. It is unreliable because it depends on the builders to be set correctly. Also the kind of information we need, e.g. what file node is a source, can be deduced from the graph.

Commit:b45d13f
Author:GiasemiSh
Committer:Markus Herpich

Adapt report phase

Commit:ec117de
Author:GiasemiSh
Committer:Markus Herpich

Adapt analysis phase to the new fileNode structure Connect info nodes and diagnostic nodes to the file data nodes instead of the file nodes.

Commit:a7ef4fc
Author:GiasemiSh
Committer:Markus Herpich

datamodel] timestamp -> string Queries silently change the value of int64 to float, probably on large integers due to overflow.

Commit:cfd619b
Author:GiasemiSh
Committer:Markus Herpich

[datamodel] Seperate file data to another structure That way our data model represents how the filesystem works and reduces complexity. We can store multiple paths pointing to the same file data and keep track of file data that are changing but the path stays the same.

Commit:8d557a3
Author:GiasemiSh
Committer:Markus Herpich

Introduce timestamps Introduce timestamps into the database structure

Commit:81e035d
Author:Markus Herpich
Committer:Markus Herpich

Wait also waits for inserts to be done Since adding nodes from the commandline might reference nodes that are not yet written to database we need a way to make sure everything is in db without switching to the next phase.

Commit:e7e6be3
Author:Markus Herpich
Committer:Markus Herpich

Remove BOM service The service is bulky and not scalable.

Commit:7f48456
Author:GiasemiSh
Committer:Markus Herpich

Add version field in the package node structure

Commit:befd2ee
Author:GiasemiSh
Committer:Markus Herpich

Remove pkg analyzer Pkg-analyzer modifies the build database. That's not allowed anymore in other phases than the build phase. We can use the connect command instead to connect the targets to the packages.

Commit:e18a1e2
Author:GiasemiSh
Committer:Markus Herpich

Fix test reporter Add GetProjectNode rpc function in the report service, so it can be available inside the reporters.

Commit:fc04b33
Author:GiasemiSh
Committer:Markus Herpich

Improve rpc Package function Give a more appropriate name to the function, that reflects what the function does. Also provide the package to which we are going to connect the targets.

Commit:020c286
Author:GiasemiSh
Committer:Markus Herpich

Html reporter should not fail if a package does not exist Html reporter should create a BOM for each package. If no packages exist then it just returns.

Commit:8c4cc31
Author:GiasemiSh
Committer:Markus Herpich

GetPackageNode returns a stream of packages Since the database structure changed, we may have more than one package node in our database. GetPackageΝode returns a stream of packages. If we want to get a specific package node from the database, we can call the function parameterised by a package with the desired name. The function will return a stream with only the desired node. Otherwise it will return a stream with all the packages in the database.

Commit:298ef28
Author:Markus Herpich
Committer:Markus Herpich

Fix phase when importing snapshot Importing snapshot always activated the current phase. This lead e.g to activating the analysis phase and running all analyzers again when importing a post analysis snapshot.

Commit:bce41a6
Author:Markus Herpich
Committer:Markus Herpich

Merge in proto repo again Using a separate proto repo introduced more problems developing than it solved.

Commit:4670364
Author:Markus Herpich
Committer:Markus Herpich

Remove the proto files Proto files live their own repo and are picked up by the libraries.

This commit does not contain any .proto files.

Commit:aaf4981
Author:Giasemi Seisa
Committer:GiasemiSh

Remove session Session is not used anymore. Session was needed in the old implementation to refer to the package node or the database in general. Now we can just refer to the package node by quering for packageNodeType.

Commit:7103ce0
Author:Nikolas Sepos
Committer:GitHub

Add sourceURL field in PackageInformation (#205) This field is to be set by the user (or tool?) in the "metadata" section of the QMSTR yaml config file and it should point to the source of the package being analyzed For example: * http://ftp.gnu.org/gnu/glibc/glibc-ports-2.15.tar.gz * git://git.myproject.org/MyProject

Commit:b952d31
Author:Giasemi Seisa
Committer:GiasemiSh

Use proto enumeration to restrict file type declaration Use enumeration to restrict arbitrary strings in filenode's type field.

Commit:3a117d4
Author:Giasemi Seisa
Committer:GiasemiSh

Html reporter shows path not name Use path as we may have targets with the same name and we won't be able to distinguish between them.

Commit:5d416fe
Author:Markus Herpich
Committer:Markus Herpich

Export and import pushed files Include uploaded source files into the snapshot and restore on import.

Commit:1f63685
Author:Markus Herpich
Committer:Markus Herpich

Actually write the uploaded data to a file

Commit:d8aa5ec
Author:Markus Herpich
Committer:Markus Herpich

Actually send the file

Commit:c452533
Author:Markus Herpich
Committer:Markus Herpich

Provide PushFileMessage from gcc builder

Commit:08496d9
Author:Markus Herpich
Committer:Markus Herpich

Add rpc function to push files to the server Upload files to the server. This will be used when the builder captures code from stdin to persist it for analysis.

Commit:1107817
Author:Giasemi Seisa
Committer:GiasemiSh

(Preparation) Restructure package nodes inserts Package analyzer should send a package node message. It's a preparation step to allow Missing Pieces analyzer to add/append a file node and not get mixed up with the package analyzer.

Commit:d7805ff
Author:Markus Herpich
Committer:GiasemiSh

Distinguish error and warning in builder Do not create errors for mode not implemented in gcc but produce a warning.

Commit:42c3649
Author:Markus Herpich
Committer:GiasemiSh

Await pending inserts on export Await the pending inserts to be written to the database before exporting snapshot to make sure having a consistant snapshot. Also use event classes from protobuf.

Commit:f02ac11
Author:Markus Herpich
Committer:GiasemiSh

Don't break the build if qmstr fails Instead of breaking the whole build insert error messages into the graph (package node) to signal errors in the builders.

Commit:a57bcde
Author:Markus Herpich
Committer:Markus Herpich

Import export logic Persist session and phase in database Export database via snapshot command Load snapshot on startup via --seed flag on start command

Commit:0ca4d95
Author:Markus Herpich
Committer:Markus Herpich

Overhaul protobuf/grpc code generation In order to get correct import statments for python3 right now the only way is to have the proto files in a directory structure that corresponds to the module path. Of course this also has affects the generated go code.

Commit:031dd7c
Author:Markus Herpich
Committer:Markus Herpich

Change nodeType to per node predicate Remove nodeType that needs to be set correctly to a predicate named like the actual message. This makes it easier to query and filter by that predicate without looking up the corresponding int to the nodeType. Also this is less error prone because the actual value assigned is irrelevant. Clean up database code To have the node predicates serialized when writing to the database a dummy value is inserted automatically.

Commit:94d31a0
Author:Markus Herpich
Committer:Markus Herpich

define server phase in protobuf Change server phase into enum defined in the protobuf data model. This way it needs to be done once and not clashes can occur.

Commit:54b3642
Author:Markus Herpich
Committer:Markus Herpich

Fix versionidentifier Calc short id on the fly. Remove remotes/<remotename> from description. Also show full identifier in detail pages.

Commit:96f65f9
Author:Markus Herpich
Committer:Markus Herpich

Create reports for build configurations Add the build configuration to the taxonomy of the html report.

Commit:8b3a82c
Author:Markus Herpich
Committer:Markus Herpich

Store the buildconfig in the package node Store the config in the package node to access it later.

Commit:4409ccc
Author:Markus Herpich
Committer:Markus Herpich

Fix summary rendering Escape double quotes in the summary. Also do not store summary in a field as it is nothing but a short version of the already stored message.

Commit:364cf4f
Author:Markus Herpich
Committer:Markus Herpich

Use the right proto files Do not use the copied protobuf files anymore.

Commit:667abf2
Author:Markus Herpich
Committer:Markus Herpich

Add gradle plugin stub The plugin connects to a running qmstr-master and sends some remote log messages. The project is build with gradle and compiles the gRPC java code from the provided proto files (those are copied from the qmstr repository and we need to find a solution to share those files). For convenience the build can create idea project files and install the resulting plugin in your local maven repository.

Commit:ee7c9b8
Author:Markus Herpich
Committer:Mirko Boehm

Add dependencies to BOM and htmlreporter Add the dependencies to the bill of material and render it to html report.

Commit:7c4775f
Author:Markus Herpich
Committer:Markus Herpich

Find declared license and map to package info

Commit:57bc25a
Author:Markus Herpich
Committer:Markus Herpich

Implement GetBOM Add bom and corresponding rpc function

Commit:acbee06
Author:Markus Herpich
Committer:Markus Herpich

Distinguish between rpc failure and modules failure Print out better failure messages and publish more events to improve feedback to the user.

Commit:5a7a979
Author:Giasemi Seisa
Committer:GiasemiSh

Check for type selector in the configuration Package analyzer connects the package node with linked targets but in the case of jabref we want to connect the package node to a jar file. In that case we provide a type selector to override the default type.

Commit:f85360f
Author:Markus Herpich
Committer:Markus Herpich

Add info data query

Commit:4e31d30
Author:Markus Herpich
Committer:Markus Herpich

Fix adding file and info nodes

Commit:53cf441
Author:Markus Herpich
Committer:Markus Herpich

fix path substitution

Commit:20a6a92
Author:Markus Herpich
Committer:Markus Herpich

Send filenode rpc function definition

Commit:f618cac
Author:Markus Herpich
Committer:Markus Herpich

Let analyzers send back info nodes

Commit:1a2d791
Author:Markus Herpich

Merge remote-tracking branch 'origin/wip/giasemi/85_getFileNodes' into demodemo

Commit:d96f49a
Author:Markus Herpich

Merge branch 'wip/markus/83_sending_infonodes' into demodemo

Commit:23a96a4
Author:Giasemi Seisa
Committer:Giasemi Seisa

Adapt new implementation of quering file nodes Analyze function is not anymore called for each file node. Now it's more generic and can be used for the analysis of both file nodes and package nodes.

Commit:69dd233
Author:Giasemi Seisa
Committer:Giasemi Seisa

Implement file node query Add an rpc function which queries depending on a filenode and returns a slice of filenode. This way we can query for different attribute sets of a filenode.

Commit:1d3f80d
Author:Markus Herpich
Committer:Markus Herpich

Add token to request and analyzer to infonode Add missing parts: - token for enforcing analyzer order - analyzer node to infonode

Commit:9236754
Author:Markus Herpich

Add SendInfoNodes grpc function

Commit:bf7f1f9
Author:Giasemi Seisa
Committer:GiasemiSh

Implement Confidence score Confidence score is used as a normalised ranking of info nodes.

Commit:bdaac58
Author:Giasemi Seisa
Committer:GiasemiSh

Implement trust level Trust levels are configured and assigned to analysis modules to specify each module's reliability.

Commit:9cb07fb
Author:Markus Herpich
Committer:Markus Herpich

Introduce event publication and subscription In order to give more feedback to clients the master will emit events that the clients can subscribe to. This will be used to show more out put on long running qmstrctl commands like analyze and report.

Commit:ef33e17
Author:Markus Herpich
Committer:Markus Herpich

Add error message to status

Commit:092c043
Author:Markus Herpich
Committer:Markus Herpich

Add status command repair wait Repair the wait command to wait until init phase is done. Add status command to print out the current master server phase.

Commit:b041319
Author:Giasemi Seisa
Committer:GiasemiSh

Add the connection between targets and package node in the DB Insert the package's targets in the database.

Commit:aacba6f
Author:Giasemi Seisa
Committer:GiasemiSh

Move package node access to control service We want to be able to have access to package node in all phases.

Commit:8b81b61
Author:Markus Herpich
Committer:Markus Herpich

Move proto buffer files to generic location Since the protobuf files will be used to generate java and python code they should not be in a go specific directory.

Commit:3ca3bd9
Author:Markus Herpich
Committer:Markus Herpich

Inject output directory into module configuration For each module inject an output directory into the module configuration.

Commit:6b07894
Author:Markus Herpich
Committer:Markus Herpich

Pass name to modules via configure

Commit:57e1707
Author:Markus Herpich
Committer:Markus Herpich

Pass cachedir via configuration response

Commit:e625ae6
Author:Markus Herpich
Committer:Markus Herpich

Fix reporting rpc Only one response will be sent. Also adapt function name to reflect its purpose.

Commit:af86838
Author:Markus Herpich
Committer:Markus Herpich

Map project metadata to package data in html reporter

Commit:f07671e
Author:Markus Herpich
Committer:Markus Herpich

Introduce session id To support more than one package node add a session id to the master and the packagenode.

Commit:988abd1
Author:Markus Herpich
Committer:Markus Herpich

Pass package name to html reporter

Commit:a336de7
Author:Markus Herpich
Committer:Markus Herpich

Use constants for nodetype To not use magic numbers use constants for the nodetypes

Commit:85a4114
Author:Markus Herpich
Committer:Markus Herpich

Add declaration for package node. The package node will reference all targets build as well as metadata about the build e.g. a name, declared license and project URL.

Commit:eb023f3
Author:Markus Herpich
Committer:Markus Herpich

Introduce reporting service Add implementation of the reporting. Similar to the analysis reporters are configured via the global qmstr configuration and are started from the master server.

Commit:691506c
Author:Markus Herpich
Committer:Markus Herpich

Migrate scancode analyzer Migrate the scancode analyzer to the new service model. Improve query for infonodes to just one query, to let the database do as much as possible.

Commit:389589b
Author:Markus Herpich
Committer:Markus Herpich

Implement analysis phase Implement analysis phase and adapt spdx analyzer to it.

Commit:d46944a
Author:Markus Herpich
Committer:Markus Herpich

Implement build phase Implement the build phase and adapt gcc-compiler to it.

Commit:fd7c931
Author:Giasemi Seisa
Committer:Markus Herpich

Add node type predicate

Commit:657dbcd
Author:Markus Herpich
Committer:Markus Herpich

Adapt CLI to new service model

Commit:92c1393
Author:Markus Herpich
Committer:Markus Herpich

Introduce new service structure and datamodel Introduce new service structure with separate service definitions for each phase (build, analyze and report)

Commit:e01e78b
Author:Giasemi Seisa
Committer:Markus Herpich

Change data structure Create dgraph data with protobuf so they can be used from other file types. Also data structure is now more generic.

Commit:a999035
Author:Markus Herpich
Committer:Markus Herpich

Service definition for using global config Since the analysis and report will be defined in a global configuration file passed to the master at runtime the Analyze and Report functions do not need to pass this information.

Commit:056849f
Author:Markus Herpich
Committer:Markus Herpich

Add reporting to buildservice Add report function to build service definition.

Commit:5fc223f
Author:Markus Herpich
Committer:Markus Herpich

Do not fail if file is not hashable Insert dummy hash but do not fail if hashing fails.

Commit:69059d3
Author:Markus Herpich
Committer:Markus Herpich

Add path substitution to analyzer message Since this might be usabe for all analyzers make it part of the AnalysisMessage and not the generic configuration.

Commit:cd65ea9
Author:Markus Herpich
Committer:Markus Herpich

Run the analyzers - Add very basic spdx identifier analyzer that finds SPDX-License Identifiers in the first 100 lines of a source file. - Run analyzers on all nodes that are selected via the node type.

Commit:388d3c8
Author:Markus Herpich
Committer:Markus Herpich

Add analysis Add Analyse function stub generalize database queries introduce function to get all nodes of a certain type from the db

Commit:7da912f
Author:Markus Herpich
Committer:Markus Herpich

Add Analysis definition

Commit:8827fa5
Author:Markus Herpich
Committer:Markus Herpich

Store gathered information in dgraph Calculate hashes for all files to identify them later. Find link libraries to also calculate hashes for them and store them as dependencies for linked targets. Store dependency information in the graph database.

Commit:de7f95a
Author:Markus Herpich

Handle linking libraries To not overload the wrapper with work collect information about linking libraries and search paths only and send to master server. Deeper analysis of the linked libraries is master server's duty.

Commit:31fad90
Author:Markus Herpich
Committer:Markus Herpich

Add gcc compiler analysis Add functionality to analyze gcc commandline, create a BuildMessage and send it to the master server.

Commit:f9941ef
Author:Markus Herpich
Committer:Markus Herpich

Introduce ability to shutdown master from client

Commit:831e453
Author:Markus Herpich
Committer:Markus Herpich

Introduce remote logging Extend build service to send log messages to the master server from the wrapper. Implement io.Writer to be used as logging sink that sends all logs via the buildservice's Log function.

Commit:93ddc19
Author:Markus Herpich
Committer:Markus Herpich

Add qmstr-master server stub Add a stub for the master server that instructs the generation of the grpc service code.