Comments (15)
Ok, so rest/api/1.0/projects/P2/repos/code/pull-requests/48/changes?limit=999999
seems to report all files changed. At least ListView.cpp is included.
However, your other request rest/api/1.0/projects/P2/repos/code/pull-requests/48/diff?limit=999999
indeed only returns the changes for the first 6 files. As said before, many files were renamed and Bitbucket treat them as removed and added, so the whole content of many files has to be retrieved by this request. Without the content of hunks
the json data looks like this:
{
"fromHash":"9ab4dd79061abe6552bff5506505493e38d19e77",
"toHash":"b7e95fdd339b9b8b98faa7a9a97b2600b761ecb6",
"contextLines":10,
"whitespace":"SHOW",
"diffs":[
{"source":
{"components":["pump","build","Makefile.common.gcc.mk"],"parent":"pump/build","name":"Makefile.common.gcc.mk","extension":"mk","toString":"pump/build/Makefile.common.gcc.mk"
},"destination":
{"components":["pump","build","Makefile.common.gcc.mk"],"parent":"pump/build","name":"Makefile.common.gcc.mk","extension":"mk","toString":"pump/build/Makefile.common.gcc.mk"
},"hunks":[]
},
{"source":
{"components":["pump","build","Makefile.common.iar.mk"],"parent":"pump/build","name":"Makefile.common.iar.mk","extension":"mk","toString":"pump/build/Makefile.common.iar.mk"
},"destination":
{"components":["pump","build","Makefile.common.iar.mk"],"parent":"pump/build","name":"Makefile.common.iar.mk","extension":"mk","toString":"pump/build/Makefile.common.iar.mk"
},"hunks":[]
},
{"source":
{"components":["pump","build","controller","Makefile.gcc.mk"],"parent":"pump/build/controller","name":"Makefile.gcc.mk","extension":"mk","toString":"pump/build/controller/Makefile.gcc.mk"
},"destination":
{"components":["pump","build","controller","Makefile.gcc.mk"],"parent":"pump/build/controller","name":"Makefile.gcc.mk","extension":"mk","toString":"pump/build/controller/Makefile.gcc.mk"
},"hunks":[]
},
{"source":
{"components":["pump","build","controller","Makefile.iar.mk"],"parent":"pump/build/controller","name":"Makefile.iar.mk","extension":"mk","toString":"pump/build/controller/Makefile.iar.mk"
},"destination":
{"components":["pump","build","controller","Makefile.iar.mk"],"parent":"pump/build/controller","name":"Makefile.iar.mk","extension":"mk","toString":"pump/build/controller/Makefile.iar.mk"
},"hunks":[]
},
{"source":
{"components":["pump","build","eclipse","GccController",".cproject"],"parent":"pump/build/eclipse/GccController","name":".cproject","extension":"cproject","toString":"pump/build/eclipse/GccController/.cproject"
},"destination":
{"components":["pump","build","eclipse","GccController",".cproject"],"parent":"pump/build/eclipse/GccController","name":".cproject","extension":"cproject","toString":"pump/build/eclipse/GccController/.cproject"
},"hunks":[]
},
{"source":
{"components":["pump","build","eclipse","GccServiceProvider",".cproject"],"parent":"pump/build/eclipse/GccServiceProvider","name":".cproject","extension":"cproject","toString":"pump/build/eclipse/GccServiceProvider/.cproject"
},"destination":
{"components":["pump","build","eclipse","GccServiceProvider",".cproject"],"parent":"pump/build/eclipse/GccServiceProvider","name":".cproject","extension":"cproject","toString":"pump/build/eclipse/GccServiceProvider/.cproject"
},"hunks":[]
}],
"truncated":true
}
So the "truncated":true
clearly means that not everything is sent. The question is how to retrieve all data by incremental requests or how to get the changed lines in another way.
from violation-comments-to-stash-plugin.
Releasing 1.90 now with a fix for this. Will now make rest calls for diff on each file.
Available in update center within a few hours.
Open issue again if not working!
from violation-comments-to-stash-plugin.
Looks like: tomasbjerre/violations-lib#40
Can you get rid of the relative paths?
from violation-comments-to-stash-plugin.
So the relative path of the compiler warning is transformed properly, by script in Jenkinsfile before the plugin parses it.
Do you mean the relative path from pump/and-so-on ? This is toplevel folder from repository, so I think this is correct.
from violation-comments-to-stash-plugin.
Try to make this:
../../source/gui/controls/ListView.cpp:39:61: warning: default argument given for parameter 2 of 'pfm::ListView::ListView(const PegRect&, PEGUINT)' [-fpermissive]
Change to:
pump/source/gui/controls/ListView.cpp:39:61: warning: default argument given for parameter 2 of 'pfm::ListView::ListView(const PegRect&, PEGUINT)' [-fpermissive]
from violation-comments-to-stash-plugin.
Yes, I do so, as written in both previous posts...
from violation-comments-to-stash-plugin.
Ok! I think it is something happening in this method: https://github.com/tomasbjerre/violation-comments-to-bitbucket-server-lib/blob/master/src/main/java/se/bjurr/violations/comments/bitbucketserver/lib/BitbucketServerCommentsProvider.java#L157
Returning false
when it should return true
in this case.
I guess you don't want to post the result of rest/api/1.0/projects/P2/repos/code/pull-requests/48/diff?limit=999999
here? But if you email it to me, I can try to reproduce it with a unit test.
from violation-comments-to-stash-plugin.
from violation-comments-to-stash-plugin.
The url returns the changes for the first 6 changed files only. Changes of the ListView.cpp are not included. I will try to retrieve the information and I will have a look to the code you pointed out.
from violation-comments-to-stash-plugin.
Only first 6 changed files!? This code will assume all files are retrieved, unless more than 999999 changed files.
from violation-comments-to-stash-plugin.
Possible fix might be to use bitbucket-rest: cdancy/bitbucket-rest#158
from violation-comments-to-stash-plugin.
@stoesselt Would you say this is a major issue? If it only happens for very big PR:s then maby it is just a minor.
from violation-comments-to-stash-plugin.
Perhaps an acceptable solution is to introduce logging when this happens, with a short explanation.
from violation-comments-to-stash-plugin.
I don't know what impact it has for the plugin when you declare this as a major. However, this issue makes me not to rely on the automatic comments anymore. I will check the Jenkins reports manually as workaround.
I doubt that this issue concerns only very big changes, but also medium changes. I mean, in my case I had hundreds of changed files. Nonetheless only 6 changed files were retrieved. Ok there were a lot of changes in these 6 files. But think of another case, where maybe the half of the change is retrieved and some comments are generated and the others not. I got distrustful because no comment at all was made. If some where added, I would believe the other files are ok, but oversee violations.
I followed your question on bitbucket-rest. It does not seem to be a solution.
- Is there a way to retrieve the changed lines somehow else from Bitbucket?
- Would it be an option to get the information from local git repository? I think this would break pull requests which cross repositories.
from violation-comments-to-stash-plugin.
It would be possible to get it from local repo, if it was always a merge commit to look at. But I think some people rebase source onto target or perhaps fast forward source to target... I think it may generate support issues.
I don't think you are using Maven or gradle, but I have made offline solutions for that:
- https://github.com/tomasbjerre/violations-maven-plugin
- https://github.com/tomasbjerre/violations-gradle-plugin
Perhaps a fix would be to change http://localhost:7990/bitbucket/rest/api/1.0/projects/PROJECT_1/repos/violations-test/pull-requests/1/diff
to several requests, one per file, like:
http://localhost:7990/bitbucket/rest/api/1.0/projects/PROJECT_1/repos/violations-test/pull-requests/1/diff/src/main/java/se/bjurr/violations/lib/example/MyClass.java
If you do rest/api/1.0/projects/P2/repos/code/pull-requests/48/diff/pump/source/gui/controls/ListView.cpp
you will probably not get a truncated response right?
from violation-comments-to-stash-plugin.
Related Issues (20)
- "Outdated" comments not deleted HOT 27
- Credentials not found error HOT 17
- NPE since v1.76 HOT 1
- Plugin doesnโt send comments to bitbucket HOT 17
- All violations related to one file in one comment HOT 7
- Escaped single quote characters in comments
- Allow INFO Files changed to include all scanned files HOT 1
- Violation plugin iterates over files not mentioned in report HOT 6
- NPE after deleting comments HOT 2
- Identify that detecting violations from console/stage output is not supported (directly) HOT 7
- To support Code Insights HOT 2
- INFO POST .../pull-requests/3/comments 400 HOT 5
- Add support for client certificate as credentials HOT 1
- Feature: ignore certain folders/paths/globs HOT 4
- Limit logging of files from Violations Lib HOT 5
- When files paths contains spaces in fails to report warnings HOT 1
- Jenkins agents becoming unresponsive during violations run HOT 3
- Report the "indent" level of an issue HOT 6
- warnings lost, or added as general comments HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from violation-comments-to-stash-plugin.