tsantalis / RefactoringMiner

MIT License
358 stars 137 forks source link

Pass commit id as URL #756

Closed koppor closed 2 months ago

koppor commented 2 months ago
docker run --rm -p 6789:6789  -v c:\users\koppor\rmc:/diff tsantalis/refactoringminer diff --url https://github.com/JabRef/jabref/pull/11479/commits/5dbc4a3db88c2517c5c5d556405241ac26f06077

results in

Exception in thread "main" java.lang.RuntimeException: java.lang.NumberFormatException: For input string: "11479/commits/5dbc4a3db88c2517c5c5d556405241ac26f06077"
        at gui.webdiff.WebDiffRunner.execute(WebDiffRunner.java:74)
        at org.refactoringminer.RefactoringMiner.main(RefactoringMiner.java:49)
Caused by: java.lang.NumberFormatException: For input string: "11479/commits/5dbc4a3db88c2517c5c5d556405241ac26f06077"
        at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:67)
        at java.base/java.lang.Integer.parseInt(Integer.java:668)
        at java.base/java.lang.Integer.parseInt(Integer.java:786)
        at org.refactoringminer.astDiff.utils.URLHelper.getPullRequestID(URLHelper.java:58)
        at gui.webdiff.WebDiffRunner$RunMode.getProjectASTDIFF(WebDiffRunner.java:116)
        at gui.webdiff.WebDiffRunner.execute(WebDiffRunner.java:67)
        ... 1 more

Passing https://github.com/JabRef/jabref/pull/11476 works fine though.

tsantalis commented 2 months ago

@pouryafard75 We need to improve our url utils to handle PR commits, like https://github.com/JabRef/jabref/pull/11479/commits/5dbc4a3db88c2517c5c5d556405241ac26f06077

@koppor For the time being, you can pass the commit url as https://github.com/JabRef/jabref/commit/5dbc4a3db88c2517c5c5d556405241ac26f06077

tsantalis commented 2 months ago

@koppor The issue has been fixed. It will be possible to pass PR commit URLs from now on.