Skip to content

Commit 958b626

Browse files
committed
Integrate new multi source git import into the scan procedure.
1 parent c87d81a commit 958b626

File tree

8 files changed

+36
-321
lines changed

8 files changed

+36
-321
lines changed

COMMANDS.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
- [Setup jQAssistant Java Code Analyzer](#setup-jqassistant-java-code-analyzer)
2626
- [Download Maven Artifacts to analyze](#download-maven-artifacts-to-analyze)
2727
- [Reset the database and scan the java artifacts](#reset-the-database-and-scan-the-java-artifacts)
28-
- [Import git log](#import-git-log)
28+
- [Import git data](#import-git-data)
2929
- [Import aggregated git log](#import-aggregated-git-log)
3030
- [Parameter](#parameter)
3131
- [Environment Variable](#environment-variable)
@@ -228,9 +228,9 @@ enhance the data further with relationships between artifacts and packages.
228228

229229
Be aware that this script deletes all previous relationships and nodes in the local Neo4j Graph database.
230230

231-
### Import git log
231+
### Import git data
232232

233-
Use [importGitLog.sh](./scripts/importGitLog.sh) to import git log data into the Graph.
233+
Use [importGit.sh](./scripts/importGit.sh) to import git data into the Graph.
234234
It uses `git log` to extract commits, their authors and the names of the files changed with them. These are stored in an intermediate CSV file and are then imported into Neo4j with the following schema:
235235

236236
```Cypher
@@ -256,7 +256,7 @@ Here is the resulting schema:
256256

257257
#### Parameter
258258

259-
The optional parameter `--repository directory-path-to-a-git-repository` can be used to select a different directory for the repository. By default, the `source` directory within the analysis workspace directory is used. This command only needs the git history to be present so a `git clone --bare` is sufficient. If the `source` directory is also used for the analysis then a full git clone is of course needed (like for Typescript).
259+
The optional parameter `--source directory-path-to-the-source-folder-containing-git-repositories` can be used to select a different directory for the repositories. By default, the `source` directory within the analysis workspace directory is used. This command only needs the git history to be present. Therefore, `git clone --bare` is sufficient. If the `source` directory is also used for code analysis (like for Typescript) then a full git clone is of course needed.
260260

261261
#### Environment Variable
262262

scripts/downloader/downloadAntDesign.sh

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,20 @@ mkdir -p ./runtime/logs
3737
################################################################
3838
# Download ant-design source files to be analyzed
3939
################################################################
40-
if [ ! -d "${SOURCE_DIRECTORY}" ] ; then # only clone if source doesn't exist
41-
git clone --branch "${PROJECT_VERSION}" https://github.com/ant-design/ant-design.git "${SOURCE_DIRECTORY}"
40+
PROJECT_NAME="ant-design"
41+
FULL_PROJECT_NAME="${PROJECT_NAME}-${PROJECT_VERSION}"
42+
FULL_SOURCE_DIRECTORY="${SOURCE_DIRECTORY}/${FULL_PROJECT_NAME}"
43+
44+
if [ ! -d "${FULL_SOURCE_DIRECTORY}" ] ; then # only clone if source doesn't exist
45+
git clone --branch "${PROJECT_VERSION}" https://github.com/ant-design/ant-design.git "${FULL_SOURCE_DIRECTORY}"
4246
fi
4347
(
44-
cd "${SOURCE_DIRECTORY}" || exit
48+
cd "${FULL_SOURCE_DIRECTORY}" || exit
4549
echo "download${ANALYSIS_NAME}: Installing dependencies..."
46-
npm install || exit
50+
npm install --verbose || exit
4751
echo "download${ANALYSIS_NAME}: Analyzing source..."
48-
npx --yes @jqassistant/ts-lce >./../runtime/logs/jqassistant-typescript-scan.log 2>&1 || exit
52+
npx --yes @jqassistant/ts-lce >"./../../runtime/logs/jqassistant-typescript-scan-${PROJECT_NAME}.log" 2>&1 || exit
4953
)
5054
mkdir -p artifacts/typescript
51-
mv -nv "${SOURCE_DIRECTORY}/.reports/jqa/ts-output.json" "artifacts/typescript/ant-design-${PROJECT_VERSION}.json"
55+
mv -nv "${FULL_SOURCE_DIRECTORY}/.reports/jqa/ts-output.json" "artifacts/typescript/${FULL_PROJECT_NAME}.json"
5256
################################################################

scripts/downloader/downloadAxonFramework.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@ echo "download${ANALYSIS_NAME}: SCRIPTS_DIR=${SCRIPTS_DIR}"
4343
################################################################
4444
# Download Artifacts that will be analyzed
4545
ARTIFACTS_GROUP="org.axonframework"
46-
source "${SCRIPTS_DIR}/downloadMavenArtifact.sh" -g ${ARTIFACTS_GROUP} -a axon-configuration -v ${ARTIFACTS_VERSION} || exit 2
47-
source "${SCRIPTS_DIR}/downloadMavenArtifact.sh" -g ${ARTIFACTS_GROUP} -a axon-disruptor -v ${ARTIFACTS_VERSION} || exit 2
48-
source "${SCRIPTS_DIR}/downloadMavenArtifact.sh" -g ${ARTIFACTS_GROUP} -a axon-eventsourcing -v ${ARTIFACTS_VERSION} || exit 2
49-
source "${SCRIPTS_DIR}/downloadMavenArtifact.sh" -g ${ARTIFACTS_GROUP} -a axon-messaging -v ${ARTIFACTS_VERSION} || exit 2
50-
source "${SCRIPTS_DIR}/downloadMavenArtifact.sh" -g ${ARTIFACTS_GROUP} -a axon-modelling -v ${ARTIFACTS_VERSION} || exit 2
51-
source "${SCRIPTS_DIR}/downloadMavenArtifact.sh" -g ${ARTIFACTS_GROUP} -a axon-test -v ${ARTIFACTS_VERSION} || exit 2
46+
source "${SCRIPTS_DIR}/downloadMavenArtifact.sh" -g "${ARTIFACTS_GROUP}" -a "axon-configuration" -v"${ARTIFACTS_VERSION}" || exit 2
47+
source "${SCRIPTS_DIR}/downloadMavenArtifact.sh" -g "${ARTIFACTS_GROUP}" -a "axon-disruptor" -v "${ARTIFACTS_VERSION}" || exit 2
48+
source "${SCRIPTS_DIR}/downloadMavenArtifact.sh" -g "${ARTIFACTS_GROUP}" -a "axon-eventsourcing" -v "${ARTIFACTS_VERSION}" || exit 2
49+
source "${SCRIPTS_DIR}/downloadMavenArtifact.sh" -g "${ARTIFACTS_GROUP}" -a "axon-messaging" -v "${ARTIFACTS_VERSION}" || exit 2
50+
source "${SCRIPTS_DIR}/downloadMavenArtifact.sh" -g "${ARTIFACTS_GROUP}" -a "axon-modelling" -v "${ARTIFACTS_VERSION}" || exit 2
51+
source "${SCRIPTS_DIR}/downloadMavenArtifact.sh" -g "${ARTIFACTS_GROUP}" -a "axon-test" -v "${ARTIFACTS_VERSION}" || exit 2
5252

5353
# Download the git history (bare clone without working tree) into the "source" folder.
5454
# This makes it possible to additionally import the git log into the graph
55-
git clone --bare https://github.com/AxonFramework/AxonFramework.git --branch "axon-${ARTIFACTS_VERSION}" "${SOURCE_DIRECTORY}/.git"
55+
git clone --bare https://github.com/AxonFramework/AxonFramework.git --branch "axon-${ARTIFACTS_VERSION}" "${SOURCE_DIRECTORY}/AxonFramework-${ARTIFACTS_VERSION}/.git"
5656
################################################################

scripts/downloader/downloadReactRouter.sh

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,20 @@ mkdir -p ./runtime/logs
3939
################################################################
4040
# Download react-router source files to be analyzed
4141
################################################################
42-
if [ ! -d "${SOURCE_DIRECTORY}" ] ; then # only clone if source doesn't exist
43-
git clone --branch "react-router@${PROJECT_VERSION}" https://github.com/remix-run/react-router.git "${SOURCE_DIRECTORY}"
42+
PROJECT_NAME="react-router"
43+
FULL_PROJECT_NAME="${PROJECT_NAME}-${PROJECT_VERSION}"
44+
FULL_SOURCE_DIRECTORY="${SOURCE_DIRECTORY}/${FULL_PROJECT_NAME}"
45+
46+
if [ ! -d "${FULL_SOURCE_DIRECTORY}" ] ; then # only clone if source doesn't exist
47+
git clone --branch "react-router@${PROJECT_VERSION}" https://github.com/remix-run/react-router.git "${FULL_SOURCE_DIRECTORY}"
4448
fi
4549
(
46-
cd "${SOURCE_DIRECTORY}" || exit
50+
cd "${FULL_SOURCE_DIRECTORY}" || exit
4751
echo "download${ANALYSIS_NAME}: Installing dependencies..."
4852
pnpm install --frozen-lockfile || exit
4953
echo "download${ANALYSIS_NAME}: Analyzing source..."
50-
npx --yes @jqassistant/ts-lce >./../runtime/logs/jqassistant-typescript-scan.log 2>&1 || exit
54+
npx --yes @jqassistant/ts-lce >"./../../runtime/logs/jqassistant-typescript-scan-${FULL_PROJECT_NAME}.log" 2>&1 || exit
5155
)
5256
mkdir -p artifacts/typescript
53-
mv -nv "${SOURCE_DIRECTORY}/.reports/jqa/ts-output.json" "artifacts/typescript/react-router-${PROJECT_VERSION}.json"
57+
mv -nv "${FULL_SOURCE_DIRECTORY}/.reports/jqa/ts-output.json" "artifacts/typescript/${FULL_PROJECT_NAME}.json"
5458
################################################################

scripts/importAggregatedGitLog.sh

Lines changed: 0 additions & 143 deletions
This file was deleted.

0 commit comments

Comments
 (0)