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

Dev #1

Open
wants to merge 47 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
318b36e
Supporting API migration use case
jdirocco Jul 31, 2019
6f985a1
Chenged index folder property
jdirocco Aug 1, 2019
bcdaabb
optimisation of building for oss-slave https://github.com/crossminer/…
MarcioMateus Aug 1, 2019
73122ac
KB changed property value
jdirocco Aug 2, 2019
4c25199
Remove unused properties for CROSSIndexRecommender
creat89 Aug 6, 2019
06ffe5a
[KB]: Temp folders are created
jdirocco Aug 8, 2019
a678687
KB indexes are downloaded from ci3 server
jdirocco Aug 12, 2019
35e7d18
[dashboard] remove ow2 script
valeriocos Aug 14, 2019
c93b49c
[doc] Add docker-compose issue section
valeriocos Aug 18, 2019
c3f65fc
[doc] Add task analysis section in README.md
valeriocos Aug 22, 2019
80d6462
#93 Remove docker-compose-dockerhub.yml file.
borisbaldassari Aug 24, 2019
9932f17
Multi-stage build of admin-webapp
Aug 26, 2019
f5989dc
Fix bug of missing version file
Aug 27, 2019
02cfa07
Added docker-compose file to list versions
Aug 27, 2019
5a501f8
storing git version information of dashboard-importer. image size opt…
Aug 27, 2019
dcd65d3
Image size optimizations
Aug 27, 2019
343a367
Added version information to metric-platform image
Aug 28, 2019
2971dbb
Added version information to api-gateway image
Aug 29, 2019
3b4f30e
Bug fixes
Aug 29, 2019
1916f85
added mechanism to easily select the branch for building
Aug 29, 2019
a09e37b
[metric-platform] We now need a Maven executable to compute classpath…
Aug 29, 2019
cde9819
Merge branch 'dev' into identify-versions
Aug 29, 2019
b5d5605
[dashboard] Execute dash-importer only once
valeriocos Sep 2, 2019
d7e8951
Merge pull request #97 from valeriocos/no-loop-importer
MarcioMateus Sep 6, 2019
8857002
#98 Update builds in oss-db dockerfile.
borisbaldassari Sep 10, 2019
6d9b16d
#98 Update mongo script to include all gz in home.
borisbaldassari Sep 10, 2019
09aa501
#93 Rename docker-compose to classic convention.
borisbaldassari Sep 10, 2019
aed517b
Merge branch 'master' into identify-versions
MarcioMateus Sep 12, 2019
eda0ba4
Update readme.md
valeriocos Sep 13, 2019
da80582
[dashboard] Add scava code dashboard
valeriocos Sep 13, 2019
614cd44
Merge pull request #96 from crossminer/identify-versions
MarcioMateus Sep 19, 2019
b47def5
Update README.md
ambpro Sep 20, 2019
869f397
Fix build of Dashboard Importer https://github.com/crossminer/scava-d…
MarcioMateus Sep 23, 2019
10f52ac
Mount data-intensive folders as volumes to reduce oss-app container s…
MarcioMateus Sep 30, 2019
e5a6da1
[KB] a new KB dump has been added.
jdirocco Oct 3, 2019
4420a39
Update Dockerfile
jdirocco Oct 4, 2019
3dacf08
Update application.properties
jdirocco Oct 10, 2019
115907a
Added a new db dump
jdirocco Oct 28, 2019
4a45855
Update application.properties
jdirocco Nov 5, 2019
ffa43db
KB: Added Focus source path
jdirocco Nov 13, 2019
4bf52eb
Merge branch 'dev' of github.com:crossminer/scava-deployment into dev
jdirocco Nov 13, 2019
fb96501
Update application.properties
jdirocco Dec 6, 2019
45de88c
Update application.properties
jdirocco Dec 10, 2019
a54ac61
Changed path of Puppeteer tool
MarcioMateus Dec 17, 2019
1532209
Merge pull request #110 from crossminer/update-puppet-dir
blueoly Dec 17, 2019
4d11340
Update README.md
davidediruscio Dec 24, 2019
161a2d4
Update README.md
davidediruscio Dec 24, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
BRANCH=dev
4 changes: 2 additions & 2 deletions KB-db/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
FROM mongo:3.4

# Get download dump archive
ADD http://ci3.castalia.camp/dl/M30/KB_CROSSMINER.gz /home
RUN mv /home/KB_CROSSMINER.gz /home/CROSSMINER.gz
ADD http://ci4.castalia.camp/dl/CROSSMINER.20191028.gz /home
RUN mv /home/CROSSMINER.20191028.gz /home/CROSSMINER.gz
WORKDIR home


Expand Down
25 changes: 21 additions & 4 deletions KB/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,32 @@ FROM openjdk:8-jdk-alpine

LABEL description="Image with the Knowledge base image"

# File with Docker specific configurions
ARG BRANCH=dev

