Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to view results? #355

Closed
Alberth289346 opened this issue Apr 7, 2022 · 6 comments
Closed

How to view results? #355

Alberth289346 opened this issue Apr 7, 2022 · 6 comments
Assignees
Labels
question A question, so neither a bug nor a enhancement proposal. report-viewer PR / Issue deals (partly) with the report viewer and thus involves web-dev technologies

Comments

@Alberth289346
Copy link
Contributor

Alberth289346 commented Apr 7, 2022

Maintainer's note: If you just want to use the report viewer, head over to jplag.github.io/JPlag

Original issue:

Working around #354 by manually creating the missing directories in result, JPlag finishes successfully.

That gives me:

$ ls -RF result
result:
2018-101/  overview.json

result/2018-101:
merged.cif-2018-102/

result/2018-101/merged.cif-2018-102:
merged.cif.json

No index.html to start viewing results, no instructions at the website. What next?

Guessing I need the report-viewer in some way:

$ cd report-viewer

$ npm install
npm install
npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it!
npm WARN vue-draggable-next@2.1.1 requires a peer of sortablejs@^1.14.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

audited 1046 packages in 12.738s

122 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
# Replaced my home-directory path with ~ below.
$ npm run build
> report-viewer@0.1.0 build ~/work/gitlab_tue/boost/jplag-hacking/report-viewer
> vue-cli-service build

 ERROR  You are using Node v10.19.0, but vue-cli-service requires Node ^12.0.0 || >= 14.0.0.
        Please upgrade your Node version.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! report-viewer@0.1.0 build: `vue-cli-service build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the report-viewer@0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     ~/.npm/_logs/2022-04-07T11_09_01_908Z-debug.log

For completeness, the log output from the above mentioned file

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'build' ]
2 info using npm@6.14.4
3 info using node@v10.19.0
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle report-viewer@0.1.0~prebuild: report-viewer@0.1.0
6 info lifecycle report-viewer@0.1.0~build: report-viewer@0.1.0
7 verbose lifecycle report-viewer@0.1.0~build: unsafe-perm in lifecycle true
8 verbose lifecycle report-viewer@0.1.0~build: PATH: /usr/share/npm/node_modules/npm-lifecycle/node-gyp-bin:~/work/gitlab_tue/boost/jplag-hacking/report-viewer/node_modules/.bin:~/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
9 verbose lifecycle report-viewer@0.1.0~build: CWD: ~/work/gitlab_tue/boost/jplag-hacking/report-viewer
10 silly lifecycle report-viewer@0.1.0~build: Args: [ '-c', 'vue-cli-service build' ]
11 silly lifecycle report-viewer@0.1.0~build: Returned: code: 1  signal: null
12 info lifecycle report-viewer@0.1.0~build: Failed to exec build script
13 verbose stack Error: report-viewer@0.1.0 build: `vue-cli-service build`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/usr/share/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:198:13)
13 verbose stack     at ChildProcess.<anonymous> (/usr/share/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:198:13)
13 verbose stack     at maybeClose (internal/child_process.js:982:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid report-viewer@0.1.0
15 verbose cwd ~/work/gitlab_tue/boost/jplag-hacking/report-viewer
16 verbose Linux 5.4.0-107-generic
17 verbose argv "/usr/bin/node" "/usr/bin/npm" "run" "build"
18 verbose node v10.19.0
19 verbose npm  v6.14.4
20 error code ELIFECYCLE
21 error errno 1
22 error report-viewer@0.1.0 build: `vue-cli-service build`
22 error Exit status 1
23 error Failed at the report-viewer@0.1.0 build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
@tsaglam
Copy link
Member

tsaglam commented Apr 7, 2022

We currently have not integrated the doc in the wiki yet, for now, you can refer to:
cholakov11#2, cholakov11#3, and cholakov11#4. If that does not help I refer to @sebinside.

@tsaglam tsaglam added the question A question, so neither a bug nor a enhancement proposal. label Apr 7, 2022
@sebinside
Copy link
Member

From having a look at error log, this indicates that you must update your local NodeJS version (the current LTS version is 16.14).

ERROR  You are using Node v10.19.0, but vue-cli-service requires Node ^12.0.0 || >= 14.0.0.
        Please upgrade your Node version.

Besides that, npm install and npm run serve or npm run build should be sufficient. Alternatively, with every push to the main branch of JPlag, the report-viewer gets deployed to GitHub Pages.

In future versions, a bundle with all required files will be created also locally. We'll add this and also #354 to the task lists for the first release with the new viewer.

@sebinside sebinside added the report-viewer PR / Issue deals (partly) with the report viewer and thus involves web-dev technologies label Apr 7, 2022
@Alberth289346
Copy link
Contributor Author

Alberth289346 commented Apr 7, 2022

Many thanks!

As I have no idea what "updating NodeJS" means concretely, I opted for the deployed version that you linked to.

I created a zip with

$ unzip -l x.zip
Archive:  x.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
   175814  2022-04-07 13:57   m1.cif-m2.cif.json
      517  2022-04-07 13:57   overview.json
---------                     -------
   176331                     2 files

This is ok, as I just had 2 files, so one comparison.

I dropped the x.zip in the GH page, and it opened to an overview page stating 34% overlap.
Screenshot from 2022-04-07 14-11-36

Clicking at the top-right, and then manually opening both files gave me this (only the top part, as the files are long):
Screenshot from 2022-04-07 14-14-14

I can scroll both files up and down and left and right, but I couldn't see any indication of the 34% overlap.

I also noticed the display contracts eg >= to . Cif however is a pure ASCII language, in the input will throw a parse error. I would suggest not to do that or make it a toggle option.

To do it correctly you would need the underlying token structure. Eg imagine a language where x<a>=17 is allowed syntax, X<a≥17 is something very different.

EDIT: Line numbers in both files are off-by-1, JPlag defines the first line as 1.

@sebinside
Copy link
Member

Yes, we currently use a version of JetBrains Mono that has such characters. This will be replaced in a future version. Also a good hint with the line numbers being off, I will add that to the (already quite long) list of changes that shall be done until version 4.

Regarding the display of overlaps: Have a look at the blue bar on the left side, there is a (currently not very visible, we're aware of that) view that gives you more information. However, it should also be visible in the code. Could you please investigate whether there are errors in the developer console (e.g., in chrome and edge on windows opened with ctrl + shift + J). We already discovered this display bug but did not find its cause yet.

@Alberth289346
Copy link
Contributor Author

I missed the left vertical bar as it had no ">>" signs on it. As a suggestion, perhaps also allow clicking at any other place at the bar (also for opening the files), Having to "precisely" click the signs is somewhat annoying.

I opened the web developer tools (firefox 99.0), mint-001 1.00 edition (part of the Linux Mint LTS 20 distribution). Just opening the GH page gacve the following error:
Screenshot from 2022-04-11 18-48-18

The bottom "went out of scope" error seems to happen when you move the mouse over and out the window (which then loses focus as my mouse defines the focus), so that is harmless I think.

I also have a long error when clicking (I think in the left file view). Top-part dump:
Screenshot from 2022-04-11 18-52-25

and bottom part (the "P" line is shown in both parts)
Screenshot from 2022-04-11 18-51-47

A similar long error happens when you click in the comparison window at the left (after opening it). Just the top part this time (looking at the error message again I now realize this image may be too short):
Screenshot from 2022-04-11 18-55-48

And last but not least, I noticed "-1" values in the latter view, which is wrong as I was pretty sure my scanner does produce line and column information :p
So I checked by dumping the 5 first tokens of each file, and at the bottom-right the first matched token in the comparison json file:

Screenshot from 2022-04-11 19-48-30

You can see the parse does produce the tokens with the information. Hacked Submission.java file:

// Line 171
        tokenList = language.parse(submissionRootFile, relativeFilePaths);
        System.out.printf("Parsed file %s, %d tokens%n", submissionRootFile.toString(), tokenList.size());
        for (int i = 0; i < 5 && i < tokenList.size(); i++) {
            System.out.printf("Token %d: %s%n", i, tokenList.getToken(i).toString());
        }
        System.out.printf("%n");

        if (!language.hasErrors()) {

@sebinside
Copy link
Member

Thank you for the detailed report, we'll have a look at it in #357.

@jplag jplag locked and limited conversation to collaborators Nov 11, 2022
@tsaglam tsaglam converted this issue into discussion #783 Nov 11, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
question A question, so neither a bug nor a enhancement proposal. report-viewer PR / Issue deals (partly) with the report viewer and thus involves web-dev technologies
Projects
None yet
Development

No branches or pull requests

3 participants