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

Implement partially WalletsIn.create #55

Merged
merged 1 commit into from
Aug 8, 2018

Conversation

victornoel
Copy link
Contributor

This is for #12:

  • this covers Wallet creation but not the content of the file
  • wrote many tests (one is ignored and has a corresponding @todo)
  • introduced 3 @todos to continue the work

@0crat 0crat added the scope label Jul 29, 2018
@0crat
Copy link
Collaborator

0crat commented Jul 29, 2018

Job #55 is now in scope, role is REV

@0crat
Copy link
Collaborator

0crat commented Jul 29, 2018

Job #55 is already in scope

@0crat
Copy link
Collaborator

0crat commented Jul 30, 2018

This pull request #55 is assigned to @carlosmiranda/z, here is why; the budget is 15 minutes, see §4; please, read §27 and when you decide to accept the changes, inform @llorllale/z (the architect) right in this ticket; if you decide that this PR should not be accepted ever, also inform the architect; this blog post will help you understand what is expected from a code reviewer; there will be a monetary reward for this job

Copy link
Contributor

@carlosmiranda carlosmiranda left a comment

Choose a reason for hiding this comment

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

@victornoel see comments

}

@Test
public void createsWalletInWallets() throws IOException {
Copy link
Contributor

Choose a reason for hiding this comment

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

@victornoel let's name this returnsCreatedWallets.

MatcherAssert.assertThat(
"Can't create wallet in wallets",
wallets,
new IsIterableWithSize<>(new IsEqual<>(1))
Copy link
Contributor

Choose a reason for hiding this comment

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

@victornoel can we check the IDs of the returned wallets as well?

That said I know this might not be working yet, but let's add that to the puzzle to expand this test.

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 that bit of code is not related to the PR, I just updated the style of the assertion to something more OO.

Copy link
Contributor

Choose a reason for hiding this comment

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

@victornoel understood.


/**
* Wallets in path.
*
* @since 0.1
* @todo #12:30min Make uniform the way file extensions are handled
Copy link
Contributor

Choose a reason for hiding this comment

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

@victornoel not sure why we need a separate task here, should be fairly straightforward. Refactor the class by storing the extension as an instance variable, move the filter from the instance to a local variable to iterator(), and use the extension both in iterator and in create.

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 do you mean I should have done that? I don't consider it's part of the scope of issue #12.

Copy link
Contributor

Choose a reason for hiding this comment

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

@victornoel why not in the scope? It's at least somewhat related, it affects your implementation and the way wallets are fetched. Aside from that, it's an internal detail that's a) not defined in some architectural documentation (as far as I know), and b) easy to fix. An extra task seems superfluous to me.

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 because I spent the allotted time on this, and the original issue wasn't about having a coherent naming of the wallet files, it was about creating a new wallet.

Copy link
Contributor

Choose a reason for hiding this comment

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

@victornoel ok, as far as changes to this go, I'm all good. I'll approve it and let @llorllale decide what to do further.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@victornoel I agree with @carlosmiranda on this: it was clear that the file extension for wallets is .z and it also looks like something easily handled internally as said here.

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 @llorllale ok I will implement that

@0crat
Copy link
Collaborator

0crat commented Aug 4, 2018

@carlosmiranda/z this job was assigned to you 5days ago. It will be taken away from you soon, unless you close it, see §8. Read this and this, please.

@victornoel
Copy link
Contributor Author

@carlosmiranda see answers to your comment. I updated the test name.

@codecov-io
Copy link

codecov-io commented Aug 4, 2018

Codecov Report

Merging #55 into master will increase coverage by 0.22%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master      #55      +/-   ##
============================================
+ Coverage     92.81%   93.03%   +0.22%     
  Complexity       49       49              
============================================
  Files            11       11              
  Lines           153      158       +5     
  Branches         10       10              
============================================
+ Hits            142      147       +5     
  Misses           11       11
Impacted Files Coverage Δ Complexity Δ
src/main/java/io/zold/api/WalletsIn.java 91.3% <100%> (+2.41%) 9 <1> (ø) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4a0b4b4...2c0e9a2. Read the comment docs.

@carlosmiranda
Copy link
Contributor

@victornoel thanks, please see my reply.

@victornoel
Copy link
Contributor Author

@carlosmiranda likewise

Copy link
Contributor

@carlosmiranda carlosmiranda left a comment

Choose a reason for hiding this comment

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

@llorllale good to merge on my end

*/
Wallet create();
Wallet create(final long id) throws IOException;
Copy link
Collaborator

Choose a reason for hiding this comment

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

@victornoel see my thoughts here. I think it's best for the id to be generated internally. I know that in zold-io/zold they have that separate Id class but I just don't see the need for that here at the moment.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@llorllale good for me

@@ -36,6 +41,11 @@
* Test case for {@link WalletsIn}.
*
* @since 0.1
* @todo #12:30min The name of the wallets in the test
Copy link
Collaborator

Choose a reason for hiding this comment

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

@victornoel the naming of the test wallets are OK for now.

a test should be added to ensure WalletsIn.create does overwrite and existing wallet.

You mean does not overwrite an existing wallet?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@llorllale yes, good catch :)

Copy link
Collaborator

Choose a reason for hiding this comment

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

@victornoel please remove the part about the test wallets naming. They're OK for testing purposes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@llorllale I don't understand, do you want me to remove the whole @todo or that I just leave a small one about testing not overwriting files? That's seem too small for a task and it will come naturally in the future.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@victornoel well, you can remove the @todo and leave a stubbed test in WalletsInTest

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@llorllale what do you mean stubbed test? I can't test for overwriting since anyway ids are randomly generated. I will just remove the todo and then the problem will manifest itself naturally when it should I suppose.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@victornoel I still think it's a valid test. All I think you need to do is add the skeleton of a test that would check this (make sure you leave a @todo for it).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@llorllale alright

@llorllale
Copy link
Collaborator

@victornoel see my comments above

@victornoel
Copy link
Contributor Author

@llorllale @carlosmiranda I've pushed corrections

@victornoel victornoel force-pushed the 12-create-wallet branch 2 times, most recently from 5623d34 to f35a101 Compare August 7, 2018 19:22
@victornoel
Copy link
Contributor Author

@llorllale I removed the @todo

@victornoel
Copy link
Contributor Author

@llorllale I added an ignored test for non-overwriting with some ideas about how to check it.

@victornoel
Copy link
Contributor Author

@llorllale actually wait, I'm going to improve that test

@victornoel
Copy link
Contributor Author

@llorllale it is safer now :)

@llorllale
Copy link
Collaborator

@rultor merge

@rultor
Copy link
Contributor

rultor commented Aug 7, 2018

@rultor merge

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

@rultor
Copy link
Contributor

rultor commented Aug 7, 2018

@rultor merge

@llorllale @victornoel Oops, I failed. You can see the full log here (spent 10min)

+ mvn clean
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building java-api 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http://repo.maven.apache.org/maven2/com/jcabi/jcabi-maven-plugin/0.14.1/jcabi-maven-plugin-0.14.1.pom

Downloaded: http://repo.maven.apache.org/maven2/com/jcabi/jcabi-maven-plugin/0.14.1/jcabi-maven-plugin-0.14.1.pom (0 B at 0.0 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/com/jcabi/jcabi-maven-plugin/0.14.1/jcabi-maven-plugin-0.14.1.jar

Downloaded: http://repo.maven.apache.org/maven2/com/jcabi/jcabi-maven-plugin/0.14.1/jcabi-maven-plugin-0.14.1.jar (0 B at 0.0 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/3.0.0/maven-clean-plugin-3.0.0.pom

Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/3.0.0/maven-clean-plugin-3.0.0.pom (0 B at 0.0 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-plugins/28/maven-plugins-28.pom

Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-plugins/28/maven-plugins-28.pom (0 B at 0.0 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/3.0.0/maven-clean-plugin-3.0.0.jar

Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/3.0.0/maven-clean-plugin-3.0.0.jar (0 B at 0.0 KB/sec)
[INFO] 
[INFO] --- maven-clean-plugin:3.0.0:clean (default-clean) @ java-api ---
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-shared-utils/3.0.0/maven-shared-utils-3.0.0.pom

Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-shared-utils/3.0.0/maven-shared-utils-3.0.0.pom (0 B at 0.0 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-shared-utils/3.0.0/maven-shared-utils-3.0.0.jar

Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-shared-utils/3.0.0/maven-shared-utils-3.0.0.jar (0 B at 0.0 KB/sec)
[INFO] Deleting /home/r/repo/target
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.486 s
[INFO] Finished at: 2018-08-07T19:59:16+00:00
[INFO] Final Memory: 12M/365M
[INFO] ------------------------------------------------------------------------
++ pwd
+ pdd --source=/home/r/repo --verbose --file=/dev/null
Found 7 lines in /home/r/repo/.pdd
My version is 0.20.3
Ruby version is 2.3.3 at x86_64-linux
Reading /home/r/repo
Excluding target/**/*
Excluding src/site/resources/**/*
41 file(s) found, 466 excluded
Reading .0pdd.yml...
Reading .travis.yml...
Reading LICENSE.txt...
Reading .pdd...
Reading .rultor.yml...
Reading README.md...
Reading .gitignore...
Reading src/test/resources/walletsIn/1.z...
Reading src/test/resources/walletsIn/3.z...
Reading src/test/resources/walletsIn/5.z...
Reading src/test/resources/walletsIn/4.z...
Reading src/test/resources/walletsIn/2.z...
Reading src/test/resources/walletsIn/6...
Reading src/test/resources/wallets/12345678abcdef...
Reading src/test/resources/wallets/invalid_id...
Reading src/test/java/io/zold/api/WalletsInTest.java...
\u001b[31mERROR\u001b[0m: src/test/java/io/zold/api/WalletsInTest.java; puzzle at line #84; @todo found, but puzzle can't be parsed, most probably because @todo is not followed by a puzzle marker, as this page explains: https://github.com/yegor256/pdd#how-to-format. If you can't understand the cause of this issue or you don't know how to fix it, please submit a GitHub issue, we will try to help you: https://github.com/yegor256/pdd/issues. This tool is still in its beta version and we will appreciate your feedback. Here is where you can find more documentation: https://github.com/yegor256/pdd/blob/master/README.md.
Exit code is 1
container 2a18db4a36de5cf126a5cc4dd73f92d953a337c0c5cfe7ae240533184ae233f2 is dead
Tue Aug  7 21:59:21 CEST 2018

@victornoel
Copy link
Contributor Author

@llorllale the @todo should be fixed, sorry about that!

@llorllale
Copy link
Collaborator

@rultor merge

@rultor
Copy link
Contributor

rultor commented Aug 7, 2018

@rultor merge

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

@rultor
Copy link
Contributor

rultor commented Aug 7, 2018

@rultor merge

@llorllale @victornoel Oops, I failed. You can see the full log here (spent 12min)

+ mvn clean
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building java-api 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http://repo.maven.apache.org/maven2/com/jcabi/jcabi-maven-plugin/0.14.1/jcabi-maven-plugin-0.14.1.pom

Downloaded: http://repo.maven.apache.org/maven2/com/jcabi/jcabi-maven-plugin/0.14.1/jcabi-maven-plugin-0.14.1.pom (0 B at 0.0 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/com/jcabi/jcabi-maven-plugin/0.14.1/jcabi-maven-plugin-0.14.1.jar

Downloaded: http://repo.maven.apache.org/maven2/com/jcabi/jcabi-maven-plugin/0.14.1/jcabi-maven-plugin-0.14.1.jar (0 B at 0.0 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/3.0.0/maven-clean-plugin-3.0.0.pom

Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/3.0.0/maven-clean-plugin-3.0.0.pom (0 B at 0.0 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-plugins/28/maven-plugins-28.pom

Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-plugins/28/maven-plugins-28.pom (0 B at 0.0 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/3.0.0/maven-clean-plugin-3.0.0.jar

Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/3.0.0/maven-clean-plugin-3.0.0.jar (0 B at 0.0 KB/sec)
[INFO] 
[INFO] --- maven-clean-plugin:3.0.0:clean (default-clean) @ java-api ---
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-shared-utils/3.0.0/maven-shared-utils-3.0.0.pom

Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-shared-utils/3.0.0/maven-shared-utils-3.0.0.pom (0 B at 0.0 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-shared-utils/3.0.0/maven-shared-utils-3.0.0.jar

Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-shared-utils/3.0.0/maven-shared-utils-3.0.0.jar (0 B at 0.0 KB/sec)
[INFO] Deleting /home/r/repo/target
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.480 s
[INFO] Finished at: 2018-08-07T21:42:21+00:00
[INFO] Final Memory: 13M/360M
[INFO] ------------------------------------------------------------------------
++ pwd
+ pdd --source=/home/r/repo --verbose --file=/dev/null
Found 7 lines in /home/r/repo/.pdd
My version is 0.20.3
Ruby version is 2.3.3 at x86_64-linux
Reading /home/r/repo
Excluding target/**/*
Excluding src/site/resources/**/*
41 file(s) found, 478 excluded
Reading .0pdd.yml...
Reading .travis.yml...
Reading LICENSE.txt...
Reading .pdd...
Reading .rultor.yml...
Reading README.md...
Reading .gitignore...
Reading src/test/resources/walletsIn/1.z...
Reading src/test/resources/walletsIn/3.z...
Reading src/test/resources/walletsIn/5.z...
Reading src/test/resources/walletsIn/4.z...
Reading src/test/resources/walletsIn/2.z...
Reading src/test/resources/walletsIn/6...
Reading src/test/resources/wallets/12345678abcdef...
Reading src/test/resources/wallets/invalid_id...
Reading src/test/java/io/zold/api/WalletsInTest.java...
\u001b[31mERROR\u001b[0m: src/test/java/io/zold/api/WalletsInTest.java; puzzle at line #91; @todo found, but puzzle can't be parsed, most probably because @todo is not followed by a puzzle marker, as this page explains: https://github.com/yegor256/pdd#how-to-format. If you can't understand the cause of this issue or you don't know how to fix it, please submit a GitHub issue, we will try to help you: https://github.com/yegor256/pdd/issues. This tool is still in its beta version and we will appreciate your feedback. Here is where you can find more documentation: https://github.com/yegor256/pdd/blob/master/README.md.
Exit code is 1
container ed26b788ddcf51640d491e738e740c2e6f636bda7c05af338e8f05f20d8db2f1 is dead
Tue Aug  7 23:44:02 CEST 2018

@llorllale
Copy link
Collaborator

@victornoel remove or change the string argument for the @Ignore annotation

@victornoel
Copy link
Contributor Author

@llorllale my bad, thanks for the hint, I believe it should be ok now.

@llorllale
Copy link
Collaborator

@rultor merge

@rultor
Copy link
Contributor

rultor commented Aug 8, 2018

@rultor merge

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

@rultor rultor merged commit 2c0e9a2 into zold-io:master Aug 8, 2018
@rultor
Copy link
Contributor

rultor commented Aug 8, 2018

@rultor merge

@llorllale Done! FYI, the full log is here (took me 20min)

@victornoel victornoel deleted the 12-create-wallet branch August 8, 2018 13:13
@0crat
Copy link
Collaborator

0crat commented Aug 8, 2018

Job gh:zold-io/java-api#55 is not assigned, can't get performer

@0crat
Copy link
Collaborator

0crat commented Aug 8, 2018

@ypshenychka/z please review this job completed by @carlosmiranda/z, as in §30; the job will be fully closed and all payments will be made when the quality review is completed

@0crat 0crat removed the scope label Aug 8, 2018
@0crat
Copy link
Collaborator

0crat commented Aug 8, 2018

The job #55 is now out of scope

@0crat
Copy link
Collaborator

0crat commented Aug 8, 2018

Payment to ARC for a closed pull request, as in §28: +10 point(s) just awarded to @llorllale/z

@ypshenychka
Copy link

@carlosmiranda According to our QA Rules:

The code reviewer found at least three problems in the code.
Comments were mostly about design problems, not cosmetic issues.

Only one issue was found during code review.
Please confirm that you'll try to find at least three major problems while future reviews.

@carlosmiranda
Copy link
Contributor

@ypshenychka confirmed

@ypshenychka
Copy link

@carlosmiranda thank you

@ypshenychka
Copy link

@0crat quality acceptable

@0crat
Copy link
Collaborator

0crat commented Aug 9, 2018

Order was finished, quality is "acceptable": +15 point(s) just awarded to @carlosmiranda/z

@0crat
Copy link
Collaborator

0crat commented Aug 9, 2018

Quality review completed: +8 point(s) just awarded to @ypshenychka/z

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.

7 participants