Skip to content

Commit c59d1fd

Browse files
committed
Disable database export for default analysis
1 parent 879cd65 commit c59d1fd

File tree

4 files changed

+23
-17
lines changed

4 files changed

+23
-17
lines changed

.github/workflows/code-reports.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ jobs:
112112
env:
113113
NEO4J_INITIAL_PASSWORD: ${{ secrets.NEO4J_INITIAL_PASSWORD }}
114114
run: |
115-
./../../scripts/analysis/analyze.sh --report All --profile Neo4jv5
115+
./../../scripts/analysis/analyze.sh
116116
117117
- name: Move reports from the temp to the results directory preserving their surrounding directory
118118
working-directory: temp
@@ -128,13 +128,15 @@ jobs:
128128
retention-days: 5
129129

130130
# Upload Database Export
131-
- name: Archive exported database
132-
uses: actions/upload-artifact@v3
133-
with:
134-
name: code-report-database-export-${{ matrix.java }}-python-${{ matrix.python }}-mambaforge-${{ matrix.mambaforge }}
135-
path: ./temp/**/import
136-
if-no-files-found: error
137-
retention-days: 5
131+
# Only possible after an export with "./../../scripts/analysis/analyze.sh --report DatabaseCsvExport"
132+
# Won't be done here because of performance and security concerns
133+
#- name: Archive exported database
134+
# uses: actions/upload-artifact@v3
135+
# with:
136+
# name: code-report-database-export-${{ matrix.java }}-python-${{ matrix.python }}-mambaforge-${{ matrix.mambaforge }}
137+
# path: ./temp/**/import
138+
# if-no-files-found: error
139+
# retention-days: 5
138140

139141
# Commit and push the native image agent results
140142
- name: Display environment variable "github.event_name"

COMMANDS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151

5252
The [analyze.sh](./scripts/analysis/analyze.sh) command comes with these command line options:
5353

54-
- `--report Csv` only generates CSV reports. This speeds up the report generation and doesn't depend on Python, Jupyter Notebook or any other related dependencies. The default value os `All` to generate all reports. `Jupiter` will only generate Jupyter Notebook reports.
54+
- `--report Csv` only generates CSV reports. This speeds up the report generation and doesn't depend on Python, Jupyter Notebook or any other related dependencies. The default value os `All` to generate all reports. `Jupiter` will only generate Jupyter Notebook reports. `DatabaseCsvExport` exports the whole graph database as a CSV file (performance intense, check if there are security concerns first).
5555
5656
- `--profile Neo4jv4` uses the older long term support (june 2023) version v4.4.x of Neo4j and suitable compatible versions of plugins and JQAssistant. `Neo4jv5` will explicitly select the newest (june 2023) version 5.x of Neo4j. Without setting
5757
a profile, the newest versions will be used. Profiles are scripts that can be found in the directory [scripts/profiles](./scripts/profiles/).

scripts/SCRIPTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ Script | Directory | Description
2222
| [Neo4jv5.sh](./profiles/Neo4jv5.sh) | profiles | Sets all settings variables for an analysis with Neo4j v5.x (newest version as of june 2023). |
2323
| [CentralityCsv.sh](./reports/CentralityCsv.sh) | reports | Looks for centrality using the Graph Data Science Library of Neo4j and creates CSV reports. |
2424
| [CommunityCsv.sh](./reports/CommunityCsv.sh) | reports | Detects communities using the Graph Data Science Library of Neo4j and creates CSV reports. |
25-
| [DatabaseCsvExport.sh](./reports/DatabaseCsvExport.sh) | reports | Exports the whole graph database as a CSV file using the APOC procedure "apoc.export.csv.all" |
2625
| [ExternalDependenciesCsv.sh](./reports/ExternalDependenciesCsv.sh) | reports | Executes "Package_Usage" Cypher queries to get the "external-dependencies-csv" CSV reports. |
2726
| [ExternalDependenciesJupyter.sh](./reports/ExternalDependenciesJupyter.sh) | reports | Creates the "overview" report (ipynb, md, pdf) based on the Jupyter Notebook "Overview.ipynb". |
2827
| [InternalDependenciesCsv.sh](./reports/InternalDependenciesCsv.sh) | reports | Executes "Package_Usage" Cypher queries to get the "internal-dependencies" CSV reports. |
@@ -37,6 +36,7 @@ Script | Directory | Description
3736
| [WordcloudJupyter.sh](./reports/WordcloudJupyter.sh) | reports | Creates the "overview" report (ipynb, md, pdf) based on the Jupyter Notebook "Overview.ipynb". |
3837
| [AllReports.sh](./reports/compilations/AllReports.sh) | compilations | Runs all report scripts. |
3938
| [CsvReports.sh](./reports/compilations/CsvReports.sh) | compilations | Runs all CSV report scripts (no Python and Chromium required). |
39+
| [DatabaseCsvExportReports.sh](./reports/compilations/DatabaseCsvExportReports.sh) | compilations | Exports the whole graph database as a CSV file using the APOC procedure "apoc.export.csv.all" |
4040
| [JupyterReports.sh](./reports/compilations/JupyterReports.sh) | compilations | Runs all Jupyter Notebook report scripts. |
4141
| [resetAndScan.sh](./resetAndScan.sh) | | Deletes all data in the Neo4j graph database and rescans the downloaded artifacts to create a new graph. |
4242
| [resetAndScanChanged.sh](./resetAndScanChanged.sh) | | Executes "resetAndScan.sh" only if "detectChangedArtifacts.sh" returns detected changes. |

