Git Product home page Git Product logo

Comments (6)

tomasbjerre avatar tomasbjerre commented on September 23, 2024

Did you perform the merge into target before analysis was done?

from violation-comments-to-stash-plugin.

churowa avatar churowa commented on September 23, 2024

Hi Tomas, thank you for taking the time to ask!

I don't believe I did. I'm honestly not sure, unless it's something that Bitbucket Server/Jenkins is doing in the background.

What I have is mostly static analysis, but I'm hoping to use the plugin to comment on my pull request.

Essentially, my Jenkinsfile:

  • Builds the codebase
  • Runs OCLint static analysis, generating a PMD-formatted report (oclint.log)
  • Runs the Violation Comments to Bitbucket Server plugin to (hopefully) post the results back to the PR as comments.

I should note that the plugin is working with another file I have containing the build log (output.clang). So the CLANG parser is commenting on my PR, but the PMD parser is not.

from violation-comments-to-stash-plugin.

churowa avatar churowa commented on September 23, 2024

Found 0 violations from ViolationConfig [pattern=.*/oclint\.log$, reporter=Pmd, parser=PMD]

I think that the oclint.log file is properly formatted PMD-style output. I may be wrong. Looking at the test code in Violations Lib, I think it looks most similar to the PHPMD version, but it's missing a timestamp.

I'm sorry. I know I'm not being terribly helpful, I'm learning as I go.

But I have spent a lot of time debugging how the plugin is used, through the other result file I have that does work (output.clang). I had to generate that file by hand, through trial and error, from some json output from xcpretty.

from violation-comments-to-stash-plugin.

tomasbjerre avatar tomasbjerre commented on September 23, 2024

You must first perform the merge. Something like:

 stage('Merge') {
  sh "git init"
  sh "git fetch --no-tags --progress git@git:group/reponame.git +refs/heads/*:refs/remotes/origin/* --depth=200"
  sh "git checkout origin/${env.targetBranch}"
  sh "git merge origin/${env.sourceBranch}"
  sh "git log --graph --abbrev-commit --max-count=10"
 }

If the merge is note performed before analysis, then the reported lines will not match the lines in the PR. And no violations will be reported.

from violation-comments-to-stash-plugin.

churowa avatar churowa commented on September 23, 2024

Ahh, that makes a lot of sense! Maybe that's my problem.

I will try and do this. Honestly, I thought that because I was checking out the PR branch from Bitbucket Server that it was merged. My mistake. I'll close this once I get it working.

Thanks Tomas

from violation-comments-to-stash-plugin.

tomasbjerre avatar tomasbjerre commented on September 23, 2024

This might have been solved with tomasbjerre/violations-lib#27

from violation-comments-to-stash-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.