Git Product home page Git Product logo

Comments (17)

tomasbjerre avatar tomasbjerre commented on July 25, 2024

Are you sure that the lint_result.txt contains violations from the files that were changed in the pull request?
Are you sure they are of severity WARN or ERROR?

from violation-comments-to-stash-plugin.

lelik9 avatar lelik9 commented on July 25, 2024

Yes. Files mentioned in the lint_result.txt is present in a PR. And yamllint produce only error and warning severity.
Is it make sense absolute/relative path of files in a report?

from violation-comments-to-stash-plugin.

tomasbjerre avatar tomasbjerre commented on July 25, 2024

Yes relative paths msy be the problem.

See also: tomasbjerre/violations-lib#40

from violation-comments-to-stash-plugin.

lelik9 avatar lelik9 commented on July 25, 2024

Removed all relative path from the report, but this didn't help me.
Also I've checked what returned /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/diff for my PR.
It returns

"diffs":[{"source":null,"destination":{"components":["molecule-default","create.yml"],"parent":"molecule-default","name":"create.yml","extension":"yml","toString":"molecule-default/create.yml"},"hunks":[{"sourceLine":0,"sourceSpan":0,"destinationLine":1,"destinationSpan":134,"segments":[{"type":"ADDED","lines":[{"source":0,"destination":1,"line":"---","truncated":false},{"source":0,"destination":2,"line":"- name: Create","truncated":false},...

I've looked quickly into your code and as I understand it means that file is changed and comment will be send. Am I correct?
And in my report file present this file:

molecule-default/create.yml:6:89: [error] line too long (116 > 88 characters) (line-length)

from violation-comments-to-stash-plugin.

tomasbjerre avatar tomasbjerre commented on July 25, 2024

Releasing 1.82 now. It should give you some helpful information in the build log.

from violation-comments-to-stash-plugin.

lelik9 avatar lelik9 commented on July 25, 2024

Thanks for this release, it's very useful output information. I found out that plugin doesn't see any changed files. Could you please describe how does plugin detect which files were already changed or in what parts of the code I need to look, to understand how it works?

from violation-comments-to-stash-plugin.

tomasbjerre avatar tomasbjerre commented on July 25, 2024

That would be here in getFiles(): https://github.com/tomasbjerre/violation-comments-to-bitbucket-server-lib/blob/master/src/main/java/se/bjurr/violations/comments/bitbucketserver/lib/BitbucketServerCommentsProvider.java#L115

And that looks like this returns no files:
/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/changes?limit=999999

What does it return?

from violation-comments-to-stash-plugin.

lelik9 avatar lelik9 commented on July 25, 2024

It returns


{  
   "fromHash":"8d2fa6f0f6c5df46d3f63ef71df6f2a2af42ff55",
   "toHash":"cb2cdb92cc349b930082c796202a2680422ee9b8",
   "properties":{  
      "changeScope":"ALL"
   },
   "values":[  
      {  
         "contentId":"b1643800f179e7c28213b17f1bfc5b02ec96d13a",
         "fromContentId":"0000000000000000000000000000000000000000",
         "path":{  
            "components":[  
               "molecule-default",
               "create.yml"
            ],
            "parent":"molecule-default",
            "name":"create.yml",
            "extension":"yml",
            "toString":"molecule-default/create.yml"
         },
         "executable":false,
         "percentUnchanged":-1,
         "type":"ADD",
         "nodeType":"FILE",
         "links":{  
            "self":[  
               null
            ]
         },
         "properties":{  
            "gitChangeType":"ADD"
         }
      },...

from violation-comments-to-stash-plugin.

tomasbjerre avatar tomasbjerre commented on July 25, 2024

I'm releasing 1.83 now with some more logging.

from violation-comments-to-stash-plugin.

lelik9 avatar lelik9 commented on July 25, 2024

Thank you. The problem was in that the plugin didn't get a proper response.
I recieved DNS error:


2018-09-19 08:54:34 <html><head><title>502 Bad Gateway</title></head>
2018-09-19 08:54:34 <body><h1>DNS error</h1>
2018-09-19 08:54:34 <p>DNS error (the host name of the page you are looking for does not exist)<br><br>Please check that the host name has been spelled correctly.<br></p>

And this is quite strange, because before executing this step I do a request to the same DNS name with HTTPrequest plugin and get proper response.

from violation-comments-to-stash-plugin.

tomasbjerre avatar tomasbjerre commented on July 25, 2024

Ok. What does the build log look like now? Is this problem obvious for anyone looking at the build log?

Do you still think this might be a problem with the plugin?

from violation-comments-to-stash-plugin.

lelik9 avatar lelik9 commented on July 25, 2024

Log looks awesome, currently it is really easier to investigate a problem. I think might be good for each request write to the log: request URL, headers, response code and response body. It's very useful info for debugging.
Unfortunately I think a problem might be in the plugin, because I used HTTP request in the same job and step to request the same URL, and got proper response.

from violation-comments-to-stash-plugin.

tomasbjerre avatar tomasbjerre commented on July 25, 2024

Are you using nodes? Or running everything on master node? And are you making that request on same node as the plugin is running on?

from violation-comments-to-stash-plugin.

lelik9 avatar lelik9 commented on July 25, 2024

I use separate build node, but all steps run on the same node

from violation-comments-to-stash-plugin.

tomasbjerre avatar tomasbjerre commented on July 25, 2024

One guess is that it could be that the plugin is using a proxy. If you have a proxy configured in Jenkins the plugin will pick it up and use it.

There is no logging saying that the proxy is used. But there is logging saying that is is not used. So if you don't see any Not using proxy in the build log, the plugin is using a proxy.

from violation-comments-to-stash-plugin.

lelik9 avatar lelik9 commented on July 25, 2024

Yep, that was a problem! Thank you for your help!
Could you please add in the log information about proxy if it used.

from violation-comments-to-stash-plugin.

tomasbjerre avatar tomasbjerre commented on July 25, 2024

Yes adding that!

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.