Skip to content
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

No violations found when opening file on Windows #50

Open
domruf opened this issue May 7, 2014 · 1 comment
Open

No violations found when opening file on Windows #50

domruf opened this issue May 7, 2014 · 1 comment

Comments

@domruf
Copy link

domruf commented May 7, 2014

When running on windows and you try to open the page .../job/myjob/2/violations/file/path/to/myfile.py/
you get "No violations found"

The following patch fixes this.
But I don't really know the code and there my be some other places where this problem pops up. So there might be a better place/way to fix this properly.

diff -r 17567a8c09f2 src/main/java/hudson/plugins/violations/ViolationsReport.java
--- a/src/main/java/hudson/plugins/violations/ViolationsReport.java Wed Apr 16 20:21:26 2014 +0100
+++ b/src/main/java/hudson/plugins/violations/ViolationsReport.java Wed May 07 13:59:24 2014 +0200
@@ -211,7 +211,7 @@
if (name.startsWith("/")) {
name = name.substring(1);
}

  •    FileModelProxy proxy = getFileModelProxy(name);
    
  •    FileModelProxy proxy = getFileModelProxy(name.replace("/", File.separator));
     if (proxy != null) {
         return new RecurDynamic(
             "", name, proxy.build(build).contextPath(req.getContextPath()));
    
@pfhorman
Copy link

pfhorman commented Dec 4, 2015

I came across this issue as well while trying to parse results from subfolders in Windows. I think this is the best place to make the change, as the keys are all generated matching what is contained within the xml files and directory locations. I created pull request 81 for this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants