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

#397 Graph infrastructure #402

Merged
merged 7 commits into from
Mar 5, 2020
Merged

#397 Graph infrastructure #402

merged 7 commits into from
Mar 5, 2020

Conversation

HDouss
Copy link
Contributor

@HDouss HDouss commented Feb 28, 2020

Resolving issue #397
Starting graph construction infrastructure.

@0crat
Copy link
Collaborator

0crat commented Feb 28, 2020

This pull request #402 is assigned to @fanifieiev/z, here is why; the budget is 15 minutes, see §4; please, read §27 and when you decide to accept the changes, inform @paulodamaso/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 no monetary reward for this job

@HDouss
Copy link
Contributor Author

HDouss commented Feb 28, 2020

@fanifieiev ping

@HDouss
Copy link
Contributor Author

HDouss commented Feb 29, 2020

@fanifieiev ping...here too..

Copy link

@fanifieiev fanifieiev left a comment

Choose a reason for hiding this comment

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

@HDouss Please take a look at the comments

* @throws IOException If fails
*/
public XmlGraph(final Skeleton skeleton) throws IOException {
this.nds = XmlGraph.build(skeleton);
Copy link

@fanifieiev fanifieiev Feb 29, 2020

Choose a reason for hiding this comment

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

@HDouss I don't think it is a good idea to execute code inside constructor.
https://www.yegor256.com/2015/05/07/ctors-must-be-code-free.html

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@fanifieiev generally we can execute code if it is to initialize a final field. I think it would be better than to make the field non final and execute the code later. What do you think?

Choose a reason for hiding this comment

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

@HDouss You can use org.cactoos.Scalar for that case.
In Cactoos project we have a lot of such cases.
The main idea is to make a late execution.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@fanifieiev Thanks.

* Calculates ingoing and outgoing connected nodes.
* @return List of nodes connected to this node.
*/
List<Node> connected();

Choose a reason for hiding this comment

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

@HDouss What about connections naming?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

"//methods/method[@ctor='false' and @abstract='false']"
);
final List<Node> result = new ArrayList<>(methods.size());
for (final XML method:methods) {

Choose a reason for hiding this comment

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

@HDouss I think Mapped list would be perfect 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.

@fanifieiev absolutely, did not about this class. Thanks!

@HDouss
Copy link
Contributor Author

HDouss commented Feb 29, 2020

@fanifieiev Thanks for your review. Fixed!

Copy link

@fanifieiev fanifieiev left a comment

Choose a reason for hiding this comment

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

@HDouss One more comment

* @throws IOException If fails
*/
public XmlGraph(final Skeleton skeleton) throws IOException {
this.nds = new Unchecked<>(

Choose a reason for hiding this comment

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

@HDouss Please use org.cactoos.scalar.Sticky for caching the evaluated list:

this.nds = new Unchecked<>(
   new Sticky<>(
        () -> XmlGraph.build(skeleton);
   )
);

Copy link

@fanifieiev fanifieiev left a comment

Choose a reason for hiding this comment

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

@HDouss Thanks
@paulodamaso We are good to merge this PR

@HDouss
Copy link
Contributor Author

HDouss commented Mar 1, 2020

@paulodamaso ping

Copy link
Collaborator

@paulodamaso paulodamaso left a comment

Choose a reason for hiding this comment

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

@HDouss Just one comment, please take a look

final String name = "name";
final Node.Simple node = new Node.Simple(name);
new Assertion<>(
"Must be more the 2 files",
Copy link
Collaborator

Choose a reason for hiding this comment

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

@HDouss I don't think that this message is related to what is being asserted, please fix it

@HDouss
Copy link
Contributor Author

HDouss commented Mar 1, 2020

@paulodamaso Thanks. Fixed.

@HDouss
Copy link
Contributor Author

HDouss commented Mar 2, 2020

@paulodamaso ping

@paulodamaso
Copy link
Collaborator

@HDouss Thank you

@paulodamaso
Copy link
Collaborator

@rultor merge

@rultor
Copy link
Collaborator

rultor commented Mar 3, 2020

@rultor merge

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

@rultor
Copy link
Collaborator

rultor commented Mar 3, 2020

@rultor merge

@HDouss @paulodamaso Oops, I failed. You can see the full log here (spent 5min)

-rwxrwxr-x  1 rultor rultor   6258 Mar  3 02:50 run.sh
-rw-rw-r--  1 rultor rultor    678 Mar  3 02:50 script.sh
-rw-rw-r--  1 rultor rultor   2570 Mar  3 02:50 secring.gpg
-rw-rw-r--  1 rultor rultor   1077 Mar  3 02:50 settings.xml
-rw-rw-r--  1 rultor rultor  10491 Mar  3 02:52 stdout
++ pwd
++ pwd
+ docker run -t --rm -v /tmp/rultor-X71z:/main '--env=MAVEN_OPTS=-XX:MaxPermSize=256m -Xmx1g' '--env=JAVA_OPTS=-XX:MaxPermSize=256m -Xmx1g' [email protected]:yegor256/jpeek.git --env=pull_id=402 [email protected]:HDouss/jpeek.git --env=fork_branch=#397 --env=head_branch=master '--env=pull_title=#397 Graph infrastructure' --env=author=paulodamaso '--env=scripts=( '\''export '\''\'\'''\''MAVEN_OPTS=-XX:MaxPermSize=256m -Xmx1g'\''\'\'''\'''\'' '\'';'\'' '\''export '\''\'\'''\''JAVA_OPTS=-XX:MaxPermSize=256m -Xmx1g'\''\'\'''\'''\'' '\'';'\'' '\''export '\''\'\'''\''[email protected]:yegor256/jpeek.git'\''\'\'''\'''\'' '\'';'\'' '\''export '\''\'\'''\''pull_id=402'\''\'\'''\'''\'' '\'';'\'' '\''export '\''\'\'''\''[email protected]:HDouss/jpeek.git'\''\'\'''\'''\'' '\'';'\'' '\''export '\''\'\'''\''fork_branch=#397'\''\'\'''\'''\'' '\'';'\'' '\''export '\''\'\'''\''head_branch=master'\''\'\'''\'''\'' '\'';'\'' '\''export '\''\'\'''\''pull_title=#397 Graph infrastructure'\''\'\'''\'''\'' '\'';'\'' '\''export '\''\'\'''\''author=paulodamaso'\''\'\'''\'''\'' '\'';'\'' '\''sudo gem install pdd -v 0.20.5'\'' '\'';'\'' '\''sudo gem install xcop'\'' '\'';'\'' '\''pdd -f /dev/null'\'' '\'';'\'' '\''mvn clean install -Pqulice --errors --settings ../settings.xml'\'' '\'';'\'' '\''mvn clean site -Psite --errors --settings ../settings.xml'\'' '\'';'\'' )' --hostname=docker --privileged --memory=6g --memory-swap=16g --oom-kill-disable --cidfile=/tmp/rultor-X71z/cid -w=/main -v /var/run/docker.sock:/var/run/docker.sock --entrypoint=/main/entry.sh --name=yegor256_jpeek_402 yegor256/rultor-image /main/entry.sh
WARNING: Your kernel does not support swap limit capabilities or the cgroup is not mounted. Memory limited without swap.
+ set -e
+ set -o pipefail
+ shopt -s dotglob
+ useradd -m -G sudo r
+ echo '%sudo ALL=(ALL) NOPASSWD:ALL'
+ cp -R /root/.bashrc /root/.cache /root/.composer /root/.gem /root/.gnupg /root/.m2 /root/.profile /root/texmf /home/r
+ cp -R ./cid ./end.sh ./entry.sh ./id_rsa ./id_rsa.pub ./pid ./pubring.gpg ./repo ./run.sh ./script.sh ./secring.gpg ./settings.xml ./stdout /home/r
+ rm -rf repo
+ chown -R r:r /home/r
+ chmod a+x /home/r/script.sh
+ su --login r --command /home/r/script.sh
mesg: cannot open /dev/pts/0: Permission denied
+ set -e
+ set -o pipefail
+ shopt -s expand_aliases
+ alias 'sudo=sudo -i'
+ export HOME=/home/r
+ HOME=/home/r
+ cd /home/r/repo
+ export 'MAVEN_OPTS=-XX:MaxPermSize=256m -Xmx1g'
+ MAVEN_OPTS='-XX:MaxPermSize=256m -Xmx1g'
+ export 'JAVA_OPTS=-XX:MaxPermSize=256m -Xmx1g'
+ JAVA_OPTS='-XX:MaxPermSize=256m -Xmx1g'
+ export [email protected]:yegor256/jpeek.git
+ [email protected]:yegor256/jpeek.git
+ export pull_id=402
+ pull_id=402
+ export [email protected]:HDouss/jpeek.git
+ [email protected]:HDouss/jpeek.git
+ export fork_branch=#397
+ fork_branch='#397'
+ export head_branch=master
+ head_branch=master
+ export 'pull_title=#397 Graph infrastructure'
+ pull_title='#397 Graph infrastructure'
+ export author=paulodamaso
+ author=paulodamaso
+ sudo -i gem install pdd -v 0.20.5
Successfully installed pdd-0.20.5
Parsing documentation for pdd-0.20.5
Done installing documentation for pdd after 0 seconds
1 gem installed
+ sudo -i gem install xcop
Successfully installed xcop-0.6
Parsing documentation for xcop-0.6
Done installing documentation for xcop after 0 seconds
1 gem installed
+ pdd -f /dev/null
/home/r/script.sh: line 9: pdd: command not found
container 5cafb6fb787fc22b6cf4749887bfe650695788ba60233ea54a95400390655f7a is dead
Tue Mar  3 02:55:07 CET 2020

@0crat
Copy link
Collaborator

0crat commented Mar 4, 2020

@fanifieiev/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.

@paulodamaso paulodamaso merged commit f018212 into cqfn:master Mar 5, 2020
@0crat 0crat removed the scope label Mar 5, 2020
@0crat
Copy link
Collaborator

0crat commented Mar 5, 2020

Job audit: performer @fanifieiev/z/z didn't make CR comments

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

Successfully merging this pull request may close these issues.

5 participants