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

Make CommitsComparison.files() return typed objects instead of raw JSON #1120

Merged
merged 1 commit into from
Jun 16, 2015
Merged

Make CommitsComparison.files() return typed objects instead of raw JSON #1120

merged 1 commit into from
Jun 16, 2015

Conversation

cvrebert
Copy link
Contributor

Fixes #1082 by adding a FileChange interface and having CommitsComparison.files() return an Iterator<FileChange> instead of a raw JsonArray.


@Override
public FileChange next() {
return new RtFileChange(this.iterator.next());
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FindBugs currently gives a false-positive warning here:

[WARNING] FindBugs: L B It: com.jcabi.github.RtCommitsComparison$FileChangesIterator.next() can't throw NoSuchElementException  At RtCommitsComparison.java:[line 134]

I don't know how to tell qulice to suppress this.

More info on this particular warning: http://findbugs.sourceforge.net/bugDescriptions.html#IT_NO_SUCH_ELEMENT

Adding an explicit if (!this.iterator.hasNext()) { throw new NoSuchElementException("No more file changes!"); } didn't make the warning go away.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cvrebert You should be able to use the SuppressFBWarnings annotation: @SuppressFBWarnings("IT_NO_SUCH_ELEMENT")

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@carlosmiranda Done. Thanks!

@dmarkov
Copy link

dmarkov commented Jun 12, 2015

@cvrebert Thanks, I will find someone to review this PR soon

@dmarkov
Copy link

dmarkov commented Jun 12, 2015

@carlosmiranda please review this PR

@EqualsAndHashCode(of = { "list" })
@Loggable(Loggable.DEBUG)
@ToString
private static final class FileChangesIterable
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cvrebert Let's name this class, simply, FileChanges.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@carlosmiranda
Copy link
Contributor

@cvrebert Good branch, just some minor comments.

This diff is huge, however. You could have left some of it (e.g. the IT cases) as puzzles instead of implementing everything in one go. Makes things easier to review (and we typically have task budgets of 30min). No need for now, but do keep it in mind next time.

@cvrebert
Copy link
Contributor Author

@carlosmiranda I've made all of your requested changes.

@carlosmiranda
Copy link
Contributor

@rultor merge please

@rultor
Copy link
Contributor

rultor commented Jun 12, 2015

@rultor merge please

@carlosmiranda Thanks for your request. @yegor256 Please confirm this.

@carlosmiranda
Copy link
Contributor

@cvrebert Please edit PR title to something more descriptive.

@cvrebert cvrebert changed the title Fix #1082 Make CommitsComparison.files() return typed objects instead of raw JSON Jun 12, 2015
@cvrebert
Copy link
Contributor Author

@carlosmiranda Done.

@@ -145,6 +145,11 @@
<artifactId>validation-api</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>annotations</artifactId>
<version>3.0.0</version>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cvrebert can we find some other workaround? I really don't like the idea of adding this dependency to the "compile" scope

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yegor256 Does the FindBugs Qulice Maven plugin provide a way to configure exclusions?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cvrebert check this: http://stackoverflow.com/questions/30702059/how-to-ignore-or-fix-the-duplicate-classes-warning-in-qulice/30814032#30814032 you can completely suppress findbugs, just by using <exclusion>findbugs:.*</exclusion>, but I don't think it's a good idea.. maybe let's do what findbugs is asking us to do?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe let's do what findbugs is asking us to do?

@yegor256 Tried that, still warns. It's a genuine false positive; see #1120 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FindBugs itself allows for more granular suppression via XML filter files (http://findbugs.sourceforge.net/manual/filter.html), but I don't think Qulice currently supports this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yegor256 Ok, turns out @Loggable is the cause of the false positive, so I just removed it; see ff93dec

@yegor256
Copy link
Member

@cvrebert see my comment above

@cvrebert
Copy link
Contributor Author

@rultor merge

@rultor
Copy link
Contributor

rultor commented Jun 14, 2015

@rultor merge

@cvrebert Thanks for your request. @yegor256 Please confirm this.

@cvrebert
Copy link
Contributor Author

@rultor merge

@rultor
Copy link
Contributor

rultor commented Jun 15, 2015

@rultor merge

@cvrebert Thanks for your request. @yegor256 Please confirm this.

@yegor256
Copy link
Member

@rultor merge

@rultor
Copy link
Contributor

rultor commented Jun 15, 2015

@rultor merge

@yegor256 OK, I'll try to merge now. You can check the progress of the merge here

@rultor
Copy link
Contributor

rultor commented Jun 15, 2015

@rultor merge

@yegor256 Oops, I failed. You can see the full log here (spent 3min)

[INFO] [INFO] Finished at: 2015-06-15T21:03:26+00:00
[INFO] [INFO] Final Memory: 17M/219M
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [WARNING] The requested profile "qulice" could not be activated because it does not exist.
[INFO] ..SUCCESS (6.9 s)
[INFO] -------------------------------------------------
[INFO] Build Summary:
[INFO]   Passed: 2, Failed: 0, Errors: 0, Skipped: 0
[INFO] -------------------------------------------------
[INFO] 
[INFO] --- maven-failsafe-plugin:2.17:verify (default) @ jcabi-github ---
[INFO] Failsafe report directory: /home/r/repo/target/failsafe-reports
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:20 min
[INFO] Finished at: 2015-06-15T21:03:26+00:00
[INFO] Final Memory: 51M/469M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-failsafe-plugin:2.17:verify (default) on project jcabi-github: There are test failures.
[ERROR] 
[ERROR] Please refer to /home/r/repo/target/failsafe-reports for the individual test results.
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-failsafe-plugin:2.17:verify (default) on project jcabi-github: There are test failures.

Please refer to /home/r/repo/target/failsafe-reports for the individual test results.
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:347)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:154)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoFailureException: There are test failures.

Please refer to /home/r/repo/target/failsafe-reports for the individual test results.
    at org.apache.maven.plugin.surefire.SurefireHelper.reportExecution(SurefireHelper.java:82)
    at org.apache.maven.plugin.failsafe.VerifyMojo.execute(VerifyMojo.java:194)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
    ... 19 more
[ERROR] 
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

@cvrebert
Copy link
Contributor Author

@yegor256 Hmm, there's some problem with my integration test. Will investigate.

@cvrebert
Copy link
Contributor Author

@yegor256 Fixed. I had base and head swapped in my test.

@carlosmiranda
Copy link
Contributor

@cvrebert Please edit your comments so that it addresses somebody, e.g.

@carlosmiranda Hmmm, there's some problem...

Otherwise QA will be hounding us. :)

@rultor
Copy link
Contributor

rultor commented Jun 16, 2015

@rultor merge

@cvrebert Thanks for your request. @yegor256 Please confirm this.

@yegor256
Copy link
Member

@rultor merge

@rultor
Copy link
Contributor

rultor commented Jun 16, 2015

@rultor merge

@yegor256 OK, I'll try to merge now. You can check the progress of the merge here

@rultor
Copy link
Contributor

rultor commented Jun 16, 2015

@rultor merge

@yegor256 Oops, I failed. You can see the full log here (spent 6min)

[INFO] [INFO] Finished at: 2015-06-16T04:32:39+00:00
[INFO] [INFO] Final Memory: 15M/391M
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [WARNING] The requested profile "qulice" could not be activated because it does not exist.
[INFO] ..SUCCESS (12.9 s)
[INFO] -------------------------------------------------
[INFO] Build Summary:
[INFO]   Passed: 2, Failed: 0, Errors: 0, Skipped: 0
[INFO] -------------------------------------------------
[INFO] 
[INFO] --- maven-failsafe-plugin:2.17:verify (default) @ jcabi-github ---
[INFO] Failsafe report directory: /home/r/repo/target/failsafe-reports
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:07 min
[INFO] Finished at: 2015-06-16T04:32:39+00:00
[INFO] Final Memory: 46M/453M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-failsafe-plugin:2.17:verify (default) on project jcabi-github: There are test failures.
[ERROR] 
[ERROR] Please refer to /home/r/repo/target/failsafe-reports for the individual test results.
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-failsafe-plugin:2.17:verify (default) on project jcabi-github: There are test failures.

Please refer to /home/r/repo/target/failsafe-reports for the individual test results.
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:347)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:154)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoFailureException: There are test failures.

Please refer to /home/r/repo/target/failsafe-reports for the individual test results.
    at org.apache.maven.plugin.surefire.SurefireHelper.reportExecution(SurefireHelper.java:82)
    at org.apache.maven.plugin.failsafe.VerifyMojo.execute(VerifyMojo.java:194)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
    ... 19 more
[ERROR] 
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

@cvrebert
Copy link
Contributor Author

@cvrebert Failures are unrelated:

RtMilestonesITCase.iteratesIssues:96 HTTP response status is not equal to 201: 400 Bad Request [https://api.github.com/repos/jcabi-github-test2/geYKW69lheCr6JiDJLIj/milestones]
[...]
RtContentsITCase.throwsWhenTryingToGetAnAbsentContent Expected exception: java.lang.AssertionError

@cvrebert
Copy link
Contributor Author

@rultor merge

@rultor
Copy link
Contributor

rultor commented Jun 16, 2015

@rultor merge

@cvrebert Thanks for your request. @yegor256 Please confirm this.

@carlosmiranda
Copy link
Contributor

@cvrebert Please, always address your messages. See www.teamed.io/qa.html.

@cvrebert
Copy link
Contributor Author

@carlosmiranda Do my comments affect your compensation as code-reviewer?

@carlosmiranda
Copy link
Contributor

@cvrebert QA will ask you to correct them before I get paid so I might as well ask you to fix them now.

@cvrebert
Copy link
Contributor Author

@carlosmiranda I have never seen QA on jcabi-github.

@carlosmiranda
Copy link
Contributor

@cvrebert Not sure about it, but it's good practice. Anyway let's wait for @yegor256 to confirm merge.

@cvrebert
Copy link
Contributor Author

@rultor merge

@rultor
Copy link
Contributor

rultor commented Jun 16, 2015

@rultor merge

@cvrebert Thanks for your request. @yegor256 Please confirm this.

@yegor256
Copy link
Member

@rultor merge pls

@rultor
Copy link
Contributor

rultor commented Jun 16, 2015

@rultor merge pls

@yegor256 OK, I'll try to merge now. You can check the progress of the merge here

@rultor
Copy link
Contributor

rultor commented Jun 16, 2015

@rultor merge pls

@yegor256 Oops, I failed. You can see the full log here (spent 4min)

[INFO] [INFO] Finished at: 2015-06-16T19:46:26+00:00
[INFO] [INFO] Final Memory: 17M/219M
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [WARNING] The requested profile "qulice" could not be activated because it does not exist.
[INFO] ..SUCCESS (7.6 s)
[INFO] -------------------------------------------------
[INFO] Build Summary:
[INFO]   Passed: 2, Failed: 0, Errors: 0, Skipped: 0
[INFO] -------------------------------------------------
[INFO] 
[INFO] --- maven-failsafe-plugin:2.17:verify (default) @ jcabi-github ---
[INFO] Failsafe report directory: /home/r/repo/target/failsafe-reports
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:25 min
[INFO] Finished at: 2015-06-16T19:46:26+00:00
[INFO] Final Memory: 47M/468M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-failsafe-plugin:2.17:verify (default) on project jcabi-github: There are test failures.
[ERROR] 
[ERROR] Please refer to /home/r/repo/target/failsafe-reports for the individual test results.
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-failsafe-plugin:2.17:verify (default) on project jcabi-github: There are test failures.

Please refer to /home/r/repo/target/failsafe-reports for the individual test results.
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:347)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:154)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoFailureException: There are test failures.

Please refer to /home/r/repo/target/failsafe-reports for the individual test results.
    at org.apache.maven.plugin.surefire.SurefireHelper.reportExecution(SurefireHelper.java:82)
    at org.apache.maven.plugin.failsafe.VerifyMojo.execute(VerifyMojo.java:194)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
    ... 19 more
[ERROR] 
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

@cvrebert
Copy link
Contributor Author

@carlosmiranda Error is still unrelated:

Failed tests: RtContentsITCase.canUpdateFileContentInSpecificBranch:146 HTTP response status is not equal to 200: 404 Not Found [https://api.github.com/repos/jcabi-github-test2/nDIUOHVx1kH1wNs3lD4c/contents/9AX6g4vD9s]
[...]
Tests run: 116, Failures: 1, Errors: 0, Skipped: 5

@cvrebert
Copy link
Contributor Author

@rultor merge

@rultor
Copy link
Contributor

rultor commented Jun 16, 2015

@rultor merge

@cvrebert Thanks for your request. @yegor256 Please confirm this.

@yegor256
Copy link
Member

@rultor try to merge

@rultor
Copy link
Contributor

rultor commented Jun 16, 2015

@rultor try to merge

@yegor256 OK, I'll try to merge now. You can check the progress of the merge here

@rultor rultor merged commit e07d614 into jcabi:master Jun 16, 2015
@cvrebert cvrebert deleted the fix-1082-CommitsComparison branch June 16, 2015 20:41
@rultor
Copy link
Contributor

rultor commented Jun 16, 2015

@rultor try to merge

@yegor256 Done! FYI, the full log is here (took me 11min)

@dmarkov
Copy link

dmarkov commented Jun 18, 2015

@carlosmiranda 22 mins sent to your balance (ID 59482840), many thanks! It took 117 hours and 26 mins.. you're getting extra minutes here (c=7). +22 to your rating, your total score is +4111

@dmarkov
Copy link

dmarkov commented Jun 18, 2015

@rultor deploy

@rultor
Copy link
Contributor

rultor commented Jun 18, 2015

@rultor deploy

@dmarkov OK, I'll try to deploy now. You can check the progress here

@rultor
Copy link
Contributor

rultor commented Jun 18, 2015

@rultor deploy

@dmarkov Done! FYI, the full log is here (took me 7min)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants