Skip to content

Conversation

Vatavuk
Copy link
Contributor

@Vatavuk Vatavuk commented Aug 6, 2018

Implemented logic for building copies iterable for #56.
Left two puzzles. One for wallets comparison and one for additional tests.

@0crat 0crat added the scope label Aug 6, 2018
@0crat
Copy link
Collaborator

0crat commented Aug 6, 2018

Job #60 is now in scope, role is REV

@0crat
Copy link
Collaborator

0crat commented Aug 6, 2018

This pull request #60 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

@codecov-io
Copy link

codecov-io commented Aug 6, 2018

Codecov Report

Merging #60 into master will decrease coverage by 1.33%.
The diff coverage is 86.36%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master      #60      +/-   ##
============================================
- Coverage     92.85%   91.51%   -1.34%     
- Complexity       52       58       +6     
============================================
  Files            11       11              
  Lines           168      224      +56     
  Branches         11       23      +12     
============================================
+ Hits            156      205      +49     
- Misses           12       15       +3     
- Partials          0        4       +4
Impacted Files Coverage Δ Complexity Δ
src/main/java/io/zold/api/Remote.java 87.5% <100%> (+12.5%) 0 <0> (ø) ⬇️
src/main/java/io/zold/api/Copies.java 85.71% <85.71%> (+7.93%) 6 <6> (+5) ⬆️
src/main/java/io/zold/api/CpTransaction.java 0% <0%> (-100%) 0% <0%> (-1%)
src/main/java/io/zold/api/RtTransaction.java 98.76% <0%> (-1.24%) 26% <0%> (+1%)
src/main/java/io/zold/api/Wallet.java 80.85% <0%> (+1.68%) 0% <0%> (ø) ⬇️
src/main/java/io/zold/api/RtNetwork.java 100% <0%> (+10%) 6% <0%> (+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 aef97b4...61fda80. Read the comment docs.

@Vatavuk
Copy link
Contributor Author

Vatavuk commented Aug 10, 2018

@carlosmiranda ping

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.

@Vatavuk see comments, Thanks for the reminder, apologies for the delay.

@SuppressWarnings("PMD.AvoidInstantiatingObjectsInLoops")
private static Iterable<Copy> copies(final long id,
final Iterable<Remote> remotes) throws IOException {
final List<Copy> copies = new ArrayList<>(0);
Copy link
Contributor

Choose a reason for hiding this comment

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

@Vatavuk let's not initialize with size zero, this will force unnecessary reallocation internally for the first element. Let's use as small sensible default, like 10.

@@ -43,6 +44,7 @@
* wallets; Network.push must push a wallet to a remote based in remote.
* @checkstyle JavadocMethodCheck (500 lines)
* @checkstyle MagicNumberCheck (500 lines)
* @checkstyle ClassDataAbstractionCouplingCheck (500 lines)
Copy link
Contributor

Choose a reason for hiding this comment

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

@Vatavuk 2 lines is fine here

* @return Boolean Boolean
* @throws IOException If fails
* @todo #56:30min Comparing of two wallets should be done in a different
* manner. Wallets should implement Bytes interface from cactoos and
Copy link
Contributor

Choose a reason for hiding this comment

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

@Vatavuk why Bytes? any explanation here would be great.

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 my idea was to use Equality class from cactoos which compares byte representations of two objects. This way we don't need to explicitly compare object content parameter by parameter. Wallet just need to print itself to a byte array and Equality class will do the comparison. Wallet will need to implement Bytes because Equality operates on that interface.

More about this idea here

Copy link
Collaborator

Choose a reason for hiding this comment

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

@Vatavuk sorry, but I disagree with this solution:

  • I don't think we have a business need to serialize wallets into bytes
  • I disagree with Yegor on this one. I think it goes against the very idea of having "living objects". I can't reconcile having "living objects" turn into "dead byte streams". And like I mentioned in my previous point, I don't yet see any connection between wallets and streams of bytes.

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 Ok, I understand. My intention was to avoid writing multiple if statements. I've updated todo description

@Vatavuk
Copy link
Contributor Author

Vatavuk commented Aug 10, 2018

@carlosmiranda fixed

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

@Vatavuk
Copy link
Contributor Author

Vatavuk commented Aug 14, 2018

@llorllale updated todo description

@llorllale
Copy link
Collaborator

@rultor merge

@rultor
Copy link
Contributor

rultor commented Aug 16, 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 16, 2018

@rultor merge

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

Excluding src/site/resources/**/*
42 file(s) found, 790 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...
Reading src/test/java/io/zold/api/CopiesTest.java...
Puzzle 56-02b4f5e6 30/DEV at src/test/java/io/zold/api/CopiesTest.java
Reading src/test/java/io/zold/api/ScoreTest.java...
Reading src/test/java/io/zold/api/NetworkTest.java...
Puzzle 5-38f68f69 30/DEV at src/test/java/io/zold/api/NetworkTest.java
Reading src/test/java/io/zold/api/CpTransactionTest.java...
Reading src/test/java/io/zold/api/package-info.java...
Reading src/test/java/io/zold/api/WalletTest.java...
Puzzle 21-829d3247 30/DEV at src/test/java/io/zold/api/WalletTest.java
Reading src/test/java/io/zold/api/RtTransactionTest.java...
Reading src/test/java/io/zold/api/TaxesTest.java...
Reading src/test/java/io/zold/api/TaxBeneficiariesTest.java...
Reading src/main/java/io/zold/api/Score.java...
Reading src/main/java/io/zold/api/WalletsIn.java...
Puzzle 12-1be65647 30/DEV at src/main/java/io/zold/api/WalletsIn.java
Reading src/main/java/io/zold/api/RtNetwork.java...
Puzzle 5-fd3c6d54 30/DEV at src/main/java/io/zold/api/RtNetwork.java
Reading src/main/java/io/zold/api/Wallets.java...
Reading src/main/java/io/zold/api/TaxBeneficiaries.java...
Reading src/main/java/io/zold/api/Taxes.java...
Puzzle 40-432fb579 30/DEV at src/main/java/io/zold/api/Taxes.java
Reading src/main/java/io/zold/api/CpTransaction.java...
Puzzle 54-c02fec87 30/DEV at src/main/java/io/zold/api/CpTransaction.java
Reading src/main/java/io/zold/api/Network.java...
Reading src/main/java/io/zold/api/Remote.java...
Reading src/main/java/io/zold/api/package-info.java...
Reading src/main/java/io/zold/api/RtScore.java...
Reading src/main/java/io/zold/api/Transaction.java...
Reading src/main/java/io/zold/api/Wallet.java...
Puzzle 16-e32ec38b 30/DEV at src/main/java/io/zold/api/Wallet.java
Puzzle 16-27c16652 30/DEV at src/main/java/io/zold/api/Wallet.java
Puzzle 54-605ff193 30/DEV at src/main/java/io/zold/api/Wallet.java
Reading src/main/java/io/zold/api/RtTransaction.java...
Reading src/main/java/io/zold/api/Copies.java...
Puzzle 56-75691dc4 30/DEV at src/main/java/io/zold/api/Copies.java
Reading pom.xml...
Reading .gitattributes...
\u001b[31mERROR\u001b[0m: Puzzle src/main/java/io/zold/api/Copies.java:85-86 has a very short description of just 17 words while a minimum of 20 is required
\u001b[31mERROR\u001b[0m: 1 errors, see log above. 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 3fa7009df0f899b566f2e9ec6460f17cd8439d480fdfae7107fba804738050e8 is dead
Thu Aug 16 15:57:08 CEST 2018

@Vatavuk
Copy link
Contributor Author

Vatavuk commented Aug 16, 2018

@llorllale please merge again, fixed puzzle length problem.

@llorllale
Copy link
Collaborator

@rultor merge

@rultor
Copy link
Contributor

rultor commented Aug 16, 2018

@rultor merge

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

@rultor rultor merged commit 61fda80 into zold-io:master Aug 16, 2018
@rultor
Copy link
Contributor

rultor commented Aug 16, 2018

@rultor merge

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

@0crat
Copy link
Collaborator

0crat commented Aug 16, 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 16, 2018
@0crat
Copy link
Collaborator

0crat commented Aug 16, 2018

The job #60 is now out of scope

@0crat
Copy link
Collaborator

0crat commented Aug 16, 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.

One out of three found issues is cosmetic.
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 18, 2018

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

@0crat
Copy link
Collaborator

0crat commented Aug 18, 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