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

Fix bugs around comment files #45

Closed
wants to merge 1 commit into from
Closed

Fix bugs around comment files #45

wants to merge 1 commit into from

Conversation

ekuefler
Copy link

Message typo and != comparison on a string

Message typo and != comparison on a string
@ekuefler
Copy link
Author

I'm seeing the "!!! Couldn't read commit file !!!" line appear in every one of the automated github comments even though I don't have a comment file specified - hoping this will fix it.

@cloudbees-pull-request-builder

plugins » ghprb-plugin #142 SUCCESS
This pull request looks good

@jenkinsadmin
Copy link
Member

Thank you for a pull request! Please check this document for how the Jenkins project handles pull requests

@JustinAiken
Copy link

👍

For now I'm just manually deleting the commentFilePath key from the job's config.xml...

@ekuefler
Copy link
Author

Can this be merged? I suspect this is going to be causing issues for a lot of people as they update.

@DavidTanner
Copy link
Contributor

I can't believe I did that. Have you tested this out? I am assuming it is right, but I will test it and see if I can add the patch today to 14-7

@DavidTanner
Copy link
Contributor

Merged into master.

@erikxperiel
Copy link

I'm not sure how to test plugins locally so I didn't try it out, but I'm pretty sure it won't make things worse :)

@smoll
Copy link

smoll commented Nov 4, 2014

I'm having trouble specifying a file I know exists. Here's what it says in the console log

java.io.FileNotFoundException: File 'build/logs/github_comment_file.txt' does not exist
    at org.apache.commons.io.FileUtils.openInputStream(FileUtils.java:299)
    at org.apache.commons.io.FileUtils.readFileToString(FileUtils.java:1711)
    at org.apache.commons.io.FileUtils.readFileToString(FileUtils.java:1748)
    at org.jenkinsci.plugins.ghprb.GhprbBuilds.onCompleted(GhprbBuilds.java:135)
    at org.jenkinsci.plugins.ghprb.GhprbBuildListener.onCompleted(GhprbBuildListener.java:27)
    at org.jenkinsci.plugins.ghprb.GhprbBuildListener.onCompleted(GhprbBuildListener.java:12)
    at hudson.model.listeners.RunListener.fireCompleted(RunListener.java:199)
    at hudson.model.Run.execute(Run.java:1810)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:89)
    at hudson.model.Executor.run(Executor.java:240)

when I specify the path as build/logs/github_comment_file.txt or even $WORKSPACE/build/logs/github_comment_file.txt, even though when I look at the workspace in Jenkins the file definitely exists...

I tried to write a string to file and read that same string as a test: https://github.com/smoll/ghprb-plugin/compare/comment_file?expand=1

but when I compile the plugin and test this it fails with the following:

java.io.FileNotFoundException: test.txt (Permission denied)
    at java.io.FileOutputStream.open(Native Method)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:212)
    at org.apache.commons.io.FileUtils.openOutputStream(FileUtils.java:367)
    at org.apache.commons.io.FileUtils.writeStringToFile(FileUtils.java:1928)
    at org.apache.commons.io.FileUtils.writeStringToFile(FileUtils.java:1962)
    at org.jenkinsci.plugins.ghprb.GhprbBuilds.onCompleted(GhprbBuilds.java:137)
    at org.jenkinsci.plugins.ghprb.GhprbBuildListener.onCompleted(GhprbBuildListener.java:27)
    at org.jenkinsci.plugins.ghprb.GhprbBuildListener.onCompleted(GhprbBuildListener.java:12)
    at hudson.model.listeners.RunListener.fireCompleted(RunListener.java:199)
    at hudson.model.Run.execute(Run.java:1810)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:89)
    at hudson.model.Executor.run(Executor.java:240)

which seems to me like the plugin is not even looking in the workspace directory at all. Any ideas on how I can debug this further? Sorry if this is the wrong place to ask this question.

@DavidTanner
Copy link
Contributor

Could you actually open a new issue, and tell me which version you are using? Are you sure the file exists at that point?

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

Successfully merging this pull request may close these issues.

None yet

7 participants