pkm-api issueshttps://gitlab.ow2.org/decoder/pkm-api/-/issues2021-09-28T11:50:55Zhttps://gitlab.ow2.org/decoder/pkm-api/-/issues/12Documentation is not public2021-09-28T11:50:55ZPierre-Yves GibelloDocumentation is not publicThe README.md documentation provides links to non-public documents (hosted on password-protected OW2 nextcloud instance) as pkm API user documentation. This makes the doc unavailable to users!The README.md documentation provides links to non-public documents (hosted on password-protected OW2 nextcloud instance) as pkm API user documentation. This makes the doc unavailable to users!Gilles MouchardGilles Mouchardhttps://gitlab.ow2.org/decoder/pkm-api/-/issues/11Docker container update fails due to wrong handling of apt updates2020-11-02T11:30:00ZGaël de ChalendarDocker container update fails due to wrong handling of apt updatesWhen I tried to update my pkm-api docker container this morning, it failed because some `apt install` changed that were not backed up by `apt update`. So, some dependencies failed. I have two suggestions:
- always do `RUN apt update -y &...When I tried to update my pkm-api docker container this morning, it failed because some `apt install` changed that were not backed up by `apt update`. So, some dependencies failed. I have two suggestions:
- always do `RUN apt update -y && apt install -y ...`
- when an installation works, group all `apt install` in a single `RUN` command to avoid several updates and improve dependencies checking.https://gitlab.ow2.org/decoder/pkm-api/-/issues/10insert_doc_files works only from PKM install directory2021-01-27T06:26:11ZPierre-Yves Gibelloinsert_doc_files works only from PKM install directorySame issue as #9 , but for insert_doc_files.
To reproduce, go in /tmp, create a sample test.md file (eg. with "# Test" inside), then:
```
/tmp$ insert_doc_files testdb test.md
internal/validators.js:121
throw new ERR_INVALID_ARG_T...Same issue as #9 , but for insert_doc_files.
To reproduce, go in /tmp, create a sample test.md file (eg. with "# Test" inside), then:
```
/tmp$ insert_doc_files testdb test.md
internal/validators.js:121
throw new ERR_INVALID_ARG_TYPE(name, 'string', value);
^
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
at validateString (internal/validators.js:121:11)
at Object.resolve (path.js:980:7)
at Object.<anonymous> (/home/gibello/DCR/D1.3/pkm-api/common.js:6:21)
at Module._compile (internal/modules/cjs/loader.js:1118:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1138:10)
at Module.load (internal/modules/cjs/loader.js:982:32)
at Function.Module._load (internal/modules/cjs/loader.js:875:14)
at Module.require (internal/modules/cjs/loader.js:1022:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (/home/gibello/DCR/D1.3/pkm-api/insert_doc_files.js:6:16) {
code: 'ERR_INVALID_ARG_TYPE'
}
```
When launched from PKM installation dir (insert_doc_files testdb /tmp/test.md), it works.Armand PUCCETTIArmand PUCCETTIhttps://gitlab.ow2.org/decoder/pkm-api/-/issues/9insert_source_files does not work from source code directory, only from pkm i...2020-05-15T07:51:55ZPierre-Yves Gibelloinsert_source_files does not work from source code directory, only from pkm install dirSuppose I have a source file called /tmp/test/mypackage/Test.c .
If I run insert_source_files from the pkm-api directory, as follows:
```
$ insert_source_files testdb /tmp/test/mypackage/Test.c
```
It works. But if I go in /tmp/test/m...Suppose I have a source file called /tmp/test/mypackage/Test.c .
If I run insert_source_files from the pkm-api directory, as follows:
```
$ insert_source_files testdb /tmp/test/mypackage/Test.c
```
It works. But if I go in /tmp/test/mypackage/ and call "insert_source_files testdb Test.c", the following error occurs:
```
/tmp/test/mypackage$ insert_source_files testdb Test.c
internal/validators.js:121
throw new ERR_INVALID_ARG_TYPE(name, 'string', value);
^
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
at validateString (internal/validators.js:121:11)
at Object.resolve (path.js:980:7)
at Object.<anonymous> (/home/gibello/DCR/D1.3/pkm-api/common.js:6:21)
at Module._compile (internal/modules/cjs/loader.js:1118:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1138:10)
at Module.load (internal/modules/cjs/loader.js:982:32)
at Function.Module._load (internal/modules/cjs/loader.js:875:14)
at Module.require (internal/modules/cjs/loader.js:1022:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (/home/gibello/DCR/D1.3/pkm-api/insert_source_files.js:7:16) {
code: 'ERR_INVALID_ARG_TYPE'
}
```
So, I can't insert source code from my source code directory, only from the PKM installation dir...Armand PUCCETTIArmand PUCCETTIhttps://gitlab.ow2.org/decoder/pkm-api/-/issues/8Inserting same doc file multiple times generated duplicates (and delete_doc_f...2020-05-15T08:23:19ZPierre-Yves GibelloInserting same doc file multiple times generated duplicates (and delete_doc_files deletes all)Running multiple times "insert_doc_file" on the same file inserts the file multiple times.
If there are changes in the file, they appear only in the last insertion (can be considered fine ?). But... delete_doc_files deletes all versions.Running multiple times "insert_doc_file" on the same file inserts the file multiple times.
If there are changes in the file, they appear only in the last insertion (can be considered fine ?). But... delete_doc_files deletes all versions.Armand PUCCETTIArmand PUCCETTIhttps://gitlab.ow2.org/decoder/pkm-api/-/issues/7Inserting same source file twice generates duplicate2021-02-12T20:45:46ZPierre-Yves GibelloInserting same source file twice generates duplicateIf you insert the same source file twice, you obtain 2 entries in RawSourceCode:
```
./insert_source_files testdb sourcecode.c
./insert_source_files testdb sourcecode.c
```
2 objects are included in the DB: the 2nd is a duplicate.If you insert the same source file twice, you obtain 2 entries in RawSourceCode:
```
./insert_source_files testdb sourcecode.c
./insert_source_files testdb sourcecode.c
```
2 objects are included in the DB: the 2nd is a duplicate.Armand PUCCETTIArmand PUCCETTIhttps://gitlab.ow2.org/decoder/pkm-api/-/issues/6PKM initialization ends with error message (and fails ?)2021-02-12T20:46:20ZPierre-Yves GibelloPKM initialization ends with error message (and fails ?)When running initialise_PKM as follows:
```
$ ./initialise_PKM ow2 testdb
```
the process ends with the following messages:
```
Roles created.
CMake Error: The source directory "/home/gibello/DCR/D1.3/pkm-api/doc/doc_to_asfm" does not...When running initialise_PKM as follows:
```
$ ./initialise_PKM ow2 testdb
```
the process ends with the following messages:
```
Roles created.
CMake Error: The source directory "/home/gibello/DCR/D1.3/pkm-api/doc/doc_to_asfm" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
```
Not sure the init successfully terminated, but it seems not (and at least ends with an error message).
OS: Ubuntu Linux 18.04Armand PUCCETTIArmand PUCCETTIhttps://gitlab.ow2.org/decoder/pkm-api/-/issues/5Add Git (or other) commit ID and remote URL to raw files metadata2020-05-20T11:24:58ZPierre-Yves GibelloAdd Git (or other) commit ID and remote URL to raw files metadataWhen raw files (eg. source files) are stored, the associated version-control metadata should be stored alongside.
In insert_source_files.js, a document is stored as follows in the RawSourcecode collection:
```
var document = { "filenam...When raw files (eg. source files) are stored, the associated version-control metadata should be stored alongside.
In insert_source_files.js, a document is stored as follows in the RawSourcecode collection:
```
var document = { "filename": val, "filecontent": content_string };
```
Additional attributes should be added, for example as follows:
```
var document = { "filename": val, "remoteUrl": url, "commitId": commitHash, "filecontent": content_string };
```
Remote URL can be obtained as follows (on a GIT repository):
```
$ git remote get-url origin
https://gitlab.ow2.org/gibello/decoder.git
```
Commit Hash can be obtained as follows (on a GIT repository):
```
$ git log -n 1 --pretty=format:%H -- src/main/java/eu/decoder/java8lexer/OW2JavaConverter.java
d6df2dfc58cf5f9672dde95f94ef51cc4b0db68f
```
These commands can be added to insert_source_files script in order to fill in corresponding parameter values for insert_source_files.js ? At least, if "git remote" returns something, then git metadata could be added by default.Pierre-Yves GibelloPierre-Yves Gibellohttps://gitlab.ow2.org/decoder/pkm-api/-/issues/4Suggestion on destructive scripts2021-02-08T10:31:28ZGaël de ChalendarSuggestion on destructive scriptsI suggest to add manual confirmation on destructive scripts like finalize and drop. There could be a optional parameter (-f ?) to force and avoid the confirmation.I suggest to add manual confirmation on destructive scripts like finalize and drop. There could be a optional parameter (-f ?) to force and avoid the confirmation.https://gitlab.ow2.org/decoder/pkm-api/-/issues/3Use of filename as index2021-02-12T20:44:37ZVirgile PrevostoUse of filename as indexCurrently, the Frama-C-related insertion and update scripts use filenames as index for various documents, notably to decide whether existing AST nodes should be superseded by new ones during an update. There are a few issues related to t...Currently, the Frama-C-related insertion and update scripts use filenames as index for various documents, notably to decide whether existing AST nodes should be superseded by new ones during an update. There are a few issues related to that.
- should those names be absolute or relative, and in the latter case, relative to what? If we start from the toplevel directory of the software project under analysis, there might be name clashes between projects, and between two versions of the same project. Having a symbolic name (e.g. project-version or project-git-id) as a prefix should provide an appropriate namespace, normalized among PKM users.
- similar question arises for the files that are part of Frama-C's own standard library. How should they be managed if we feed the PKM with different Frama-C versions?
- some nodes, generated by a plug-in for instance, have a dummy location, which cannot be used for referenceArmand PUCCETTIArmand PUCCETTIhttps://gitlab.ow2.org/decoder/pkm-api/-/issues/1Missing installation and usage instructions2020-04-15T10:50:08ZVirgile PrevostoMissing installation and usage instructionsThe README.md file is missing some important information about what needs to be present on the machine to run the scripts in the repository. Apparently:
- [Node.js](https://nodejs.org/en/) must be installed, together with its `Mongodb` ...The README.md file is missing some important information about what needs to be present on the machine to run the scripts in the repository. Apparently:
- [Node.js](https://nodejs.org/en/) must be installed, together with its `Mongodb` package
- scripts must be run in an environment where `PKMHOST` and `API` are set
- on a related note, `PKMHOST` is specified through an environment variable, the port to which the server is listening is hardcoded, and the name of the actual database should be given through a command-line parameter. This is quite confusing and should be unified.Armand PUCCETTIArmand PUCCETTI