scripts/reports/DatabaseCsvExport.sh renamed to scripts/reports/compilations/DatabaseCsvExportReports.sh

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,31 @@
33
# Exports the whole graph database as a CSV file using the APOC procedure "apoc.export.csv.all"
44
# The exported file can be found in the subdirectory "import" inside the tools/neo4j.. directory.
55

6+
# Note: This is a special case. It is treated as a compilation even if it is just a single cypher execution.
7+
# The reason for that is that it exports the whole graph database. This should only be done intentionally
8+
# and not within a default "AllReports.sh" run because it is performance intense and could raise security concerns.
9+
610
# Overrideable Constants (defaults also defined in sub scripts)
711
REPORTS_DIRECTORY=${REPORTS_DIRECTORY:-"reports"}
812

9-
## Get this "scripts/reports" directory if not already set
13+
## Get this "scripts/reports/compilations" directory if not already set.
1014
# Even if $BASH_SOURCE is made for Bourne-like shells it is also supported by others and therefore here the preferred solution.
1115
# CDPATH reduces the scope of the cd command to potentially prevent unintended directory changes.
1216
# This way non-standard tools like readlink aren't needed.
13-
REPORTS_SCRIPT_DIR=${REPORTS_SCRIPT_DIR:-$( CDPATH=. cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P )}
14-
echo "ExternalDependenciesCsv: REPORTS_SCRIPT_DIR=${REPORTS_SCRIPT_DIR}"
17+
REPORT_COMPILATIONS_SCRIPT_DIR=${REPORT_COMPILATIONS_SCRIPT_DIR:-$( CDPATH=. cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P )}
18+
echo "DatabaseCsvExportReports: REPORT_COMPILATIONS_SCRIPT_DIR=${REPORT_COMPILATIONS_SCRIPT_DIR}"
1519

1620
# Get the "scripts" directory by taking the path of this script and going one directory up.
17-
SCRIPTS_DIR=${SCRIPTS_DIR:-"${REPORTS_SCRIPT_DIR}/.."}
18-
echo "ExternalDependenciesCsv SCRIPTS_DIR=${SCRIPTS_DIR}"
21+
SCRIPTS_DIR=${SCRIPTS_DIR:-"${REPORTS_SCRIPT_DIR}/../.."}
22+
echo "DatabaseCsvExportReports: SCRIPTS_DIR=${SCRIPTS_DIR}"
1923

2024
# Get the "cypher" directory by taking the path of this script and going two directory up and then to "cypher".
2125
CYPHER_DIR=${CYPHER_DIR:-"${SCRIPTS_DIR}/../cypher"}
22-
echo "ExportDatabase: CYPHER_DIR=$CYPHER_DIR"
26+
echo "DatabaseCsvExportReports: CYPHER_DIR=$CYPHER_DIR"
2327

2428
# Define functions to execute a cypher query from within the given file (first and only argument)
2529
source "${SCRIPTS_DIR}/executeQueryFunctions.sh"
2630

2731
# Execute Database Export Procedure in background
2832
# The exported file can then be found in the subdirectory "import" inside the tools/neo4j.. directory.
29-
execute_cypher "${CYPHER_DIR}/Export_the_whole_database_as_CSV.cypher" &
33+
execute_cypher "${CYPHER_DIR}/Export_the_whole_database_as_CSV.cypher"

0 commit comments

Comments
 (0)