RUN apk add --update \
curl \
&& rm -rf /var/cache/apk/*

WORKDIR /home/root

# File with Docker specific configurations
COPY application.properties application.properties
COPY src-rascal/ /home/root

# Downloads last jar build by the continuous integration server
RUN wget http://ci5.castalia.camp:8080/job/scava-knowledge-base/job/dev/lastSuccessfulBuild/artifact/knowledge-base/org.eclipse.scava.knowledgebase/target/scava.knoledgebase.jar
ADD http://ci3.castalia.camp/dl/index.tar.gz /home/root/
RUN tar -xzf /home/root/index.tar.gz
RUN wget http://ci5.castalia.camp:8080/job/scava-knowledge-base/job/$BRANCH/lastSuccessfulBuild/artifact/knowledge-base/org.eclipse.scava.knowledgebase/target/scava.knoledgebase.jar \
&& echo "$BRANCH-$(curl -s http://ci5.castalia.camp:8080/job/scava-knowledge-base/job/$BRANCH/lastSuccessfulBuild/consoleText | sed '3q;d' | awk '{ print $NF}')" > /version


RUN mkdir localM3models \
&& mkdir maven_repo \
&& mkdir deltas

# COPY Indexes.tar.gz /home/root/
RUN wget http://ci3.castalia.camp/dl/Indexes.tar.gz \
&& tar -xzf /home/root/Indexes.tar.gz \
&& rm /home/root/Indexes.tar.gz

# Update the jar file with the Docker specific configurions
RUN jar -uf scava.knoledgebase.jar application.properties

Expand Down
26 changes: 22 additions & 4 deletions KB/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,18 @@
spring.data.mongodb.host=kb-db
spring.data.mongodb.port=27017
spring.data.mongodb.database=CROSSMINER
spring.http.multipart.maxRequestSize=30MB
spring.http.multipart.maxFileSize=30MB
lucene.index.folder=/home/root/CROSSMiner_lucene/
egit.github.token=6709f79a88ddd712d4adad09b694caa6e6587b52
ossmeter.url=http://oss-app:8182/
ossmeter.url=http://oss-app:8182
crossrec.numberOfNeighbours = 20
crossrec.numberOfRecommendedLibs = 20
api.call.recommendation.path=CLAMS_PATTERN/
logging.level.org.springframework.security= DEBUG
logging.level.org.hibernate= DEBUG
logging.file = application.log
sorecommender.INDEX_DIRECTORY = /home/root/index/
sorecommender.INDEX_DIRECTORY = /home/root/Indexes/
sorecommender.luceneTreshold = 5
sorecommender.lowerBoundLuceneTreshold = 1
sorecommender.upperBoundLuceneTreshold = 1000
Expand All @@ -29,6 +31,22 @@ sorecommender.bm25 = true
sorecommender.titleBoostValue = 1.0
sorecommender.questionBoostValue = 0.5
sorecommender.answerBoostValue = 0.5
sorecommender.importerBoostLibrariesPath = libraries.txt
sorecommender.importerBoostLibrariesPath = /libraries.txt
versionrecommender.releasefile = release_all.csv
migration.maven.path = "/User/juri/Desktop/juri/"
migration.maven.path = /home/root/maven_repo/
migration.deltas.path = /home/root/deltas/
migration.maven.max.training.clients = 10
migration.local.m3.files.path = /home/root/localM3models/
crossindexrecommender.hitsCodeBasedQuery=20
crossindexrecommender.hitsNLBasedQuery=20
crossindexrecommender.fieldForCodeBasedQuery=plain_text
crossindexrecommender.fieldForNLBasedQuery=plain_text
crossindexrecommender.fieldRecommendation=plain_text
crossindexrecommender.elasticsearch.hostname=elasticsearch
crossindexrecommender.elasticsearch.scheme=https
crossindexrecommender.elasticsearch.port=9200
focus.code.snippet.path=/home/root/Desktop/sourcesJar2/
focus.extension=.txt
focus.numberOfNeighbours=4
focus.code.snippet.numOfApiFunctionCalls = 5;
focus.code.snippet.numOfCodeSnippetResult = 10;
143 changes: 143 additions & 0 deletions KB/src-rascal/org/maracas/Extractor.rsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
module org::maracas::Extractor
import lang::java::m3::AST;
import lang::java::m3::Core;
import analysis::m3::TypeSymbol;

import org::maracas::Maracas;
import org::maracas::RunAll;
import org::maracas::delta::Detector;
import org::maracas::delta::Delta;
import org::maracas::delta::vis::Visualizer;
import ValueIO;
import ParseTree;

import IO;
import Relation;
import Set;
import String;
import List;

void methodBreakingChangesExporter(loc delta, loc report=|file:///Users/juri/Desktop/report_spring_data_mongo/|, loc output=|file:///Users/juri/Desktop/rascal-TEST.txt|) {
Delta d = parseDeltaFile(delta);
Delta mbc = methodDelta(d);
writeHtml(report + "Delta.html", d);
writeFile(|file:///Users/juri/Desktop/delta.txt|,mbc);
writeFile(output, "");
println("________REMOVED____________");
for(m <- mbc.removed){
appendToFile(output,"<m.elem.path[1..]>#null\n");
println(".");
}
println("________CHANGE PUBLIC TO PRIVATE________");
for(m<- mbc.accessModifiers){
if(m.mapping[0]==\public())
appendToFile(output,"<m.elem.path[1..]>#null\n");
println(".");
}
println("_______RENAMED____________");
for(m <- mbc.renamed){
appendToFile(output,"<m.mapping[0].path[1..]>#<m.mapping[1].path[1..]>\n");
println(".");
}
println("_______MOVED_________");
for(m <- mbc.moved){
appendToFile(output,"<m.mapping[0].path[1..]>#<m.mapping[1].path[1..]>\n");
println(".");
}
println("_______CHANGE PARAM LIST_________");
for(m <- mbc.paramLists){
appendToFile(output,"<m.elem.path[1..-1]><m.mapping[0]>)#<m.elem.path[1..-1]><m.mapping[1]>)\n");
println(".");
}
println("_______CHANGE RETURN TYPE_________");
for(m <- mbc.types){
appendToFile(output,"<m.elem.path[1..-1]><m.mapping[0]>)#<m.elem.path[1..-1]><m.mapping[1]>)\n");
println(".");
}
for(m <- mbc.deprecated) {
appendToFile(output,"<m.elem.path[1..]>#null\n");
println(".");
}
}

void myRunAll(loc libs=|file:///Users/ochoa/Documents/cwi/crossminer/data/api-migration-dataset/sonarqube/erase/|, loc clients=|file:///Users/ochoa/Documents/cwi/crossminer/data/api-migration-dataset/sonarqube/clients/|,loc output=|file:///Users/ochoa/Desktop/results.txt|){

set[loc] libraries = walkJARs(libs);
for (lib1 <- libraries){
for (lib2 <- libraries)
if (lib1 != lib2){
try {
str v1 = lib1.path[findLast(lib1.path,"/")+1..-4];
v1 = replaceLast(v1, "sonar-plugin-api-","sonar-plugin-api__");
loc clients_loc = clients + v1;
if(exists(clients_loc)){
println("Computing Delta model <lib1.path> <lib2.path>");

Delta d;
if(!exists(libs + "Delta" + lib1.file + "-" + lib2.file + ".delta"))
d = delta(lib1, lib2);
else
d = parseDeltaFile(clients_loc);
println("Pruning breaking changes...");
d = breakingChanges(d);

set[loc] clients = walkJARs(clients_loc);
int i = 0;
int count = size(clients);

for (client <- clients) {
try {
i = i + 1;
println("[<i>/<count>] Computing detection model for <client>... ");

M3 m = createM3FromJar(client);
set[Detection] detects = detections(m, d);

if (size(detects) > 0)
writeBinaryValueFile(clients_loc + "detection" + lib1.file + "-" + lib2.file + (client.file + ".detection"), detects);
writeFile(output, "<lib1.path>,<lib2.path>,<client>, <size(detects)>");
}
catch e:
writeFile(output, "<lib1.path>,<lib2.path>,<client>,-1 \n <e> \n \n");

}
}
}
catch e:
writeFile(output, "<lib1>,<lib2>,-1,-1 \n <e> \n \n");
}
}
}


void allVersionsDeltas(loc libs=|file:///Users/juri/development/git/aethereal/aethereal/dataset/libraries/|, loc report=|file:///Users/juri/Desktop/report_spring_data_mongo/|, loc output=|file:///Users/juri/Desktop/rascal-TEST.txt|){
set[loc] libraries = walkJARs(libs);
for (lib1 <- libraries){
for (lib2 <- libraries)
if(lib1 != lib2)
try{
println("Computing: <lib1> <lib2>");
methodBreakingChangesExporter(lib1, lib2);
}
catch:
println("\t###ERROR: <lib1> <lib2>");
}
}


void methodBreakingChangesExporter(loc libV1, loc libV2, loc report=|file:///Users/juri/Desktop/report_sonarcube/|, loc output=|file:///Users/juri/Desktop/rascal-TEST.txt|) {
println(report + ("Delta" + libV1.file + "-" + libV2.file + ".delta"));
if(!exists(report + ("Delta" + libV1.file + "-" + libV2.file + ".delta"))){
Delta d = delta(libV1, libV2);
writeFile(|file:///Users/juri/Desktop/delta.txt|,d);
writeFile(output, "");
writeBinaryValueFile(report + ("Delta" + libV1.file + "-" + libV2.file + ".delta"), d);
writeHtml(report + ("Delta" + libV1.file + "-" + libV2.file + ".html"), d);
}
}

Delta parseDeltaFile(loc report) {
loc entry = report;
Delta deltas = readBinaryValueFile(#Delta, entry);
return deltas;
}
Loading