Comments (14)
The createCommentWithAllSingleFileComments (when set to true
) should create one comment per violation.
There is currently no option to not delete old comments.
from violation-comments-to-stash-plugin.
Hey, thanks for the answer.
I already tried to set createCommentWithAllSingleFileComments
to true but I got a single comment with all the violations on it. What value should I set to createSingleFileComments
? I had both set to true iirc.
Any plan to add the option to keep the previous comments?
from violation-comments-to-stash-plugin.
Here is where it happens:
https://github.com/tomasbjerre/violation-comments-lib/blob/master/src/main/java/se/bjurr/violations/comments/lib/CommentsCreator.java#L59
Sorry, it is the other one. Set createSingleFileComments
to true
to create individual comments.
from violation-comments-to-stash-plugin.
I already have it set to true and most of the time it works fine but for some violation it still create a file comment instead of a line comment:
The second comment should have been created on line 26 but instead was created as file comment.
step([
$class: 'ViolationsToBitbucketServerRecorder',
config: [
bitbucketServerUrl : 'https://xxxxx.com',
createCommentWithAllSingleFileComments: false,
createSingleFileComments : true,
commentOnlyChangedContent : false,
projectKey : "${PULL_REQUEST_TO_REPO_PROJECT_KEY}",
repoSlug : "${PULL_REQUEST_TO_REPO_SLUG}",
pullRequestId : "${PULL_REQUEST_ID}",
useUsernamePassword : false,
username : '',
password : '',
useUsernamePasswordCredentials : true,
usernamePasswordCredentialsId : 'mobile_ci',
minSeverity : 'INFO',
violationConfigs : [
[pattern: ".*/reports/lint-results-.*\\.xml\$", parser: 'ANDROIDLINT', reporter: "Lint ${flavor}"],
[pattern: ".*/checkstyle/.*\\.xml\$", parser: 'CHECKSTYLE', reporter: "Checkstyle ${flavor}"],
// [pattern: '.*/findbugsXml\\.xml$', parser: 'FINDBUGS', reporter: 'Findbugs'],
// [pattern: '.*/pmd\\.xml$', parser: 'PMD', reporter: 'PMD'],
]
]
])
from violation-comments-to-stash-plugin.
What you refer to as "a file comment" is the same thing as the first comment.
It is just that the first comment were on a part of the file that was changed in the PR and the second was not.
You can set commentOnlyChangedContent
to true
in order to only comment changed content. And also the commentOnlyChangedContentContext
to, perhaps, 2
in order to comment on violations that are reported in the near context of changed lines.
from violation-comments-to-stash-plugin.
Oh ok, this sound interesting. Can I ask you what is the value of the commentOnlyChangedContentContext
? Are those the number of lines above and below the violation (eg: line 29 +- 2 lines)? Is there a maximum value?
from violation-comments-to-stash-plugin.
yes. No maximum value.
from violation-comments-to-stash-plugin.
It doesn't seem to work, as you can see I changed something just 3 lines before the "legacy" violation but still it didn't create an in line comment, like it did for the new code:
This is the config I used:
createCommentWithAllSingleFileComments: false,
createSingleFileComments : true,
commentOnlyChangedContent : true,
commentOnlyChangedContentContext : 100,
from violation-comments-to-stash-plugin.
Looks good to me.
You introduced a violation on line 33. You have a context of 100 and line 29 is indeed withing that context.
You might be confused about how Bitbucket displays the violation on line 29, but that has nothing to do with the plugin. It is simply up to Bitbucket to display it like that.
from violation-comments-to-stash-plugin.
Ok I see, thanks for the answers :)
from violation-comments-to-stash-plugin.
Thank you :)
Can I vote for an option to not delete old comments :)?
The reason for this is, that developers always gets mails for the same issues :) (for every new commit in a PR)
from violation-comments-to-stash-plugin.
Sounds like you are asking for 2 new features
- Not deleting old comments
- Not commenting on the same violation again if old comment exists
from violation-comments-to-stash-plugin.
Hey :),
jupp you are completely right.
- Not deleting old comments (because of multiple flavors build in parallel)
- Not commenting on the same violation again if old comment exists
from violation-comments-to-stash-plugin.
Releasing it now. There is a new config parameter keepOldComments
that you will want to set to true
.
...
keepOldComments: true,
...
Open issue again if not working.
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
- Recognition of changed lines seems to not work correclty HOT 15
- 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.